简体   繁体   中英

How to refer to RDF statements in JSON-LD? How to state(ment) about statements?

Suppose you have a simple RDF statement x:Object x:predicate x:Subject , which is expressed in JSON-LD as {"@id": "x:Object", "x:predicate": {"@id": "x:Subject"}} . How do you refer to the specific object-predicate-subject relation, how do you "adress" the factual relation? What's the "@id" or the inline identity of a statement in JSON-LD? How do you ascribe "meta data" to a statement?

How do you express statements in JSON-LD, where the subject is another statement, eg [x:Subject x:predicate x:Object] x:metaPredicate x:MetaObject ?

How do you express statements in JSON-LD, where the object is another statement, eg x:MetaSubject x:metaPredicate [x:Subject x:predicate x:Object] ?

How do you express statements in JSON-LD, where the predicate is another statement (strange but possible), eg x:MetaSubject [x:Subject x:predicate x:Object] x:MetaObject ?

(PS: I realize the [] syntax of my samples is not conformant Turtle, but they serve to express my thoughts/questions.)

You need to use reification, there exists a standardized vocabulary for that. In JSON-LD it would look somewhat like this:

{
  "@context": {
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "subject": { "@id": "rdf:subject", "@type": "@id" },
    "predicate": { "@id": "rdf:predicate", "@type": "@id" },
    "object": { "@id": "rdf:object", "@type": "@id" }
  },
  "@type": "rdf:Statement",
  "subject": "x:Subject",
  "predicate": "x:predicate",
  "object": { "@id": "x:Object" },
  "x:metaPredicate": "x:MetaObject"
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM