Skip to content

Commit

Permalink
Merge pull request #611 from w3c/compact-container-type-with-iri
Browse files Browse the repository at this point in the history
Add compaction to @type map when the compacted item is not already a map.
  • Loading branch information
BigBlueHat authored Jan 15, 2025
2 parents 6dedb77 + 4b66ee3 commit 2e10884
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/compact-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -6206,6 +6206,38 @@ <h2>
</dd>
</dl>
</dd>
<dt id='tm023'>
Test tm023 compact IRI with container: @type
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#tm023</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:CompactTest</dd>
<dt>Purpose</dt>
<dd>Uses @none when compacted item is an IRI string</dd>
<dt>input</dt>
<dd>
<a href='compact/m023-in.jsonld'>compact/m023-in.jsonld</a>
</dd>
<dt>context</dt>
<dd>
<a href='compact/m023-context.jsonld'>compact/m023-context.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='compact/m023-out.jsonld'>compact/m023-out.jsonld</a>
</dd>
<dt>Options</dt>
<dd>
<dl class='options'>
<dt>specVersion</dt>
<dd>json-ld-1.1</dd>
</dl>
</dd>
</dl>
</dd>
<dt id='tn001'>
Test tn001 Indexes to @nest for property with @nest
</dt>
Expand Down
9 changes: 9 additions & 0 deletions tests/compact-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,15 @@
"context": "compact/m022-context.jsonld",
"expect": "compact/m022-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tm023",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "compact IRI with container: @type",
"purpose": "Uses @none when compacted item is an IRI string",
"input": "compact/m023-in.jsonld",
"context": "compact/m023-context.jsonld",
"expect": "compact/m023-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tn001",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
Expand Down
9 changes: 9 additions & 0 deletions tests/compact/m023-context.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": {
"@vocab": "http://schema.org/",
"location": {
"@type": "@id",
"@container": "@type"
}
}
}
9 changes: 9 additions & 0 deletions tests/compact/m023-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": {
"@vocab": "http://schema.org/"
},
"@type": "Event",
"location": {
"@id": "http://kg.artsdata.ca/resource/K11-200"
}
}
13 changes: 13 additions & 0 deletions tests/compact/m023-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"@context": {
"@vocab": "http://schema.org/",
"location": {
"@type": "@id",
"@container": "@type"
}
},
"@type": "Event",
"location": {
"@none": "http://kg.artsdata.ca/resource/K11-200"
}
}

0 comments on commit 2e10884

Please sign in to comment.