我很难在网上找到这方面的例子,更不用说使用application/ld+json了。
该页面包含视频列表、主要内容项和相关新闻内容(视频项目列表)。我的网站类似于https://www.premierleague.com/的新闻文章。
我对此的定义如下:
{
"@context": "http://schema.org",
"@type": "ItemList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "my description",
"url": "https://www.example.com/carousel-item-1"
},
...
],
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://www.example.com/watch",
"alternativeHeadline": "The title of this page",
"description": "The description of the content",
"itemListElement": [
{
"@type": "Url", // this is the problem here
"url": "https://www.example.com/related-news-article"
}
]
}
}问题在于将最后一块内容描述为相关的新闻项目。,我该怎么描述这个?
这些新闻文章不具备NewsArticle所需的所有信息,只是一个标题、一个图片和一个链接。所以我选择了使用URL类型。但是,这并不满足于mainEntityOfPage中合适的子类型。
我可以在NewsArticle内部描述mainEntityOfPage (首选),还是需要描述一个全新的application/ld+json块?

发布于 2018-01-17 04:34:37
Schema.org不需要任何属性。即使您根本不提供任何属性,使用NewsArticle也是非常好的。但是,如果您只想提供一个URL作为值,则不应该为此指定URL类型。只需在@id中直接提供NewsArticle,另外还可以使用或不带NewsArticle:
{
"@id": "https://www.example.com/related-news-article"
}{
"@type": "NewsArticle",
"@id": "https://www.example.com/related-news-article"
}WebPage上的相关链接可以与relatedLink属性一起提供,该属性需要一个URL值。所以你可以用这样的东西:
{
"@type": "WebPage",
"relatedLink":
[
{"@id": "/related-news-article-1"},
{"@id": "/related-news-article-2"},
{"@id": "/related-news-article-3"}
]
}https://stackoverflow.com/questions/48275227
复制相似问题