Skip to content

Commit 947204f

Browse files
committed
Add toRdf tests.
1 parent 5b2d8e9 commit 947204f

9 files changed

+81
-0
lines changed

tests/toRdf-manifest.jsonld

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,6 +1381,38 @@
13811381
"input": "toRdf/e118-in.jsonld",
13821382
"expect": "toRdf/e118-out.nq",
13831383
"option": {"specVersion": "json-ld-1.1"}
1384+
}, {
1385+
"@id": "#te119",
1386+
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
1387+
"name": "Ignore some terms with @, allow others.",
1388+
"purpose": "Processors SHOULD generate a warning and MUST ignore terms having the form of a keyword.",
1389+
"input": "toRdf/e119-in.jsonld",
1390+
"expect": "toRdf/e119-out.nq",
1391+
"option": {"specVersion": "json-ld-1.1"}
1392+
}, {
1393+
"@id": "#te120",
1394+
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
1395+
"name": "Ignore some values of @id with @, allow others.",
1396+
"purpose": "Processors SHOULD generate a warning and MUST ignore values of @id having the form of a keyword.",
1397+
"input": "toRdf/e120-in.jsonld",
1398+
"expect": "toRdf/e120-out.nq",
1399+
"option": {"specVersion": "json-ld-1.1"}
1400+
}, {
1401+
"@id": "#te121",
1402+
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
1403+
"name": "Ignore some values of @reverse with @, allow others.",
1404+
"purpose": "Processors SHOULD generate a warning and MUST ignore values of @reverse having the form of a keyword.",
1405+
"input": "toRdf/e121-in.jsonld",
1406+
"expect": "toRdf/e121-out.nq",
1407+
"option": {"specVersion": "json-ld-1.1"}
1408+
}, {
1409+
"@id": "#te122",
1410+
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
1411+
"name": "Ignore some IRIs when that start with @ when expanding.",
1412+
"purpose": "Processors SHOULD generate a warning and MUST ignore IRIs having the form of a keyword.",
1413+
"input": "toRdf/e122-in.jsonld",
1414+
"expect": "toRdf/e122-out.nq",
1415+
"option": {"specVersion": "json-ld-1.1"}
13841416
}, {
13851417
"@id": "#tin01",
13861418
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],

tests/toRdf/e119-in.jsonld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"@context": {
3+
"@": "http://example.org/vocab/at",
4+
"@foo.bar": "http://example.org/vocab/foo.bar",
5+
"@ignoreMe": "http://example.org/vocab/ignoreMe"
6+
},
7+
"@": "allowed",
8+
"@foo.bar": "allowed",
9+
"@ignoreMe": "ignored"
10+
}

tests/toRdf/e119-out.nq

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_:b0 <http://example.org/vocab/at> "allowed" .
2+
_:b0 <http://example.org/vocab/foo.bar> "allowed" .

tests/toRdf/e120-in.jsonld

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://example.orb/vocab/",
4+
"at": {"@id": "@"},
5+
"foo.bar": {"@id": "@foo.bar"},
6+
"ignoreMe": {"@id": "@ignoreMe"}
7+
},
8+
"at": "allowed",
9+
"foo.bar": "allowed",
10+
"ignoreMe": "resolves to @vocab"
11+
}

tests/toRdf/e120-out.nq

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_:b0 <http://example.orb/vocab/@> "allowed" .
2+
_:b0 <http://example.orb/vocab/@foo.bar> "allowed" .
3+
_:b0 <http://example.orb/vocab/ignoreMe> "resolves to @vocab" .

tests/toRdf/e121-in.jsonld

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"@context": {
3+
"@base": "http://example.org/",
4+
"@vocab": "http://example.org/vocab/",
5+
"at": {"@reverse": "@"},
6+
"foo.bar": {"@reverse": "@foo.bar"}
7+
},
8+
"@id": "foo",
9+
"at": {"@id": "allowed"},
10+
"foo.bar": {"@id": "allowed"}
11+
}

tests/toRdf/e121-out.nq

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<http://example.org/allowed> <http://example.org/vocab/@foo.bar> <http://example.org/foo> .
2+
<http://example.org/allowed> <http://example.org/vocab/@> <http://example.org/foo> .

tests/toRdf/e122-in.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"@context": {
3+
"@base": "http://example.org/"
4+
},
5+
"http://example.org/vocab/at": {"@id": "@"},
6+
"http://example.org/vocab/foo.bar": {"@id": "@foo.bar"},
7+
"http://example.org/vocab/ignoreme": {"@id": "@ignoreMe"}
8+
}

tests/toRdf/e122-out.nq

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
_:b0 <http://example.org/vocab/at> <http://example.org/@> .
2+
_:b0 <http://example.org/vocab/foo.bar> <http://example.org/@foo.bar> .

0 commit comments

Comments
 (0)