【问题标题】:Connecting multiple organizations and websites via JSON-LD schema.org通过 JSON-LD schema.org 连接多个组织和网站
【发布时间】:2018-05-26 03:07:05
【问题描述】:

我正在尝试为公司/子公司及其网站完成机器可理解的关系描述。假设有一家母公司和两家子公司,它们都有自己的网站。我为每个主页部署一个Organization 脚本和一个WebSite 脚本。

父组织的 JSON-LD 读取:

<script type="application/ld+json">
{
  "@context": "http://www.schema.org",
  "@type": "Organization",
  "@id": "https://www.parentorg.com/#organization",
  "name": "Parent Org",
  "legalName": "Parent Org Inc.",
  "description": "Description of company",
  "foundingDate": "1978",
  "logo": "https://www.parentorg.com/images/logo.png",
  "image": "https://www.parentorg.com/de/images/outside.jpg",
  "url": "https://www.parentorg.com/",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "Street 110",
    "addressLocality": "City",
    "postalCode": "XX XXX",
    "addressCountry": "XX"
  },
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer support",
    "telephone": "+12-345-678-91011",
    "email": "contact@parentorg.com"
  },
  "sameAs": [
    "https://twitter.com/parentorg/",
    "https://www.instagram.com/parentorg/",
    "https://www.youtube.com/user/parentorg/",
    "https://plus.google.com/parentorg"
  ],
  "subOrganization": [
    {
      "@type": "Organization",
      "@id": "https://www.subsidiary-one.de/#organization",
      "name": "Subsidiary One"
    },
    {
      "@type": "Organization",
      "@id": "https://www.subsidiary-two.de/#organization",
      "name": "Subsidiary Two"
    }
  ]
}
</script>

父网站的 JSON-LD 是:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "WebSite",
  "@id": "https://www.parentorg.com/#website",
  "url": "https://www.parentorg.com/",
  "author": {
    "@type": "Organization",
    "@id": "https://www.parentorg.com/#organization",
    "name": "Parent Org"
  }
}
</script>

现在子公司的组织 JSON-LD 包含 parentOrganization 属性:

  "parentOrganization": {
    "@type": "Organization",
    "@id": "https://www.parentorg.com/#organization",
    "name": "Parent Org"
  }

这是交叉引用这些实体的好方法吗?当引用了 URI 时,我是否还需要在 subOrganizationparentOrganizationauthor 中写出 name 属性?

【问题讨论】:

    标签: schema.org json-ld structured-data


    【解决方案1】:

    是的,您遵循如何交叉引用实体的最佳实践(giving each entity an @id that is different from the url)。

    你没有在引用实体时提供额外的属性,所以这很好:

    "author": {"@id": "https://www.parentorg.com/#organization"}
    
    "subOrganization": [
      {"@id": "https://www.subsidiary-one.de/#organization"},
      {"@id": "https://www.subsidiary-two.de/#organization"}
    ]
    
    "parentOrganization": {"@id": "https://www.parentorg.com/#organization"}
    

    但是,这当然需要消费者获取引用的文档。但并非所有人都这样做(可能)。因此,如果您也想为这些消费者提供数据,您可以在 @id 之外添加属性。它可能只是一个、几个甚至所有属性。我认为你的例子中的两个是最重要的:

    • 提供@type 对于能够获取文档的消费者也很有用,因为它可以让他们在获取引用的资源之前决定他们是否对它感兴趣。例如,消费者可能只关心Organization 编辑的作品author,而不是Person

    • 提供name 属性对于以某种受益于名称/标签的方式显示包含的结构化数据的消费者非常有用。

    【讨论】:

    • 很好的解释。如果我们只提供@id,您是否知道消费者 Google 是否愿意获取相关数据?
    • @Ethan:据我所知,Google 不会记录他们是否遵循 @id 引用。我不知道他们是否这样做。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-08-10
    • 2017-10-10
    • 2019-04-29
    • 1970-01-01
    • 1970-01-01
    • 2018-11-13
    • 1970-01-01
    相关资源
    最近更新 更多