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

Remove initial context from API spec #80

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

Comments

Projects
None yet
3 participants
@lanthaler
Copy link
Member

commented Feb 22, 2012

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

This comment has been minimized.

Copy link
Member

commented Feb 22, 2012

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

This comment has been minimized.

Copy link
Member Author

commented Feb 23, 2012

Removing it now doesn't prevent us to re-add it later if we really need it. I just think that it would make parsers and the spec simpler.

lanthaler added a commit that referenced this issue Mar 21, 2012

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

commented Apr 29, 2012

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

This comment has been minimized.

Copy link
Member Author

commented Apr 29, 2012

Which would imply that @type can be overwritten.. something we don't wanna allow.
-1 on this

@gkellogg

This comment has been minimized.

Copy link
Member

commented Apr 30, 2012

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

This comment has been minimized.

Copy link
Member Author

commented May 1, 2012

Quoting from the current spec:

"If a term is re-defined within a context, all previous rules associated with the previous definition are removed."

So I'm still -1 on this and think it causes much more confusion than necessary without much advantages. Framing should be used to address such use cases IMO.

@lanthaler

This comment has been minimized.

Copy link
Member Author

commented May 1, 2012

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 added a commit that referenced this issue Jun 7, 2012

@lanthaler

This comment has been minimized.

Copy link
Member Author

commented Aug 14, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.