【发布时间】:2018-09-22 18:17:14
【问题描述】:
我正在学习如何使用 Node jsonld.js 使用 JSON-LD 帧,我想知道为什么有些属性被标记为 IRI 而其他属性被标记为术语,而我可以'看不出造成这种差异的明显原因。
这是sample。
例如,在该示例中,name 属性被标记为预期,而在其他情况下,它被标记为http://www.schema.org/name,与url 和http://www.schema.org/url 相同;我不知道为什么:
{
"@context": "https://schema.org/docs/jsonldcontext.json",
"@graph": [
{
"id": "_:b0",
"type": "MusicRecording",
"byArtist": {
"id": "_:b1",
"type": "http://www.schema.org/MusicGroup",
"http://www.schema.org/name": "Snoop Dogg",
"http://www.schema.org/sameAs": "/Snoop-Dogg/"
},
"name": "Paper'd Up",
"schema:sameAs": "/Snoop-Dogg/Paper%27d-Up/",
"url": "../Snoop-Dogg/Paper%27d-Up/",
"http://www.schema.org/duration": "PT3M55S",
"http://www.schema.org/image": "/static/track_images_200/lr1734_2009720_1372375126.jpg",
"http://www.schema.org/inAlbum": {
"id": "_:b2",
"type": "http://www.schema.org/MusicAlbum",
"http://www.schema.org/albumRelease": {
"id": "_:b4",
"type": "http://www.schema.org/MusicRelease",
"http://www.schema.org/datePublished": "2001",
"http://www.schema.org/recordLabel": "Priority"
},
"http://www.schema.org/name": "Paid the Cost to Be the Bo$$"
},
"http://www.schema.org/producer": {
"id": "_:b3",
"type": "http://www.schema.org/Person",
"http://www.schema.org/name": "Fredwreck",
"http://www.schema.org/sameAs": "/Fredwreck/",
"http://www.schema.org/url": {
"id": "../Fredwreck/"
}
},
"http://www.schema.org/thumbnailUrl": {
"id": "../static/track_images_100/mr1734_2009720_1372375126.jpg"
}
}
]
}
如何使用名为 type 而不是 IRI 的属性检索树(使用 jsonld.js)?
【问题讨论】: