I have a JSON-LD document.
{
"@id": "VDWW1LL3MZ",
"first_name": "Vincent",
"last_name": "Willems",
"knows":["MartyP"],
"@context": {
"foaf": "http://xmlns.com/foaf/0.1/",
"first_name": "foaf:givenName",
"last_name": "foaf:familyName",
"knows": "foaf:knows",
"MartyP": {
"@id": "http://example.com/martyp",
"first_name": "Marty",
"last_name": "P"
}
}
}
Now, part of the context of this document is generated in run-time (the Marty P
object), but the foaf
prefix definition is static, and repeated for each document.
If I have like 10 prefix definitions, it feel wasteful to put them in each and every document. So I would like to do something like
generated document
:
{
"@id": "VDWW1LL3MZ",
"first_name": "Vincent",
"last_name": "Willems",
"knows":["MartyP"],
"@context": {
"@extends": "http://example.com/base_context.jsonld",
"MartyP": {
"@id": "http://example.com/martyp",
"first_name": "Marty",
"last_name": "P"
}
}
}
base_context.jsonld
:
{
"foaf": "http://xmlns.com/foaf/0.1/",
"first_name": "foaf:givenName",
"last_name": "foaf:familyName",
"knows": "foaf:knows"
}
Is this possible?