我无法弄清楚如何在同一页面上定义一堆视频.即搜索页面.假设您有一个可以返回50个不同视频的网站.那么你应该怎么定义这个JSON-LD?
我在电子商务产品页面上同时拥有Micro Data和JSON-LD,描述了同样的事情(在我的情况下是产品).由于超出此问题范围的原因,我无法删除这两种格式中的任何一种.我想知道:
这对谷歌来说是个问题吗?结构化数据测试工具确实显示两个项目(产品)而不是一个.
如果一个属性(假设产品的名称)在两种格式之间略有不同,那么两种格式中的任何一种,例如JSON-LD是否优先?
我已经在主页上定义Organization的WebSite节点上定义了发布者,现在我想从其他页面上的文章链接到该发布者.但是,我也希望链接到它WebSite,@id如果我遵循使用URL作为的建议,他们自然会共享相同的内容@id.
{
"@context": "http://schema.org",
"@type": "WebSite",
"@id": "http://www.example.com/",
"url": "http://www.example.com/",
...
"publisher": {
"@type": "Organization",
"@id": "http://www.example.com/", <-- duplicated
"url": "http://www.example.com/"
}
}
Run Code Online (Sandbox Code Playgroud)
{
"@context": "http://schema.org",
"@type": "WebPage",
"@id": "http://www.example.com/news",
"url": "http://www.example.com/news",
"isPartOf": {
"@id": "http://www.example.com/" <-- site or publisher?
}
...
"publisher": {
"@id": "http://www.example.com/" <-- site or publisher?
}
}
Run Code Online (Sandbox Code Playgroud)
我假设每个节点的ID必须是唯一的,那么是否有一个最佳实践来统一ID,例如添加哈希?
{
"@id": "http://www.example.com/#site",
...
"publisher": {
"@id": "http://www.example.com/#publisher",
}
}
Run Code Online (Sandbox Code Playgroud)
如果可行的话,处理器(谷歌)会加载@id以查找节点的其余属性吗?
与此相关的是,url在许多节点类型中发现的属性是假设@id …
下面的微数据标记效果很好,谷歌的结构化数据测试工具显示了一个CollectionPage和WebSite/WebPage作为孩子。
<body itemscope itemtype="https://schema.org/CollectionPage">
<span itemscope itemtype="https://schema.org/WebSite" itemprop="hasPart">
<a href="https://springfield-xxxx.us" itemprop="url">Official site of Springfield</a>
</span>
<span itemscope itemtype="https://schema.org/WebPage" itemprop="hasPart">
<a href="https://facebook.com/group/XXXX" itemprop="url">Local events in Springfield</a>
</span>
<span itemscope itemtype="https://schema.org/WebPage" itemprop="hasPart">
<a href="https://news.us/city/springfield-xxxx" itemprop="url">Latest news in Springfield</a>
</span>
</body>
Run Code Online (Sandbox Code Playgroud)
但是,当我添加 JSON-LD 时,Google 的结构化数据测试工具会分别显示对象CollectionPage,WebPage/WebSite就像它们没有连接一样。这是一个带有 JSON-LD 的示例:
<!DOCTYPE html>
<html>
<head>
<script type="application/ld+json">
{
"description": "...",
"author": {"@type":"Person", "name": "Homer J. Simpson"},
"@type": "CollectionPage",
"url": "http://my-springfield.us/sites",
"publisher": {
"@type": "Organization",
"logo": …Run Code Online (Sandbox Code Playgroud)