Closed michaelcpuckett closed 5 years ago
This issue was discussed in a meeting.
RESOLVED: Close framing #31, wontfix, with request for further discussion if they can provide more information to support its inclusion {: #resolution13 .resolution}
ACTION: Rob Sanderson to put comment in to #31 requesting more info
Thanks @iherman for reviewing this.
For my specific case, I want to model my data based on schema.org. I want to keep a generic, reusable frame and have the schema.org @vocab
do the heavy lifting of mapping the relationships. Unfortunately I must define every schema.org term I might use in the @context
. If these could all be set to a default, I would not need to have complete knowledge of the vocabulary I'm using.
jsonld.frame(json, {
"@context": {
"@vocab": "http://schema.org/",
"agent": {
"@container": "@set",
"@type": "@id"
},
"participant": {
"@container": "@set",
"@type": "@id"
},
"recipient": {
"@container": "@set",
"@type": "@id"
},
"author": {
"@container": "@set",
"@type": "@id"
},
...
},
})
If there is a simpler way to achieve this, please let me know.
Thanks @michaelcpuckett ! There isn't an easier way to do it I'm afraid, as the situation where every term in a vocabulary should always be @container: @set
is vanishingly small. It would mean that every relationship was aways one to many or many to many, and never one to one or one to many. (It's also a syntax issue for compaction via setting a context, rather than a framing issue per se, but that's not a big deal)
My understanding of the intent of @vocab
is to provide a default mapping from JSON to RDF, rather than a default mapping from RDF into a particular JSON structure. We have heard from several parties that the schema.org approach of just throwing @vocab
in there and letting the application sort it out is often insufficient, and it seems like you're in the same boat.
I would like to have all my relational data come back as arrays of IDs.
Right now I have to add the following to
@context
for each term:I propose a processor option (similar to
embed
) that would allow a defaultcontainer
.