Skip to content

Commit 2e2768c

Browse files
committed
Change c028 compaction test to simpler version suggested by @davidlehn, and add c036 expansion test.
1 parent d3ba6ad commit 2e2768c

File tree

9 files changed

+65
-21
lines changed

9 files changed

+65
-21
lines changed

tests/compact/c028-context.jsonld

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
{
22
"@context": {
3-
"td": "https://www.w3.org/2019/wot/td#",
4-
"dct": "http://purl.org/dc/terms/",
5-
"properties": {
6-
"@id": "td:hasPropertyAffordance",
7-
"@type": "@id",
8-
"@container": "@index",
3+
"thing": {
4+
"@id": "ex:thing",
95
"@context": {}
106
},
11-
"title": "dct:title"
7+
"title": "ex:title"
128
}
139
}

tests/compact/c028-in.jsonld

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"https://www.w3.org/2019/wot/td#hasPropertyAffordance": [{
3-
"http://purl.org/dc/terms/title": "Switch"
4-
}],
5-
"http://purl.org/dc/terms/title": "46203"
2+
"ex:title": "top",
3+
"ex:thing": {
4+
"ex:title": "sub"
5+
}
66
}

tests/compact/c028-out.jsonld

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
{
22
"@context": {
3-
"td": "https://www.w3.org/2019/wot/td#",
4-
"dct": "http://purl.org/dc/terms/",
5-
"properties": {
6-
"@id": "td:hasPropertyAffordance",
7-
"@type": "@id",
8-
"@container": "@index",
3+
"thing": {
4+
"@id": "ex:thing",
95
"@context": {}
106
},
11-
"title": "dct:title"
7+
"title": "ex:title"
128
},
13-
"title": "46203",
14-
"properties": {
15-
"@none": {"title": "Switch"}
9+
"title": "top",
10+
"thing": {
11+
"title": "sub"
1612
}
1713
}

tests/expand-manifest.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,6 +1258,14 @@
12581258
"input": "expand/c035-in.jsonld",
12591259
"expect": "expand/c035-out.jsonld",
12601260
"option": {"specVersion": "json-ld-1.1"}
1261+
}, {
1262+
"@id": "#tc036",
1263+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
1264+
"name": "Expansion with empty property-scoped context.",
1265+
"purpose": "Adding a minimal/empty property-scoped context should not affect expansion of terms defined in the outer scope.",
1266+
"input": "expand/c036-in.jsonld",
1267+
"expect": "expand/c036-out.jsonld",
1268+
"option": {"specVersion": "json-ld-1.1"}
12611269
}, {
12621270
"@id": "#tdi01",
12631271
"@type": [ "jld:PositiveEvaluationTest", "jld:ExpandTest" ],

tests/expand/c036-in.jsonld

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"@context": {
3+
"thing": {
4+
"@id": "ex:thing",
5+
"@context": {}
6+
},
7+
"title": "ex:title"
8+
},
9+
"title": "top",
10+
"thing": {
11+
"title": "sub"
12+
}
13+
}

tests/expand/c036-out.jsonld

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[{
2+
"ex:title": [{"@value": "top"}
3+
],
4+
"ex:thing": [{
5+
"ex:title": [{"@value": "sub"}]
6+
}]
7+
}]

tests/toRdf-manifest.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,14 @@
676676
"input": "toRdf/c035-in.jsonld",
677677
"expect": "toRdf/c035-out.nq",
678678
"option": {"specVersion": "json-ld-1.1"}
679+
}, {
680+
"@id": "#tc036",
681+
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
682+
"name": "Expansion with empty property-scoped context.",
683+
"purpose": "Adding a minimal/empty property-scoped context should not affect expansion of terms defined in the outer scope.",
684+
"input": "toRdf/c036-in.jsonld",
685+
"expect": "toRdf/c036-out.nq",
686+
"option": {"specVersion": "json-ld-1.1"}
679687
}, {
680688
"@id": "#tdi01",
681689
"@type": [ "jld:PositiveEvaluationTest", "jld:ToRDFTest" ],

tests/toRdf/c036-in.jsonld

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"@context": {
3+
"thing": {
4+
"@id": "ex:thing",
5+
"@context": {}
6+
},
7+
"title": "ex:title"
8+
},
9+
"title": "top",
10+
"thing": {
11+
"title": "sub"
12+
}
13+
}

tests/toRdf/c036-out.nq

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
_:b0 <ex:thing> _:b1 .
2+
_:b0 <ex:title> "top" .
3+
_:b1 <ex:title> "sub" .

0 commit comments

Comments
 (0)