大网数据广告活动
网站运营与故障问答

Should Website and Organization be linked?

· 52CE 我爱测

I'm wondering what the effects/benefits/issues are with linking Website and Organization structured data (specifically in JSON-LD). On the homepage of my site I have something like this: <script type='application/ld+json'> [{ "@c…

问题原文

原帖链接 · StuFu · CC BY-SA 4.0

I'm wondering what the effects/benefits/issues are with linking Website and Organization structured data (specifically in JSON-LD).

On the homepage of my site I have something like this:

<script type='application/ld+json'>
[{
    "@context":"http://schema.org",
    "@type":"Organization",
    "@id":"https://example.com/",
    "url":"http://example.com",
    "name":"My site",
    "logo":"https://example.com/logo.jpg",
    "sameAs": [
        "https://www.facebook.com/example/",
        "https://twitter.com/example"
    ]},
    {
        "@context":"http://schema.org",
        "@type":"WebSite",
        "@id":"https://example.com/",
        "url":"https://example.com",
        "name":"My Site",
        "potentialAction":{
            "@type":"SearchAction",
            "target":"https://example.com?searchQuery={search_term_string}",
            "query-input":"required name=search_term_string"
        }
}]
</script> 

In this case I've connected the Website and Organization with the same ID. I've noticed in the Structured Data Tool, Google will combine this into one data type:

I'm using Website for the potential benefits of the site search box and I'm using Organization for the benefits of contact point and linking to social accounts.

My question is: is this a good idea? Is there any reason to not connect these two items in structured data? What implications are there to link these items vs. keeping them as separate IDs?

已采纳解答

原帖链接 · unor · CC BY-SA 4.0

Same @id?

If items have the same @id, they are the same. These two snippets are semantically equivalent:

[
  {
    "@context": "http://schema.org",
    "@type": "Organization",
    "@id": "https://example.com/"
  },
  {
    "@context": "http://schema.org",
    "@type": "WebSite",
    "@id": "https://example.com/"
  }
]
{
  "@context": "http://schema.org",
  "@type": ["Organization", "WebSite"],
  "@id": "https://example.com/"
}

But are the organization and its website the same thing? I would say no. Examples that show why these are different entities:

  • Others might want to make statements only about the website or only about the organization. For example, if someone states <#i> ex:likes <https://example.com/> ., maybe they actually only like the website, but not the organization. If both were the same, it wouldn’t be possible to differentiate.

  • An organization might have multiple websites (e.g., per language), but if the organization and all of its websites would be the same entity, it would not be possible to associate the different url values with the corresponding inLanguage values. Each language version should get its own WebSite item (example).

A different @id for each thing

I would recommend to give your Organization its own @id, for example:

{
  "@type": "Organization",
  "@id": "https://example.com/#org",
  "url": "https://example.com/"
}

If you want to go the extra mile, you could even give your WebSite its own @id, so that it can be differentiated from the homepage:

{
  "@type": "WebSite",
  "@id": "https://example.com/#site",
  "url": "https://example.com/"
}
{
  "@type": "WebPage",
  "@id": "https://example.com/",
  "url": "https://example.com/"
}

Linking Organization and WebSite

You can associate the organization and its website(s) with suitable properties like author/creator, copyrightHolder, and/or publisher, as well as mainEntity/about.

(JSON-LD example)

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2019-04-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。