Skip to content

Commit f6c7a2a

Browse files
committed
Fix context processing for reverse terms
Fixes w3c#565.
1 parent 7a665c1 commit f6c7a2a

File tree

5 files changed

+80
-2
lines changed

5 files changed

+80
-2
lines changed

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,10 +1664,10 @@ <h3>Algorithm</h3>
16641664
<li>Set the <a>term definition</a> of <var>term</var> in
16651665
<var>active context</var> to <var>definition</var> and the
16661666
value associated with <var>defined</var>'s <a>entry</a> <var>term</var> to
1667-
<code>true</code> and return.</li>
1667+
<code>true</code>.</li>
16681668
</ol>
16691669
</li>
1670-
<li>If <var>value</var> contains the <a>entry</a> <code>@id</code> and its value
1670+
<li>Otherwise if <var>value</var> contains the <a>entry</a> <code>@id</code> and its value
16711671
does not equal <var>term</var>:
16721672
<ol>
16731673
<li id="ctd-id-null">If the <code>@id</code> <a>entry</a> of <var>value</var>

tests/expand-manifest.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3215,6 +3215,34 @@ <h2>
32153215
</dd>
32163216
</dl>
32173217
</dd>
3218+
<dt id='t0131'>
3219+
Test t0131 Reverse term with property based indexed container
3220+
</dt>
3221+
<dd>
3222+
<dl class='entry'>
3223+
<dt>id</dt>
3224+
<dd>#t0131</dd>
3225+
<dt>Type</dt>
3226+
<dd>jld:PositiveEvaluationTest, jld:ExpandTest</dd>
3227+
<dt>Purpose</dt>
3228+
<dd>Expanding a reverse term using @container: @index and @index set to a property</dd>
3229+
<dt>input</dt>
3230+
<dd>
3231+
<a href='expand/0131-in.jsonld'>expand/0131-in.jsonld</a>
3232+
</dd>
3233+
<dt>expect</dt>
3234+
<dd>
3235+
<a href='expand/0131-out.jsonld'>expand/0131-out.jsonld</a>
3236+
</dd>
3237+
<dt>Options</dt>
3238+
<dd>
3239+
<dl class='options'>
3240+
<dt>specVersion</dt>
3241+
<dd>json-ld-1.1</dd>
3242+
</dl>
3243+
</dd>
3244+
</dl>
3245+
</dd>
32183246
<dt id='tc001'>
32193247
Test tc001 adding new term
32203248
</dt>

tests/expand-manifest.jsonld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,14 @@
978978
"purpose": "Verify URI resolution relative to base (without trailing slash, with path) according to RFC 3986",
979979
"input": "expand/0130-in.jsonld",
980980
"expect": "expand/0130-out.jsonld"
981+
}, {
982+
"@id": "#t0131",
983+
"@type": [ "jld:PositiveEvaluationTest", "jld:ExpandTest" ],
984+
"name": "Reverse term with property based indexed container",
985+
"purpose": "Expanding a reverse term using @container: @index and @index set to a property",
986+
"input": "expand/0131-in.jsonld",
987+
"expect": "expand/0131-out.jsonld",
988+
"option": {"specVersion": "json-ld-1.1"}
981989
}, {
982990
"@id": "#tc001",
983991
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],

tests/expand/0131-in.jsonld

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"@context": {
3+
"@version": 1.1,
4+
"@base": "https://example.org/",
5+
"@vocab": "https://example.net/ns#",
6+
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
7+
"statement": {"@reverse": "rdf:subject", "@container": "@index", "@index": "predicate"},
8+
"predicate": {"@id": "rdf:predicate", "@type": "@vocab"},
9+
"term": {"@id": "rdf:object", "@type": "@vocab"},
10+
"addedIn": {"@type": "@id"}
11+
},
12+
"@id": "item/1",
13+
"statement": {
14+
"rdf:type": {"term": "A", "addedIn": "v1"}
15+
}
16+
}

tests/expand/0131-out.jsonld

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
"@id": "https://example.org/item/1",
4+
"@reverse": {
5+
"http://www.w3.org/1999/02/22-rdf-syntax-ns#subject": [
6+
{
7+
"https://example.net/ns#addedIn": [
8+
{
9+
"@id": "https://example.org/v1"
10+
}
11+
],
12+
"http://www.w3.org/1999/02/22-rdf-syntax-ns#object": [
13+
{
14+
"@id": "https://example.net/ns#A"
15+
}
16+
],
17+
"http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate": [
18+
{
19+
"@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
20+
}
21+
]
22+
}
23+
]
24+
}
25+
}
26+
]

0 commit comments

Comments
 (0)