brotkrueml / schema

TYPO3 extension providing an API and view helpers for schema.org markup
https://extensions.typo3.org/extension/schema
GNU General Public License v2.0
32 stars 9 forks source link

Introduce NodeIdentifiers #65

Closed brotkrueml closed 3 years ago

brotkrueml commented 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.:

{
    "@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.

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 _:.