You could write your @id as a compact IRI using a notation consisting of a prefix and a suffix. Prefixes are defined inside your @context
.
Have a look at this input:
{
"@context": {
"ex": "http://example.org/",
"foaf": "http://xmlns.com/foaf/0.1/"
},
"@type": "foaf:Person",
"@id":"ex:MaxMustermann"
}
This translates to this expanded definition:
[
{
"@id": "http://example.org/MaxMustermann",
"@type": [
"http://xmlns.com/foaf/0.1/Person"
]
}
]
You can also view this example on the JSON-LD playground.
As you can see, the prefix ex
is used to abbreviate the namespace of the @id
IRI. Same goes for @type
where the prefix foaf
is used.
Is this what you're looking for?