Conversation
|
Assuming my reading is correct, should the various frame expansion keywords be added to this test as well? |
anatoly-scherbakov
left a comment
There was a problem hiding this comment.
If I understand the point correctly then the keywords in the test should be ignored specifically for the reason that they aren't keywords in the document-root context.
Here's a classification of these.
| Keyword | Classification | Valid JSON-LD 1.1 use |
|---|---|---|
@base |
Context keyword | Context definition |
@container |
Term-definition keyword | Expanded term definition |
@import |
Context keyword | Context definition |
@json |
Type keyword | Value of @type |
@none |
Map index sentinel | Index, id, language, or type map |
@prefix |
Term-definition keyword | Expanded term definition |
@propagate |
Context keyword | Context definition |
@version |
Context keyword | Context definition |
@vocab |
Context/type keyword | Context definition or term-definition @type |
@any |
Algorithm sentinel | Inverse-context processing |
@null |
Algorithm sentinel | Inverse-context processing |
@preserve |
Framing-processing keyword | Framing/compaction processing |
Could you please also regenerate and commit tests/expand-manifest.html:
cd tests
bundle exec rake expand-manifest.htmlThis is the generated-file rule in tests/Rakefile.
Non-blocking: adding @protected would complete the coverage of context/term-definition-only keywords.
|
anatoly-scherbakov marked as non substantive for IPR from ash-nazg. |
In step 13.4 of the expansion algorithm, https://www.w3.org/TR/json-ld11-api/#algorithm-5, a number of keywords are listed as needing specific handling. Any keywords that do not match in 13.4 should be dropped in 13.4.17.
df7bd67 to
5088e31
Compare
|
@anatoly-scherbakov all done I think. I added |
|
Sorry, I confugred propagate and protected there. Propagate was already there, I added protected as suggested. Something I did just notice, |
Step 13.4 of the expansion algorithm handles the case where a key, after IRI expansion, matches a JSON-LD keyword. It enumerates a number of keywords that are specifically handled, and ends with 13.4.17:
From my understanding of it, that should mean that any key which expanded into a keyword we did not just explicitly handle is not added to the expanded document, and therefor its value is never expanded either so can't be present in the expanded document. In effect, we're dropping that key.
One interesting tidbit, this fails in the JSON-LD playground. I think my reading of the spec is correct, so I believe this is an oversight in
jsonld.js. But I'm not entirely sure. The expanded result on the playground is:[ { "@base": [ "base" ], "@container": [ "@language" ], "@json": [ {} ], "@none": [ "none" ], "@prefix": [ "prefix" ], "@preserve": [ "preserve" ], "@version": [ "1.1" ], "@vocab": [ "hello" ] } ]