-
Notifications
You must be signed in to change notification settings - Fork 8
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
Definition of yaml-ld namespace documents #77
Conversation
This adds some framing keywords to the previous version discussed in the Best Practice section, and uses a versioned URI based on the yaml-ld namespace. It also defines the namespace documents (html and jsonld). Once committed, will need @pchampin's aid in putting the files in place along with appropriate .htaccess for content negotiation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, modulo a typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not advise publishing a context which is specific to YAML. Moreover, this overloads the dollar sign, too...
See the rest of the document for further comments.
@@ -515,20 +515,99 @@ <h2>Basic Concepts</h2> | |||
</p> | |||
|
|||
<p class="ednote">FIXME.</p> | |||
|
|||
<section class="informative" id="convenience-context"> | |||
<h3>Convenience Context</h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ioggstream — It's unclear what you're saying you don't like. Please elaborate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since using a context to provide keyword alternates seemed to be a group consensus (I could be wrong, of course), this seems to be the natural consequence of that decision.
In #11, @anatoly-scherbakov laid out a plan for broad replacement of @-keywords
with $-keywords
, which would require deeper changes to document loading or core algorithms, and is still fraught with unexpected consequences. I outlined this solution in #11 (comment).
@juusoautiosalo suggested in #11 (comment) to chose a character other than $
, and if there is consensus over some specific character, we can of course update this PR to use that, instead.
Of course, the ongoing need to quote "@context"
is not solved by this solution, but seems to be a reasonable tradeoff for using an already standard mechanism for aliasing keywords.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a previous call we'd discussed a "convenience context" but my understanding was that we would simply be providing a context which removed the @
symbol...not "blessing" a new symbol with magic meaning... Also, given that JSON Schema uses the $
prefix heavily, attempting to us that runs us into a namespace collision with them (of sorts) and won't make us any friends.
I could support providing a simple context file that aliases things without the @
prefix (i.e. "base": "@base
), but developers will have to be aware (as ever) of what that means for the rest of their document/contents.
spec/index.html
Outdated
|
||
<p>The <a>convenience context</a> contains an alias to every JSON-LD keyword which the JSON-LD 1.1 | ||
specification permits aliasing — which means all the keywords except <code>@context</code>. The reserved `@` character is | ||
replaced by `$`, which is not reserved and therefore does not require quoting. Consider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another sign that this convenience context does not belong here: @context
with @
, other keywords with $
and then more words and caveats.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I argued elsewhere, a heavier-weight mechanism for alternative keywords can usher in unintended consequences; the keyword aliasing mechanism provided already by contexts is the right solution, IMHO.
If the group can't reach consensus, we can simply document the issue and leave it for a future working group to address and provide no alternative to @-keywords
.
'@context': | ||
- http://example.org/context.jsonld | ||
- https://www.w3.org/ns/yaml-ld/v1 | ||
$graph: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that if I'm offline I cannot even use a JSON-LD processor to understand that $graph
is a @graph
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is text elsewhere (4.5 Pre-loaded Contexts) that this should be built into the documentLoader
, so it is always available. It's a SHOULD, but perhaps should be a MUST.
Note that, this is the default documentLoader
, which can still be updated when invoking the API and it would be up to those implementations to continue to pre-load the context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be built into the documentLoader, so it is always available
This documentLoader is specific to YAML-LD or applies to JSON-LD too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the JSON- LD API, it is described here: https://www.w3.org/TR/json-ld11-api/#remote-document-and-context-retrieval. The option to set it is documentLoader
. It is the general way that documents are retrieved and interpreted.
@@ -661,6 +739,18 @@ <h2>Streams</h2> | |||
<p class="ednote"> | |||
This is inconsistent with the processing description in <a href="#convert-stream" class="sectionRef"></a>. | |||
</p> | |||
</section> | |||
|
|||
<section id="pre-loaded-contexts"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are those considerations specific to YAML? If not, I'd put there in another document. If yes, I think we are making things more complex than they should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is general advice in the JSON-LD Best Practices document about caching contexts, and this falls under that guidance. This spec more strongly suggests that this particular context be implemented in the document loader. We can't update the core JSON-LD API spec for this right now.
If placed in a separate document (also non-normative, at this point), we'd need to add language here that implementations MUST adhere to those requirements, and we can't go back in time to require that JSON-LD processors adhere to the same requirements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't update the core JSON-LD API spec for this right now.
Can't we schedule an update of that document (or just update the draft version, if any?)
This spec more strongly suggests that this particular context be implemented in the document loader
So we need this only to support the convenience context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issues surrounding accessing remote context continues to be a hot topic in JSON-LD (driven by schema.org) and should have a fair amount of discussion at TPAC, probably in the later portion of our F2F time.
More updates from @TallTed. Co-authored-by: Ted Thibodeau Jr <[email protected]>
The context is in the YAML-LD namespace, but of course, it could be used with any JSON-LD processor. Is there a more appropriate namespace to publish this? We did discuss
??? It does not overload the dollar sign, just defines terms that begin with the dollar sign. This seemed to be the group consensus, other than some use of non-ascii characters instead. If there's still controversy on using the
|
|
I just meant that I expected YAML-LD to be interchangeable with JSON-LD without the need of bearing specific knowledge around.
I am really sorry for appearing so assertive on this point, but I did not imagine the impacts of all this stuff were so wide as to affect implementations too. Thank you all for your patience, |
Re: #77 (comment) I should also note that |
and that's why, in my view, this "convenience context" is the right way to go. It simply relies on a standard JSON-LD mechanism. Start with the following YAML-LD: "@context": http://www.w3.org/ns/yaml-ld/v1
$id: http://champin.net/#pa
$type: http://schema.org/Person Convert it to JSON(-LD) {
"@context": "http://www.w3.org/ns/yaml-ld/v1",
"$id": "http://champin.net/#pa",
"$type": "http://schema.org/Person"
} which then expands to {
"@id": "http://champin.net/#pa",
"@type": "http://schema.org/Person"
} and converts to
As @gkellogg pointed out above, it could even be used in other JSON-LD documents where using |
Co-authored-by: Ted Thibodeau Jr <[email protected]>
On today's meeting we resolved to postpone this and include something similar in a Best Practices document.
There was further discussion about using a simpler bare-word Connivence Context, such as https://github.com/json-ld/convenience-context which we might host at https://json-ld.org/contexts/. |
… and updates to the spec to…refer and use it.
For #13, #55, and #75.
Preview | Diff