Skip to content

Commit 2e10884

Browse files
authored
Merge pull request #611 from w3c/compact-container-type-with-iri
Add compaction to @type map when the compacted item is not already a map.
2 parents 6dedb77 + 4b66ee3 commit 2e10884

File tree

5 files changed

+72
-0
lines changed

5 files changed

+72
-0
lines changed

tests/compact-manifest.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6206,6 +6206,38 @@ <h2>
62066206
</dd>
62076207
</dl>
62086208
</dd>
6209+
<dt id='tm023'>
6210+
Test tm023 compact IRI with container: @type
6211+
</dt>
6212+
<dd>
6213+
<dl class='entry'>
6214+
<dt>id</dt>
6215+
<dd>#tm023</dd>
6216+
<dt>Type</dt>
6217+
<dd>jld:PositiveEvaluationTest, jld:CompactTest</dd>
6218+
<dt>Purpose</dt>
6219+
<dd>Uses @none when compacted item is an IRI string</dd>
6220+
<dt>input</dt>
6221+
<dd>
6222+
<a href='compact/m023-in.jsonld'>compact/m023-in.jsonld</a>
6223+
</dd>
6224+
<dt>context</dt>
6225+
<dd>
6226+
<a href='compact/m023-context.jsonld'>compact/m023-context.jsonld</a>
6227+
</dd>
6228+
<dt>expect</dt>
6229+
<dd>
6230+
<a href='compact/m023-out.jsonld'>compact/m023-out.jsonld</a>
6231+
</dd>
6232+
<dt>Options</dt>
6233+
<dd>
6234+
<dl class='options'>
6235+
<dt>specVersion</dt>
6236+
<dd>json-ld-1.1</dd>
6237+
</dl>
6238+
</dd>
6239+
</dl>
6240+
</dd>
62096241
<dt id='tn001'>
62106242
Test tn001 Indexes to @nest for property with @nest
62116243
</dt>

tests/compact-manifest.jsonld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,15 @@
18001800
"context": "compact/m022-context.jsonld",
18011801
"expect": "compact/m022-out.jsonld",
18021802
"option": {"specVersion": "json-ld-1.1"}
1803+
}, {
1804+
"@id": "#tm023",
1805+
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
1806+
"name": "compact IRI with container: @type",
1807+
"purpose": "Uses @none when compacted item is an IRI string",
1808+
"input": "compact/m023-in.jsonld",
1809+
"context": "compact/m023-context.jsonld",
1810+
"expect": "compact/m023-out.jsonld",
1811+
"option": {"specVersion": "json-ld-1.1"}
18031812
}, {
18041813
"@id": "#tn001",
18051814
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],

tests/compact/m023-context.jsonld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://schema.org/",
4+
"location": {
5+
"@type": "@id",
6+
"@container": "@type"
7+
}
8+
}
9+
}

tests/compact/m023-in.jsonld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://schema.org/"
4+
},
5+
"@type": "Event",
6+
"location": {
7+
"@id": "http://kg.artsdata.ca/resource/K11-200"
8+
}
9+
}

tests/compact/m023-out.jsonld

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"@context": {
3+
"@vocab": "http://schema.org/",
4+
"location": {
5+
"@type": "@id",
6+
"@container": "@type"
7+
}
8+
},
9+
"@type": "Event",
10+
"location": {
11+
"@none": "http://kg.artsdata.ca/resource/K11-200"
12+
}
13+
}

0 commit comments

Comments
 (0)