Skip to content

Commit 5cb6ba2

Browse files
committed
Only invoke language and annotation map expansion if the value is a JSON object
See Gregg's changes in 8c546b9. This addresses #133 and #196.
1 parent 642354e commit 5cb6ba2

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"@context": {
3+
"vocab": "http://example.com/vocab/",
4+
"label": {
5+
"@id": "vocab:label",
6+
"@container": "@language"
7+
},
8+
"annotations": {
9+
"@id": "vocab:annotation",
10+
"@container": "@annotation"
11+
}
12+
},
13+
"@id": "http://example.com/queen",
14+
"label": [
15+
"The Queen"
16+
],
17+
"annotations":
18+
[
19+
"No",
20+
"annotations",
21+
{ "@id": "asTheValueIsntAnObject" }
22+
]
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"@id": "http://example.com/queen",
4+
"http://example.com/vocab/label":
5+
[
6+
{
7+
"@value": "The Queen"
8+
}
9+
],
10+
"http://example.com/vocab/annotation":
11+
[
12+
{
13+
"@value": "No"
14+
},
15+
{
16+
"@value": "annotations"
17+
},
18+
{
19+
"@id": "http://json-ld.org/test-suite/tests/asTheValueIsntAnObject"
20+
}
21+
]
22+
}
23+
]

test-suite/tests/expand-manifest.jsonld

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@
201201
"name": "Complex property generator test case with multiple colliding IRIs (this document wouldn't roundtrip cleanly)",
202202
"input": "expand-0039-in.jsonld",
203203
"expect": "expand-0039-out.jsonld"
204+
}, {
205+
"@type": ["test:TestCase", "jld:ExpandTest"],
206+
"name": "Only invoke language and annotation map expansion if the value is a JSON object",
207+
"input": "expand-0040-in.jsonld",
208+
"expect": "expand-0040-out.jsonld"
204209
}
205210
]
206211
}

0 commit comments

Comments
 (0)