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 nullified context with an
  array of plain literals.
- Add tests for `@graph` `@id` `@container` with nullified context with
  an array of IRIs.
  • Loading branch information
davidlehn committed Dec 13, 2023
1 parent f18efc9 commit 7bd4798
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/expand-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,22 @@
"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 nullified @context 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 @graph @id @container with nullified @context with IRIs",
"purpose": "Expanding a @graph @id @container containing IRIs.",
"input": "expand/0201-in.jsonld",
"expect": "expand/0201-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tc001",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
Expand Down
14 changes: 14 additions & 0 deletions tests/expand/0200-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/0200-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
15 changes: 15 additions & 0 deletions tests/expand/0201-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/0201-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
14 changes: 14 additions & 0 deletions tests/toRdf-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,20 @@
"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 nullified @context 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 @graph @id @container with nullified @context with IRIs",
"purpose": "Expanding a @graph @id @container containing IRIs.",
"input": "toRdf/0201-in.jsonld",
"expect": "toRdf/0201-out.nq"
}, {
"@id": "#tc001",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
Expand Down
14 changes: 14 additions & 0 deletions tests/toRdf/0200-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/0200-out.nq
Empty file.
15 changes: 15 additions & 0 deletions tests/toRdf/0201-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/0201-out.nq
Empty file.

0 comments on commit 7bd4798

Please sign in to comment.