我正在尝试制作一个像这样的JSON-LD:
????: {
"@type": "Person",
"jobTitle": "CEO",
"givenName": "Name",
"familyName": "Name",
"email": "mailto:info@example.com"
}
我该怎么写“????”如果给定的信息既适用于员工,也适用于创始人?
答案 0 :(得分:1)
我认为JSON-LD不允许多个属性用于相同的值。
但不是重复数据......
"employee": {
"@type": "Person",
"name": "John Doe"
},
"founder": {
"@type": "Person",
"name": "John Doe"
}
...您只能定义一次Person
,给它一个URI,并将此URI引用为employee
和founder
的值:
"@type": "Person",
"@id": "/team/john-doe#i",
"name": "John Doe"
"employee": {"@id": "/team/john-doe#i"},
"founder": {"@id": "/team/john-doe#i"}