-
Notifications
You must be signed in to change notification settings - Fork 35
Algorithm updates and tests to allow @container: @set
on @type
#41
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"@context": { | ||
"@type": {"@container": "@set"} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"@type": "http://example.org/type" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"@context": { | ||
"@type": {"@container": "@set"} | ||
}, | ||
"@type": ["http://example.org/type"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"@context": { | ||
"type": {"@id": "@type", "@container": "@set"} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"@type": "http://example.org/type" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"@context": { | ||
"type": {"@id": "@type", "@container": "@set"} | ||
}, | ||
"type": ["http://example.org/type"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"@context": { | ||
"type": {"@id": "@type", "@container": "@set"} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"@type": "http://example.org/type" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"@context": { | ||
"type": {"@id": "@type", "@container": "@set"} | ||
}, | ||
"type": "http://example.org/type" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1180,6 +1180,13 @@ | |
"purpose": "Verifies that an exception is raised in Expansion when an invalid set or list object is found", | ||
"input": "expand/e041-in.jsonld", | ||
"expect": "invalid set or list object" | ||
}, { | ||
"@id": "#te042", | ||
"@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ], | ||
"name": "Keywords may not be redefined", | ||
"purpose": "Verifies that an exception is raised on expansion when processing an invalid context attempting to define @container on a keyword", | ||
"input": "expand/e042-in.jsonld", | ||
"expect": "keyword redefinition" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to be in 1.0 mode? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a test to be sure that a 1.0 processor would fail if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If {
"@context": {
"@type": {"@container": "@set"}
},
"@type": "http://example.org/type"
} which a 1.0 processor should fail on. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I was forgetting it defaulted to 1.0. |
||
}, { | ||
"@id": "#tec01", | ||
"@type": [ "jld:NegativeEvaluationTest", "jld:ExpandTest" ], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"@context": { | ||
"@type": {"@container": "@set"} | ||
}, | ||
"@type": "http://example.org/type" | ||
} |
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.
Won't this test be a negative test in 1.0 mode?
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 think the tests are reasonable to check both 1.0 and 1.1 modes. The negative test is in expansion, to make sure a 1.0 processor fails. A 1.0 processor compacting with an alias of
@type
will allow a@container
definition but ignore it when actually compacting.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.
Ah, I thought it failed in 1.0.
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 actually never checked that keyword aliases should only be for simple term definitions; we just ignore everything else. We could consider tightening these up in 1.1, and require that keyword aliases only be simple term definitions.