Skip to content

Confused about version triggering #99

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

Closed
BigBlueHat opened this issue Nov 29, 2018 · 5 comments
Closed

Confused about version triggering #99

BigBlueHat opened this issue Nov 29, 2018 · 5 comments

Comments

@BigBlueHat
Copy link
Member

Current text states...

The first context encountered when processing a document which contains @version determines the processing mode, unless it is defined explicitly through an API option.

However, the 1.1 playground at least, seems to "switch" on the first context object even if it does not have an @version.

For example:

{
  "@context": [
    "http://schema.org/",
    {
      "@version": 1.1
    }
  ],
  "@type": "Person",
  "name": "bar"
}

Throws:

jsonld.ProcessingModeConflict: @version: 1.1 not compatible with json-ld-1.0

So, my current proposal is to reword that text to:

Unless it is defined explicitly through an API option, the first context encountered when processing a document determines the processing mode.

However, I'm not sure if that matches any pre-existing thoughts/plans for version triggering.

Does a @context without @version state that it should be processed as json-ld-1.0? Or since it hasn't stated an @version does it just fallback to the default set in the JSON-LD processor (which is currently 1.0 most places)?

The API's 4.1.2. Algorithm step 3.5 describes the scenario when @version has been set to something within the context, but doesn't explain what happens when one is not present.

So, beyond updating the text above, we may also need to address this in the API spec also.

@BigBlueHat
Copy link
Member Author

Discovered this while discussing #20. It also relates to #85 and #33.

@BigBlueHat
Copy link
Member Author

So...that same example above works fine in @gkellogg's distiller (per #85 (comment)), and I also found a note about there being editorial changes needed/forth coming: #85 (comment)

Perhaps the ones I've just described were already in @gkellogg's brain--or something better more like. 😁

@gkellogg
Copy link
Member

The playground is out of date, we changed the text so that any use of @version set's it (it can only be 1.1). Formerly, if you set @version, it needed to be in the first context encountered, but that led to numerous issues. Your proposed rewording would be consistent with the previous definition. The wording is correct, but the playground (and presumably jsonld.js) needs to be updated.

@dlongley
Copy link
Contributor

jsonld.js needs to be fixed.

@azaroth42
Copy link
Contributor

Propose closing as duplicate of #85

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