如何在json-ld文件中包含外部节点对象?

时间:2018-12-02 01:56:30

标签: schema.org json-ld

如何在jsonld文档中包括外部节点对象,并获得与嵌入式对象相同的扩展版本?例如:

d3 = {
  "@context": "http://schema.org",
  "name": "Steve Carr",
  "knows": {
    "@type": "Person",
    "name": "David",
  }
}

jsonld.expand(d3) 

输出:

[{'http://schema.org/knows': [{'@type': ['http://schema.org/Person'],
'http://schema.org/name': [{'@value': 'David'}]}],
'http://schema.org/name': [{'@value': 'Steve Carr'}]}]

当“ David”对象作为外部节点对象时,我想获得相同的输出。我该如何实现?

0 个答案:

没有答案