2015-06-05 35 views
1

假設我有以下的JSON文檔:具體化三元組JSON-LD

{ 
    "@id":"http://www.example.com/id/linkFrom", 
    "http://www.example.com/link":{ 
    "@id":"http://www.example.com/id/linkTo", 
    "linkType":{ 
     "@id": "http://www.example.com/vocab#specialLink" 
    } 
    } 
} 

如何表達三聯<http://www.example.com/id/linkFrom> <http://www.example.com/link> <http://www.example.com/id/linkTo>有型http://www.example.com/vocab#specialLink

回答

2

我不知道,如果你真的想要分配「類型」整個三倍,但你問它和提Reification,你可以做這樣的事情:

[ 
    { 
    "@id": "http://www.example.com/id/linkFrom", 
    "http://www.example.com/link": [ 
     { 
     "@id": "http://www.example.com/id/linkTo" 
     } 
    ] 
    }, 
    { 
    "@id": "http://www.example.com/reifi/1", 
    "@type": [ 
     "http://www.example.com/vocab#specialLink", 
     "http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement" 
    ], 
    "http://www.w3.org/1999/02/22-rdf-syntax-ns#subject": [ 
     { 
     "@id": "http://www.example.com/id/linkFrom" 
     } 
    ], 
    "http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate": [ 
     { 
     "@id": "http://www.example.com/link" 
     } 
    ], 
    "http://www.w3.org/1999/02/22-rdf-syntax-ns#object": [ 
     { 
     "@id": "http://www.example.com/id/linkTo" 
     } 
    ] 
    } 
]