如何解决JSON-LD将一个对象框架化为多个引用
在我的示例中,我有一个带有两个标签的实体。每个标签都有对语言对象的引用:
[
{
"@id": "http://example.com/entity","http://example.com/label": [
{
"@id": "http://example.com/label1"
},{
"@id": "http://example.com/label2"
}
]
},{
"@id": "http://example.com/label1","http://example.com/value": "Label 1","http://example.com/language": {
"@id": "http://example.com/language"
}
},{
"@id": "http://example.com/label2","http://example.com/value": "Label 2",{
"@id": "http://example.com/language","http://example.com/value": "English"
}
]
当我用以下框架对其进行解析时:
{
"@context": {
"@base": "http://example.com/","@vocab": "http://example.com/"
},"@graph": {
"label": {}
}
}
我仅在其中一个标签中获得“英语”值。第二个只有语言ID:
{
"@context": {
"@base": "http://example.com/","@id": "entity","label": [
{
"@id": "label1","language": {
"@id": "language","value": "English"
},"value": "Label 1"
},{
"@id": "label2","language": {
"@id": "language"
},"value": "Label 2"
}
]
}
是否可以在两个标签中都使用“英语”值?
我的示例在json-ld playground上可用。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。