-
Notifications
You must be signed in to change notification settings - Fork 158
Add tests, algoritm, grammar, and description for @vocab: @base
.
#603
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
Conversation
Oops, merged other branch that also had compact 0090 test. |
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 was looking into the JSON-LD 1.1 syntax document, and I did not find any statement that makes it absolutely clear that the default value of @base
is the base URI. The text only says:
In section 1.7:
@base
: Used to set the base IRI against which to resolve those relative IRIs interpreted relative to the document. This keyword is described in section 4.2 Base IRI.
In section 4.2:
JSON-LD allows IRIs to be specified in a relative form which is resolved against the document base according section 5.1 Establishing a Base URI of [RFC3986]. The base IRI may be explicitly set with a context using the
@base
keyword.
I also looked at the API document, and I did not find any reference to some sort of a default @base
value.
This means that the
"@vocab" : @base
is not clearly defined in the absence of an explicit @base
setting. And, actually, it is exactly that situation that is needed (if my understanding is correct) to cover Ted's use case.
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 disagree with Ivan's review. 4.2 says:
So while it's non-normative, much of the specification is non-normative and would require a massive rewrite to change. |
@azaroth42, you are right that that section is informative. However, can someone show me how can I deduce, normatively, that if I have
and Actually... I believe that what has to be done is to expand on 3.6.3 of the algorithm in section 4.1.2 of the api document. That sub-sub section should say that if As it stands, unless I miss a statement elsewhere, I maintain that the spec is underspecified... (As an aside, the reference to (That being said: the algorithm is already very complicated. I am not 100% sure any more that we have to go down that route... but that is another discussion.) |
Granted, though I'm pretty sure we would run into many similar situations throughout the specification. This could be raised as a separate issue? |
Granted, though I'm pretty sure we would run into many similar situations throughout the specification.
I cannot judge that, I have not gone through the specification with such a detail. If that is indeed the case, then this is a cleanup we must do during the WG phase. Test cases should also reveal such corner cases.
This could be raised as a separate issue?
I let the others decide on this...
|
Most of the Syntax document is non-normative, by design; the normative parts are in the appendix describing the grammar. The informative text on the document base is in section 4.2 Base IRI. The grammar makes it clear that Behavior is described in the API document where base IRI is defined. Note that, if we simply referenced it from the syntax document, it would appear there as well. We could potentially improve this definition as follows:
Normatively, the WebIDL interface describes how the initial value of the base IRI is set. In the Context Processing Algorithm, the use of |
fixed a couple of typos
I am repeating myself: that section does not say anything about what happens if the (The grammar is now in section 6, not in the Appendix...) I did not question whether
Indeed, it says in the IDL:
But this has several problems:
So, I am sorry but I still maintain that the spec is underspecified for the case I do not want to make life difficult. We can decide not to go into all these details for the CG draft, but I believe that this must be taken care of in the final spec. Is there already a test case for this corner case? B.t.w., whatever is done I think that the corner case of @pchampin and @kidehen should be documented explicitly. One of the very important aspect of JSON-LD is that one can use terms in the file that, when undefined in |
Update index.html
@iherman not trying to be difficult, but I don't quite appreciate the problem. Section 4.3.1 says:
We could possibly expand on this with:
In the 4.2 Base IRI, the document base is defined:
So, when we say It would be incorrect to say that
Earlier in the WebIDL section it says the following:
The documents try to consistently use base IRI, rather than
The example in 4.3.1 is pretty close to @kidehen's use case, but I'm happy to elaborate more if it is not specific enough, which is why I asked for specific feedback on the PR from them. |
I am not sure it is necessary to add this, but does not harm.
To be very precise this statement does not come from this quote. I guess what counts is the Terminology section which says
O.k., I am fine with this argument.
O.k. I indeed missed the section on the document loader, which sets a default value to base URI. So the full line of argument is indeed correct, using the extra reference to the terminology. However, there is a major issue with this, nevertheless: except for the Terminology section none of the sections you refer to are normative! From a specification point of view this means that this line of argument is not really decisive:-( I do understand the intention of separating the user facing part of the document from the normative spec. Knowing the unreadability of many other specs these days, I am all in favor, in fact. But, nevertheless, we should be able to trace back the answer to the original question "what happens if there is no Having looked at that part, but not really familiar with all the details, I believe that point 3.6.3. of section 4.1.3 has to be expanded. Actually, it would make it more readable by separating that into a separate 3.6.4, something like:
although the normative sections do not say that that baseIRI is set, by default, to the document URI (the reference you gave is not normative). That should be clear in this section (or, alternatively, the WebIDL sections should be normative, which may actually be the best way forward) (I will write a separate comment on the narrative aspect, just to separate the comments...) |
@gkellogg, it took us several comments to track down the right answer to the question "what happens if there is no I tried to see what could be added to section 4.3.1., namely a new example should be added after example 22. Something like:
resulting in
where |
Looking at the issue again in general: we should be very careful to introduce new features based on use cases only. JSON-LD is already complex, and the feedbacks I hear time-to-time is that it is already too complex. My understanding of the use case of @kidehen and @pchampin is that they need a way to set |
As I mentioned in #488 (comment):
That is: using |
@niklasl wrote:
That actually might be a superior implementation that would relieve the cognitive overhead of using |
@niklasl <https://github.com/niklasl> wrote:
That is: using ***@***.***": "" could be allowed, and the "" (and more usable values such as "#" or "./") would be resolved against the base IRI (i.e. the document or it's explicit @base).
That actually might be a superior implementation that would relieve the cognitive overhead of using @base.
Yes! I like that, and it is, cognitively, much easier.
|
# Conflicts: # test-suite/tests/compact-manifest.jsonld
@iherman I believe the text now satisfies your requirements:
|
|
Part of the automated sanity testing is that no two examples have the same title, but the title of the second should be changed to 'Using "" as the vocabulary mapping (expanded)'
Kingsley had a question about this; rather than bloat with further examples, perhaps I'll just change this one to eliminate
Your understanding is correct, and this is an oversight.
No, I missed an extra |
@gkellogg with the changes in the last comment, I am fine merging! |
See json-ld/json-ld.org#603 for discussion.
Fixes #488.
cc/ @pchampin @kidehen