【问题标题】:SDTT says @type is unspecified when using JSON-LD relational contextSDTT 说使用 JSON-LD 关系上下文时未指定 @type
【发布时间】:2018-11-01 09:16:03
【问题描述】:

我正在尝试在 JSON-LD 中创建关系上下文。我的目标是指定模式类型的数据类型。

示例:所有 Actors 都是 Person,所有 Director 都是 Person,所有 Person 只有一个属性 Name。

{
    "@context" : {
        "actor" : {
            "@type" : "http://schema.org/Person",
            "@id" : "http://schema.org/actor"
        },
        "director" : {
            "@type" : "http://schema.org/Person",
            "@id" : "http://schema.org/director"
        },
        "Person" : {
            "@type" : "http://schema.org/name",
            "@id" : "http://schema.org/Person"
        }
    }
}

但 Google 的 SDTT 无法识别 @type 并表示未指定。我如何在这里给出上下文?我希望 SDTT 按姓名识别演员和导演。

{
    "actor" : ["Johnny Depp", "Christina Ricci"],
    "director" : "Tim Burton"
}

【问题讨论】:

    标签: json-ld google-rich-snippets


    【解决方案1】:

    通过使用@type in the context,您提供的是值类型,而不是节点类型

    节点类型指定所描述事物的类型,例如人物、地点、事件或网页。 值类型指定特定值的数据类型,例如整数、浮点数或日期。

    我不认为 JSON-LD 1.0 提供了在上下文中设置节点类型的方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-12-11
      • 1970-01-01
      • 1970-01-01
      • 2020-10-05
      • 1970-01-01
      • 1970-01-01
      • 2016-06-28
      相关资源
      最近更新 更多