-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scoped/nested @contexts #66
Comments
There should be tests for scoped contexts as well. |
I have been thinking of this recently.. Apart from merging multiple documents into one I can't really see a good use case for it to be honest. So I would put that under advanced concepts. Are there any other use cases you can think of?
|
I don't think this has to do with spec design, I think the issue is editorial so I've changed the tags associated with the issue. I have no strong opinion on 'scoped' vs. 'nested', so more input from the rest of the group is needed on this. We probably should put a warning that contexts may be optimized when compaction occurs, but that does not belong in the JSON-LD Syntax specification - it is for the JSON-LD API spec. I don't think that data would ever end up in a more expanded form, depending on contexts that are higher-up in the document. That is, the algorithm for doing compaction shouldn't result in less compacted data. We may want to specify a few use cases that people should be aware of, and perhaps put a test case into the suite that shows a multi-level JSON-LD document with nested contexts where the same term, like "age" is changed between two levels of the document. The compacted form should still contain two multi-level contexts where the more nested context redefines "age". |
Manu, do you really think we should have multiple contexts after compaction?? There's no way to specify that in the API.. I mean no way to specify how to compact those two instances to the same term. How should we implement such "intelligence". I always thought compaction uses a passed context and a JSON-LD document. The JSON-LD document is expanded and then compacted by replacing the long IRIs with terms/prefixes mapped to them in the passed context. Honestly, I'm a bit confused.. |
The only way I can see nested contexts appearing in compaction output would be via optimization. Since optimization is unspecified, it can pretty much do whatever it wants (eg: output a new context for every level in a tree). The current vanilla API call won't output nested contexts nor should we require it to. The expansion algorithm needs to be able to handle nested contexts of course (and it already does). I think we just need some examples of what nested contexts look like and how they redefine properties somewhere -- and an expansion test case. |
RESOLVED: Change the 'nest'ed terminology to 'scope'ed when referring to |
Note: Move description from section "External Contexts" to "The Context" |
The "External Contexts" section briefly mentions nested contexts. This seems out of place and could perhaps use it's own named spec section. We might want to use the terminology "scoped" instead of "nested". Many languages use "scope" including the new "scoped" attribute for the style tag in HTML5.
I'm guessing most processors are unlikely to preserve scoped contexts when various conversions are done. This should probably be mentioned in this section so people are not surprised if their scoped context disappears and their data is in more expanded form (depending on higher up contexts).
http://json-ld.org/spec/latest/json-ld-syntax/#external-contexts
The text was updated successfully, but these errors were encountered: