Closed brotkrueml closed 3 years ago
It is possible in JSON-LD to use only a @id reference for a property. This is useful when using circular references, e.g.:
@id
{ "@context": "http://schema.org/", "@type": "Person", "@id": "https://example.org/#agent1", "name": "Secret Agent 1", "knows": { "@type": "Person", "name": "Secret Agent 2", "knows": { "@id": "https://example.org/#agent1" } } }
Or when using types which are connected with isPartOf and hasPart properties.
isPartOf
hasPart
Also JSON-LD knows the concept of a blank node identifiers. This is useful when the id has no IRI attached to, but nodes should be connected:
{ "@context": "http://schema.org/", "@type": "Person", "@id": "_:b1", "name": "Secret Agent 1", "knows": { "@type": "Person", "name": "Secret Agent 2", "knows": { "@id": "_:b1" } } }
The blank node identifier starts with _:.
_:
setId()
It is possible in JSON-LD to use only a
@id
reference for a property. This is useful when using circular references, e.g.:Or when using types which are connected with
isPartOf
andhasPart
properties.Also JSON-LD knows the concept of a blank node identifiers. This is useful when the id has no IRI attached to, but nodes should be connected:
The blank node identifier starts with
_:
.setId()
method of a type also a NodeIdentifier/BlankNodeIdentifier can be used.@id
value is set as defined in a type/property.