-
Notifications
You must be signed in to change notification settings - Fork 7
JSON‐LD‐star examles
Examples of JSON-LD-star
Use @triple
who's value MUST encode a single triple
{
"@context": {
"@base": "http://example.org/",
"@vocab": "http://example.org/"
},
"value": {
"@triple": {
"@id": "bob",
"age": 42
}
},
"certainty": 0.8
}
This describes the equivalent of the following Triple-star:
PREFIX : <http://example.org/>
[ :value <<( :bob :age 42 )>> ; :certainty 0.8e0 ] .
Generally @triple
should not be used directly, as it corresponds to a triple term in RDF-star, which is intended to be used as part of a reifying triple.
JSON-LD-star supports reifying triples using the @reifies
keyword.
{
"@context": {
"@base": "http://example.org/",
"@vocab": "http://example.org/"
},
"@reifies": {
"@id": "bob",
"age": 42
},
"certainty": 0.8
}
This describes the equivalent of the following Triple-star:
PREFIX : <http://example.org/>
<< :bob :age 42 >> :certainty 0.8e0 .
If the object containing the @reifies
property has an explicit @id
, it is used as the reifier.
{
"@context": {
"@base": "http://example.org/",
"@vocab": "http://example.org/"
},
"@id": "r",
"@reifies": {
"@id": "bob",
"age": 42
},
"certainty": 0.8
}
This describes the equivalent of the following Triple-star:
PREFIX : <http://example.org/>
<< :bob :age 42 ~ :r >> :certainty 0.8e0 .
If the value of @reifies
describes multiple triples, the reifier reifies each of those triples (in this way, it's not unlike a named graph).
{
"@context": {
"@base": "http://example.org/",
"@vocab": "http://example.org/"
},
"@id": "r",
"@reifies": {
"@id": "bob",
"name": "Bob",
"age": 42
},
"certainty": 0.8
}
This describes the equivalent of the following Triple-star:
PREFIX : <http://example.org/>
<< :bob :name "Bob" ~ :r >> .
<< :bob :age 42 ~ :r >> .
:r :certainty 0.8e0 .
An annotation both reifies and asserts a triple.
{
"@context": {
"@base": "http://example.org/",
"@vocab": "http://example.org/"
},
"@id": "bob",
"age": {
"@value": 42,
"@annotation": {
"certainty": 0.8
}
}
}
This describes the equivalent of the following Triple-star:
PREFIX : <http://example.org/>
:bob :age 42 {| :certainty 0.8e0 |} .
An annotation can also use a named reifier:
An annotation both reifies and asserts a triple.
{
"@context": {
"@base": "http://example.org/",
"@vocab": "http://example.org/"
},
"@id": "bob",
"age": {
"@value": 42,
"@annotation": {
"@id": "r",
"certainty": 0.8
}
}
}
This describes the equivalent of the following Triple-star:
PREFIX : <http://example.org/>
:bob :age 42 ~ :r {| :certainty 0.8e0 |} .