Schema.org JSON-LD中的多个属性

时间:2016-11-01 17:08:42

标签: schema.org json-ld

我正在尝试制作一个像这样的JSON-LD:

????: {
"@type": "Person",
"jobTitle": "CEO",
"givenName": "Name",
"familyName": "Name",
"email": "mailto:info@example.com"
}

我该怎么写“????”如果给定的信息既适用于员工,也适用于创始人?

1 个答案:

答案 0 :(得分:1)

我认为JSON-LD不允许多个属性用于相同的值。

但不是重复数据......

"employee": {
  "@type": "Person",
  "name": "John Doe"
},
"founder": {
  "@type": "Person",
  "name": "John Doe"
}

...您只能定义一次Person,给它一个URI,并将此URI引用为employeefounder的值:

"@type": "Person",
"@id": "/team/john-doe#i",
"name": "John Doe"
"employee": {"@id": "/team/john-doe#i"},
"founder":  {"@id": "/team/john-doe#i"}

details and a complete example with @id