Property folding, opposite of nested properties? #895
Unanswered
jgonggrijp
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
@jgonggrijp sorry I didn't reply to this one earlier! It looks like (from a quick skim of the related issues and PRs) that you've likely solved this elsewhere. Essentially, the second example you gave would not work because it would change the meaning of I'll also add, that is you use the Web Annotation context URL http://www.w3.org/ns/anno.jsonld You might be helped vs. hand rolling contexts. Depending on your use case, it can be better to augment existing published contexts. At any rate, thank you for using JSON-LD and Web Annotations! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I feel that this question must have been asked before, but I could not find previous instances, let alone answers. This could be a duplicate of #718 but I am not sure; in any case, that question seems to come closest to what I want to ask.
The nested properties feature allows us to write nested objects in the compacted form that disappear in the expanded form. I need the opposite: a way to abbreviate a chain of properties into a single term, so that I can compact a complex linked graph into a flat object. Consider a web annotation, which has a beautiful data model, but which results in nested or linked objects that are difficult to work with in a programming context:
{ "@context": { "@base": "http://example.org/", "oa": "http://www.w3.org/ns/oa#", "hasBody": { "@id": "oa:hasBody", "@type": "@id" }, "hasSource": { "@id": "oa:hasSource", "@type": "@id" } }, "@id": "theAnnotation", "@type": "oa:Annotation", "hasBody": "theBody", "oa:hasTarget": { "hasSource": "theSource", "oa:hasSelector": { "@type": "oa:TextPositionSelector", "oa:start": 16, "oa:end": 25 } } }It would be extremely convenient if there was something that would enable me to write this instead:
{ "@context": "... (whatever goes in here)", "@id": "theAnnotation", "@type": "oa:Annotation", "hasBody": "theBody", "hasSource": "theSource", "start": 16, "end": 25 }Is there anything in the JSON-LD standards that would help to achieve this? A well-hidden context feature? Framing? I would prefer a context solution if there is one.
Beta Was this translation helpful? Give feedback.
All reactions