Skip to content
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

Closed
davidlehn opened this issue Jan 23, 2012 · 7 comments
Closed

Scoped/nested @contexts #66

davidlehn opened this issue Jan 23, 2012 · 7 comments

Comments

@davidlehn
Copy link
Member

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

@davidlehn
Copy link
Member Author

There should be tests for scoped contexts as well.

@lanthaler
Copy link
Member

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?

-----Original Message-----
From: David I. Lehn [mailto:reply+i-2942047-
0ef852fd1d7e10e7e821dbb665be9a27d05cb2c4-456407@reply.github.com]
Sent: Tuesday, January 24, 2012 5:35 AM
To: Markus Lanthaler
Subject: [json-ld.org] Scoped/nested @contexts (#66)

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


Reply to this email directly or view it on GitHub:
#66

@msporny
Copy link
Member

msporny commented Feb 5, 2012

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".

@lanthaler
Copy link
Member

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..

@dlongley
Copy link
Member

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.

@lanthaler
Copy link
Member

RESOLVED: Change the 'nest'ed terminology to 'scope'ed when referring to @contexts that exist inside of JSON objects.

@lanthaler
Copy link
Member

Note: Move description from section "External Contexts" to "The Context"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants