Skip to content

Remove initial context from API spec #80

Closed
lanthaler opened this Issue Feb 22, 2012 · 9 comments

3 participants

@lanthaler
JSON-LD Public Repositories member

Since we decided to add a mechanism to clear the active context (in issue #78), we can't rely on the initial context anymore. Instead we should specify that the information currently contained in the initial context has to be hardcoded in a compliant JSON-LD parser.

PROPOSAL: Remove initial context from API spec and define that compliant JSON-LD parsers have to automatically coerce the value of @type to an IRI.

@gkellogg
JSON-LD Public Repositories member

I'm worried about throwing out the initial context altogether. We may find other uses for it in the future. This could be addressed by updating #78 to define "clear the active context" as "set the active context to the initial context".

@lanthaler
JSON-LD Public Repositories member
@lanthaler lanthaler added a commit that referenced this issue Mar 21, 2012
@lanthaler lanthaler Reset active context to initial context if set to null
Updated the context processing algorithm. Depending of the outcome of issue #80 this might has to be changed.

This closes #78.
181c740
@msporny
JSON-LD Public Repositories member
msporny commented Apr 29, 2012

PROPOSAL: There is an initial context for all JSON-LD processors with one entry - { "@type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#" }. When a "@context" is set to null, the active context is set to the initial context.

@gkellogg
JSON-LD Public Repositories member

It is also useful to have the entry {"@graph": {"@type": "@id"}}, which should also exist for @type.

Otherwise, I'm not sure what having @type expand to "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" (I presume that was intended) buys us. It doesn't do anything during expansion, compaction or framing. FromRDF does this selectively based on a property. The only other place it's useful is in toRDF. Indeed, if we had this, then you might consider that @type would be expanded to "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" during expansion, which it is not. And that "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" should be compacted to @type, which is probably the case, but Niklas' use cases indicate that having this explicitly set in a context is probably the way to go.

So, -1 on this proposal. But I would suggest an alternative:

PROPOSAL: There is an initial contet for all JSON-LD processors:

{
  "@type": {"@type": "@id"},
  "@graph": {"@type": "@id"}
 }
@lanthaler
JSON-LD Public Repositories member
@gkellogg
JSON-LD Public Repositories member

We specifically disallow redefining keyword IDs, so this doesn't really open the door up for that. However, we could allow the following:

{
  "@type": {"@container": "@set"}
}

This shouldn't remove the @type:@id, but would say that when compacting or framing, always place @type in an array. This is probably the default for @graph.

@lanthaler
JSON-LD Public Repositories member
@lanthaler
JSON-LD Public Repositories member

RESOLVED: If JSON-LD has an initial context, it MUST be specified external to the JSON-LD Syntax specification at a well-known location.

@lanthaler lanthaler added a commit that referenced this issue Jun 7, 2012
@lanthaler lanthaler Add issue marker to initial context
This relates to #80.
7987f9a
@lanthaler
JSON-LD Public Repositories member

RESOLVED: Do not support an initial context in JSON-LD 1.0.

@lanthaler lanthaler added a commit that closed this issue Aug 14, 2012
@lanthaler lanthaler Remove initial context
This closes #80.
e300ee6
@lanthaler lanthaler closed this in e300ee6 Aug 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.