Skip to content

Fix context processing for reverse terms #566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1664,10 +1664,10 @@ <h3>Algorithm</h3>
<li>Set the <a>term definition</a> of <var>term</var> in
<var>active context</var> to <var>definition</var> and the
value associated with <var>defined</var>'s <a>entry</a> <var>term</var> to
<code>true</code> and return.</li>
<code>true</code>.</li>
</ol>
</li>
<li>If <var>value</var> contains the <a>entry</a> <code>@id</code> and its value
<li>Otherwise if <var>value</var> contains the <a>entry</a> <code>@id</code> and its value
does not equal <var>term</var>:
<ol>
<li id="ctd-id-null">If the <code>@id</code> <a>entry</a> of <var>value</var>
Expand Down
34 changes: 34 additions & 0 deletions tests/compact-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -3212,6 +3212,40 @@ <h2>
</dd>
</dl>
</dd>
<dt id='t0114'>
Test t0114 Reverse term with property based indexed container
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#t0114</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:CompactTest</dd>
<dt>Purpose</dt>
<dd>With reverse term using @container: @index and @index set to a property, ensure round-tripping from expaned form</dd>
<dt>input</dt>
<dd>
<a href='expand/0131-out.jsonld'>expand/0131-out.jsonld</a>
</dd>
<dt>context</dt>
<dd>
<a href='expand/0131-in.jsonld'>expand/0131-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='expand/0131-in.jsonld'>expand/0131-in.jsonld</a>
</dd>
<dt>Options</dt>
<dd>
<dl class='options'>
<dt>base</dt>
<dd>https://example.org/</dd>
<dt>specVersion</dt>
<dd>json-ld-1.1</dd>
</dl>
</dd>
</dl>
</dd>
<dt id='tc001'>
Test tc001 adding new term
</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 @@ -957,6 +957,15 @@
"input": "compact/0113-in.jsonld",
"context": "compact/0113-context.jsonld",
"expect": "compact/0113-out.jsonld"
}, {
"@id": "#t0114",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
"name": "Reverse term with property based indexed container",
"purpose": "With reverse term using @container: @index and @index set to a property, ensure round-tripping from expaned form",
"input": "expand/0131-out.jsonld",
"context": "expand/0131-in.jsonld",
"expect": "expand/0131-in.jsonld",
"option": {"base": "https://example.org/", "specVersion": "json-ld-1.1"}
}, {
"@id": "#tc001",
"@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"],
Expand Down
28 changes: 28 additions & 0 deletions tests/expand-manifest.html
Original file line number Diff line number Diff line change
Expand Up @@ -3215,6 +3215,34 @@ <h2>
</dd>
</dl>
</dd>
<dt id='t0131'>
Test t0131 Reverse term with property based indexed container
</dt>
<dd>
<dl class='entry'>
<dt>id</dt>
<dd>#t0131</dd>
<dt>Type</dt>
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
<dt>Purpose</dt>
<dd>Expanding a reverse term using @container: @index and @index set to a property</dd>
<dt>input</dt>
<dd>
<a href='expand/0131-in.jsonld'>expand/0131-in.jsonld</a>
</dd>
<dt>expect</dt>
<dd>
<a href='expand/0131-out.jsonld'>expand/0131-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='tc001'>
Test tc001 adding new term
</dt>
Expand Down
8 changes: 8 additions & 0 deletions tests/expand-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,14 @@
"purpose": "Verify URI resolution relative to base (without trailing slash, with path) according to RFC 3986",
"input": "expand/0130-in.jsonld",
"expect": "expand/0130-out.jsonld"
}, {
"@id": "#t0131",
"@type": [ "jld:PositiveEvaluationTest", "jld:ExpandTest" ],
"name": "Reverse term with property based indexed container",
"purpose": "Expanding a reverse term using @container: @index and @index set to a property",
"input": "expand/0131-in.jsonld",
"expect": "expand/0131-out.jsonld",
"option": {"specVersion": "json-ld-1.1"}
}, {
"@id": "#tc001",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
Expand Down
16 changes: 16 additions & 0 deletions tests/expand/0131-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"@context": {
"@version": 1.1,
"@base": "https://example.org/",
"@vocab": "https://example.net/ns#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"statement": {"@reverse": "rdf:subject", "@container": "@index", "@index": "predicate"},
"predicate": {"@id": "rdf:predicate", "@type": "@vocab"},
"term": {"@id": "rdf:object", "@type": "@vocab"},
"addedIn": {"@type": "@id"}
},
"@id": "item/1",
"statement": {
"rdf:type": {"term": "A", "addedIn": "v1"}
}
}
26 changes: 26 additions & 0 deletions tests/expand/0131-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"@id": "https://example.org/item/1",
"@reverse": {
"http://www.w3.org/1999/02/22-rdf-syntax-ns#subject": [
{
"https://example.net/ns#addedIn": [
{
"@id": "https://example.org/v1"
}
],
"http://www.w3.org/1999/02/22-rdf-syntax-ns#object": [
{
"@id": "https://example.net/ns#A"
}
],
"http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate": [
{
"@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
}
]
}
]
}
}
]