Skip to content

Commit

Permalink
Add graph container array tests.
Browse files Browse the repository at this point in the history
- Add tests for `@graph` `@container` with and without nullified context
  with an array of plain literals.
- Add tests for `@graph` `@id` `@container` with and without nullified
  context with an array of IRIs.
  • Loading branch information
davidlehn committed Dec 13, 2023
1 parent f18efc9 commit cb225ff
Show file tree
Hide file tree
Showing 18 changed files with 176 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/expand-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,38 @@
"input": "expand/0131-in.jsonld",
"expect": "expand/0131-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#t0200",
"@type": [ "jld:PositiveEvaluationTest", "jld:ExpandTest" ],
"name": "Expand @graph @container with plain literals",
"purpose": "Expanding a @graph @container containing plain literals.",
"input": "expand/0200-in.jsonld",
"expect": "expand/0200-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#t0201",
"@type": [ "jld:PositiveEvaluationTest", "jld:ExpandTest" ],
"name": "Expand @type:@id @graph @container with IRIs",
"purpose": "Expanding a @type:@id @graph @container containing IRIs.",
"input": "expand/0201-in.jsonld",
"expect": "expand/0201-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#t0202",
"@type": [ "jld:PositiveEvaluationTest", "jld:ExpandTest" ],
"name": "Expand @graph @container with nullified @context with plain literals",
"purpose": "Expanding a @graph @container with nullified @context containing plain literals.",
"input": "expand/0202-in.jsonld",
"expect": "expand/0202-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#t0203",
"@type": [ "jld:PositiveEvaluationTest", "jld:ExpandTest" ],
"name": "Expand @type:@id @graph @container with nullified @context with IRIs",
"purpose": "Expanding a @type:@id @graph @container with nullified @context containing IRIs.",
"input": "expand/0203-in.jsonld",
"expect": "expand/0203-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tc001",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
Expand Down
13 changes: 13 additions & 0 deletions tests/expand/0200-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"@context": {
"p": {
"@id": "ex:p",
"@container": "@graph"
}
},
"@id": "ex:outer",
"p": [
"test1",
"test2"
]
}
1 change: 1 addition & 0 deletions tests/expand/0200-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
14 changes: 14 additions & 0 deletions tests/expand/0201-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"@context": {
"p": {
"@id": "ex:p",
"@type": "@id",
"@container": "@graph"
}
},
"@id": "ex:outer",
"p": [
"ex:test1",
"ex:test2"
]
}
1 change: 1 addition & 0 deletions tests/expand/0201-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
14 changes: 14 additions & 0 deletions tests/expand/0202-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"@context": {
"p": {
"@id": "ex:p",
"@container": "@graph",
"@context": null
}
},
"@id": "ex:outer",
"p": [
"test1",
"test2"
]
}
1 change: 1 addition & 0 deletions tests/expand/0202-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
15 changes: 15 additions & 0 deletions tests/expand/0203-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": {
"p": {
"@id": "ex:p",
"@type": "@id",
"@container": "@graph",
"@context": null
}
},
"@id": "ex:outer",
"p": [
"ex:test1",
"ex:test2"
]
}
1 change: 1 addition & 0 deletions tests/expand/0203-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
28 changes: 28 additions & 0 deletions tests/toRdf-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,34 @@
"purpose": "Expanding a reverse term using @container: @index and @index set to a property (from expand#t0131)",
"input": "toRdf/0133-in.jsonld",
"expect": "toRdf/0133-out.nq"
}, {
"@id": "#t0200",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
"name": "Expand @graph @container with plain literals",
"purpose": "Expanding a @graph @container containing plain literals.",
"input": "toRdf/0200-in.jsonld",
"expect": "toRdf/0200-out.nq"
}, {
"@id": "#t0201",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
"name": "Expand @type:@id @graph @container with IRIs",
"purpose": "Expanding a @type:@id @graph @container containing IRIs.",
"input": "toRdf/0201-in.jsonld",
"expect": "toRdf/0201-out.nq"
}, {
"@id": "#t0202",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
"name": "Expand @graph @container with nullified @context with plain literals",
"purpose": "Expanding a @graph @container with nullified @context containing plain literals.",
"input": "toRdf/0202-in.jsonld",
"expect": "toRdf/0202-out.nq"
}, {
"@id": "#t0203",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
"name": "Expand @type:@id @graph @container with nullified @context with IRIs",
"purpose": "Expanding a @type:@id @graph @container with nullified @context containing IRIs.",
"input": "toRdf/0203-in.jsonld",
"expect": "toRdf/0203-out.nq"
}, {
"@id": "#tc001",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
Expand Down
13 changes: 13 additions & 0 deletions tests/toRdf/0200-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"@context": {
"p": {
"@id": "ex:p",
"@container": "@graph"
}
},
"@id": "ex:outer",
"p": [
"ex:test1",
"ex:test2"
]
}
Empty file added tests/toRdf/0200-out.nq
Empty file.
14 changes: 14 additions & 0 deletions tests/toRdf/0201-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"@context": {
"p": {
"@id": "ex:p",
"@type": "@id",
"@container": "@graph"
}
},
"@id": "ex:outer",
"p": [
"ex:test1",
"ex:test2"
]
}
Empty file added tests/toRdf/0201-out.nq
Empty file.
14 changes: 14 additions & 0 deletions tests/toRdf/0202-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"@context": {
"p": {
"@id": "ex:p",
"@container": "@graph",
"@context": null
}
},
"@id": "ex:outer",
"p": [
"ex:test1",
"ex:test2"
]
}
Empty file added tests/toRdf/0202-out.nq
Empty file.
15 changes: 15 additions & 0 deletions tests/toRdf/0203-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@context": {
"p": {
"@id": "ex:p",
"@type": "@id",
"@container": "@graph",
"@context": null
}
},
"@id": "ex:outer",
"p": [
"ex:test1",
"ex:test2"
]
}
Empty file added tests/toRdf/0203-out.nq
Empty file.

0 comments on commit cb225ff

Please sign in to comment.