gpt4 book ai didi

seo - JSON-LD:报告模式类型的正确语法是什么?

转载 作者:行者123 更新时间:2023-12-04 16:32:44 33 4
gpt4 key购买 nike

我使用了几个 JSON-LD 格式化工具( Example 1Example 2Example 3 ),但没有一个具体到列出模式类型 Report , 及其属性(property) reportNumber .架构类型记录在案 here ,但没有例子。
This page一直是一个有用的引用,但我仍然有不确定性。
所以我想知道以下语法是否正确,如果不正确要更改什么:

<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Report",
"reportNumber": "1234",
"headline": "Report Headline",
"description": "Report Description",
"image": "img.jpg",
"author": {
"@type": "Organization",
"name": "Org. Name",
"url": "example.com"
},
"publisher": {
"@type": "Organization",
"name": "Org. Name",
"logo": {
"@type": "ImageObject",
"url": "logo.svg"
}
},
"datePublished": "2021-11-24",
"dateModified": "2021-11-24"
}
</script>
我刚刚换了类型 ArticleReport .在我看来 ReportArticle 的子集类型,使属性如 headlinedescription仍然有效,但除此之外,使属性 reportNumber有效的。我是 JSON-LD 的新手。

最佳答案

看起来你做对了。在 JSON-LD 中,您可以在其任何子类中使用类的任何属性。
为了验证您的 JSON-LD,我使用了 Google 的结构化工具 JSON-LD 验证器,可从 https://validator.schema.org/ 获得。 .我想你将来可能会发现它很有用。
您的代码段以零错误或警告通过了测试。请注意“logo.svg”,因为它是一个相对路径。我会将完整的 URL 添加到您的 Logo 中。这同样适用于 img.jpg

关于seo - JSON-LD:报告模式类型的正确语法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70091965/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com