Skip to content

Update spec and add tests for limiting @type-scoped terms to their typed object. #89

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

Merged
merged 22 commits into from
May 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
73758e5
Add tests for limiting `@type`-scoped terms to their typed object.
dlongley May 8, 2019
2730a98
Add `@protected` tests for `@type`-scope limited terms.
dlongley May 8, 2019
625c682
Fix typos w/pr03 test.
dlongley May 8, 2019
64677cf
Remove empty test object.
gkellogg May 10, 2019
835bfdf
Add test for outer type being cleared when inner type is used in a ty…
gkellogg May 11, 2019
156b697
Update context processing, compaction and expansion algorithms to kee…
gkellogg May 12, 2019
366500a
Update index.html
gkellogg May 13, 2019
0cb6c49
Add more type-scoped tests.
davidlehn May 20, 2019
a6b1044
Fix indentation.
davidlehn May 20, 2019
cb2adca
Differentiate between subject references and nested nodes.
dlongley May 21, 2019
c8a8c27
Add more type-scoped compaction tests.
davidlehn May 21, 2019
b612bff
Differentiate between subject references and nested nodes.
dlongley May 21, 2019
249a8ce
Add type-scoped value tests.
davidlehn May 21, 2019
f182adb
Add type-scoped value mix test.
davidlehn May 21, 2019
ca2884c
Add type-scoped value mix compact test.
davidlehn May 21, 2019
a951c13
Add type/property-scoped type:vocab tests.
davidlehn May 21, 2019
014afd4
Add more type-scoped tests.
davidlehn May 21, 2019
28491e3
Add type-scoped graph container tests.
davidlehn May 22, 2019
555b12a
Update context processing and expansion algorithms for new type-scope…
gkellogg May 23, 2019
c0a1531
Update compaction algorithm.
gkellogg May 24, 2019
6efba59
Fix missing steps in IRI Compaction algorithm for graph objects.
gkellogg May 26, 2019
c8a7e0a
Remove additional `@set` to containers.
gkellogg May 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
304 changes: 184 additions & 120 deletions index.html

Large diffs are not rendered by default.

132 changes: 129 additions & 3 deletions tests/compact-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@
}, {
"@id": "#tc009",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "deep @context affects nested nodes",
"name": "deep @type-scoped @context does NOT affect nested nodes",
"purpose": "scoped context on @type",
"input": "compact/c009-in.jsonld",
"context": "compact/c009-context.jsonld",
Expand Down Expand Up @@ -1022,6 +1022,123 @@
"context": "compact/c012-context.jsonld",
"expect": "compact/c012-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#tc013",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "deep property-term scoped @context in @type-scoped @context affects nested nodes",
"purpose": "scoped context on @type",
"input": "compact/c013-in.jsonld",
"context": "compact/c013-context.jsonld",
"expect": "compact/c013-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#tc014",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "type-scoped context nullification",
"purpose": "type-scoped context nullification",
"input": "compact/c014-in.jsonld",
"context": "compact/c014-context.jsonld",
"expect": "compact/c014-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#tc015",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "type-scoped base",
"purpose": "type-scoped base",
"input": "compact/c015-in.jsonld",
"context": "compact/c015-context.jsonld",
"expect": "compact/c015-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#tc016",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "type-scoped vocab",
"purpose": "type-scoped vocab",
"input": "compact/c016-in.jsonld",
"context": "compact/c016-context.jsonld",
"expect": "compact/c016-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#tc017",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "multiple type-scoped contexts are properly reverted",
"purpose": "multiple type-scoped contexts are property reverted",
"input": "compact/c017-in.jsonld",
"context": "compact/c017-context.jsonld",
"expect": "compact/c017-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#tc018",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "multiple type-scoped types resolved against previous context",
"purpose": "multiple type-scoped types resolved against previous context",
"input": "compact/c018-in.jsonld",
"context": "compact/c018-context.jsonld",
"expect": "compact/c018-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#tc019",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "type-scoped context with multiple property scoped terms",
"purpose": "type-scoped context with multiple property scoped terms",
"input": "compact/c019-in.jsonld",
"context": "compact/c019-context.jsonld",
"expect": "compact/c019-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#tc020",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "type-scoped value",
"purpose": "type-scoped value",
"input": "compact/c020-in.jsonld",
"context": "compact/c020-context.jsonld",
"expect": "compact/c020-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#tc021",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "type-scoped value mix",
"purpose": "type-scoped value mix",
"input": "compact/c021-in.jsonld",
"context": "compact/c021-context.jsonld",
"expect": "compact/c021-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#tc022",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "type-scoped property-scoped contexts including @type:@vocab",
"purpose": "type-scoped property-scoped contexts including @type:@vocab",
"input": "compact/c022-in.jsonld",
"context": "compact/c022-context.jsonld",
"expect": "compact/c022-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#tc023",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "composed type-scoped property-scoped contexts including @type:@vocab",
"purpose": "composed type-scoped property-scoped contexts including @type:@vocab",
"input": "compact/c023-in.jsonld",
"context": "compact/c023-context.jsonld",
"expect": "compact/c023-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#tc024",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "type-scoped + property-scoped + values evaluates against previous context",
"purpose": "type-scoped + property-scoped + values evaluates against previous context",
"input": "compact/c024-in.jsonld",
"context": "compact/c024-context.jsonld",
"expect": "compact/c024-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#tc025",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "type-scoped + graph container",
"purpose": "type-scoped + graph container",
"input": "compact/c025-in.jsonld",
"context": "compact/c025-context.jsonld",
"expect": "compact/c025-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#te001",
"@type": [ "jld:NegativeEvaluationTest", "jld:CompactTest" ],
Expand Down Expand Up @@ -1676,8 +1793,8 @@
"name": "Check illegal overriding of protected term from type-scoped context",
"purpose": "Check error when overriding a protected term from type-scoped context.",
"option": {"specVersion": "json-ld-1.1"},
"input": "compact/pr02-in.jsonld",
"context": "compact/pr02-context.jsonld",
"input": "compact/pr03-in.jsonld",
"context": "compact/pr03-context.jsonld",
"expect": "protected term redefinition"
}, {
"@id": "#tpr04",
Expand All @@ -1688,6 +1805,15 @@
"input": "compact/pr04-in.jsonld",
"context": "compact/pr04-context.jsonld",
"expect": "compact/pr04-out.jsonld"
}, {
"@id": "#tpr05",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "Check legal overriding of type-scoped protected term from nested node",
"purpose": "Check legal overriding of type-scoped protected term from nested node.",
"option": {"specVersion": "json-ld-1.1"},
"input": "compact/pr05-in.jsonld",
"context": "compact/pr05-context.jsonld",
"expect": "compact/pr05-out.jsonld"
}, {
"@id": "#tr001",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
Expand Down
4 changes: 2 additions & 2 deletions tests/compact/c009-out.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"Foo": {"@context": {"baz": {"@type": "@vocab"}}}
},
"@type": "Foo",
"bar": {"baz": "buzz"}
}
"bar": {"baz": {"@id": "http://example/buzz"}}
}
14 changes: 14 additions & 0 deletions tests/compact/c013-context.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"@context": {
"@vocab": "http://example/",
"Foo": {
"@context": {
"bar": {
"@context": {
"baz": {"@type": "@vocab"}
}
}
}
}
}
}
8 changes: 8 additions & 0 deletions tests/compact/c013-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{
"@type": ["http://example/Foo"],
"http://example/bar": [{
"http://example/baz": [{"@id": "http://example/buzz"}]
}]
}
]
16 changes: 16 additions & 0 deletions tests/compact/c013-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"@context": {
"@vocab": "http://example/",
"Foo": {
"@context": {
"bar": {
"@context": {
"baz": {"@type": "@vocab"}
}
}
}
}
},
"@type": "Foo",
"bar": {"baz": "buzz"}
}
11 changes: 11 additions & 0 deletions tests/compact/c014-context.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"@context": {
"@vocab": "http://example/",
"foo": "http://example/foo",
"Type": {
"@context": [
null
]
}
}
}
8 changes: 8 additions & 0 deletions tests/compact/c014-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[{
"http://example/foo": [{
"@value": "will-exist"
}],
"http://example/p": [{
"@type": ["http://example/Type"]
}]
}]
15 changes: 15 additions & 0 deletions tests/compact/c014-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": {
"@vocab": "http://example/",
"foo": "http://example/foo",
"Type": {
"@context": [
null
]
}
},
"foo": "will-exist",
"p": {
"@type": "Type"
}
}
12 changes: 12 additions & 0 deletions tests/compact/c015-context.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"@context": {
"@base": "http://example/base-base",
"@vocab": "http://example/",
"foo": "http://example/foo",
"Type": {
"@context": {
"@base": "http://example/typed-base"
}
}
}
}
16 changes: 16 additions & 0 deletions tests/compact/c015-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[{
"@id": "http://example/base-base#base-id",
"http://example/p": [{
"@id": "http://example/typed-base#typed-id",
"@type": ["http://example/Type"],
"http://example/subjectReference": [{
"@id": "http://example/typed-base#subject-reference-id"
}],
"http://example/nestedNode": [{
"@id": "http://example/base-base#nested-id",
"http://example/foo": [{
"@value": "bar"
}]
}]
}]
}]
24 changes: 24 additions & 0 deletions tests/compact/c015-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"@context": {
"@base": "http://example/base-base",
"@vocab": "http://example/",
"foo": "http://example/foo",
"Type": {
"@context": {
"@base": "http://example/typed-base"
}
}
},
"@id": "#base-id",
"p": {
"@id": "#typed-id",
"@type": "Type",
"subjectReference": {
"@id": "#subject-reference-id"
},
"nestedNode": {
"@id": "#nested-id",
"foo": "bar"
}
}
}
10 changes: 10 additions & 0 deletions tests/compact/c016-context.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"@context": {
"@vocab": "http://example.org/",
"Type": {
"@context": {
"@vocab": "http://example.com/"
}
}
}
}
16 changes: 16 additions & 0 deletions tests/compact/c016-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[{
"http://example.org/foo": [{
"@value": "org"
}],
"http://example.org/p": [{
"@type": ["http://example.org/Type"],
"http://example.com/foo": [{
"@value": "com"
}],
"http://example.com/nested": [{
"http://example.org/nested-prop": [{
"@value": "org"
}]
}]
}]
}]
18 changes: 18 additions & 0 deletions tests/compact/c016-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"@context": {
"@vocab": "http://example.org/",
"Type": {
"@context": {
"@vocab": "http://example.com/"
}
}
},
"foo": "org",
"p": {
"@type": "Type",
"foo": "com",
"nested": {
"nested-prop": "org"
}
}
}
19 changes: 19 additions & 0 deletions tests/compact/c017-context.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"@context": {
"@vocab": "http://example/",
"Bar": {
"@context": [
{
"prop": "http://example/bar-prop"
}
]
},
"Foo": {
"@context": [
{
"prop": "http://example/foo-prop"
}
]
}
}
}
14 changes: 14 additions & 0 deletions tests/compact/c017-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[{
"@type": [
"http://example/Foo",
"http://example/Bar"
],
"http://example/foo-prop": [{
"@value": "foo"
}],
"http://example/nested": [{
"http://example/prop": [{
"@value": "vocab"
}]
}]
}]
Loading