Skip to content

Compact IRI expansion with prefix flag false #109

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 2 commits into from
Jun 17, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 6 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1695,9 +1695,13 @@ <h3>Algorithm</h3>
<a href="#context-processing-algorithm">Context Processing</a>.</li>
<li>If <var>active context</var> contains a <a>term definition</a>
for <var>prefix</var>
<span class="changed">having a non-<code>null</code> <a>IRI mapping</a></span>,
<span class="changed">having a non-<code>null</code> <a>IRI mapping</a>
and the <a>prefix flag</a> of the <a>term definition</a> is <code>true</code></span>,
return the result of concatenating the <a>IRI mapping</a>
associated with <var>prefix</var> and <var>suffix</var>.</li>
associated with <var>prefix</var> and <var>suffix</var>.
<p class="ednote">A more conservative change, although more involved,
would to restrict looking at the <a>prefix flag</a> unless
the <a>processing mode</a> is <code>json-ld-1.1</code>.</p></li>
<li><span class="changed">If <var>value</var> has the form of an <a>absolute IRI</a></span>,
return <var>value</var>.</li>
</ol>
Expand Down
10 changes: 9 additions & 1 deletion tests/expand-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Expanding blank node labels",
"purpose": "Blank nodes are not relabeled during expansion",
"option": {"processingMode": "json-ld-1.0"},
"option": {"specVersion": "json-ld-1.0"},
"input": "expand/0038-in.jsonld",
"expect": "expand/0038-out.jsonld"
}, {
Expand Down Expand Up @@ -2347,6 +2347,14 @@
"option": {"specVersion": "json-ld-1.1"},
"input": "expand/pr28-in.jsonld",
"expect": "protected term redefinition"
}, {
"@id": "#tpr29",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "Does not expand a Compact IRI using a non-prefix term.",
"purpose": "Expansion of Compact IRIs considers if the term can be used as a prefix.",
"option": {"specVersion": "json-ld-1.1"},
"input": "expand/pr29-in.jsonld",
"expect": "expand/pr29-out.jsonld"
}, {
"@id": "#ttn01",
"@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"],
Expand Down
2 changes: 1 addition & 1 deletion tests/expand/0014-in.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"set": "@set",
"value": "@value",
"type": "@type",
"xsd": { "@id": "http://www.w3.org/2001/XMLSchema#" }
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"property1": {
"uri": "ex:example2",
Expand Down
2 changes: 1 addition & 1 deletion tests/expand/0048-in.jsonld
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"@context": {
"term": "http://example.com/terms-are-not-considered-in-id",
"compact-iris": "http://example.com/compact-iris-",
"compact-iris": "http://example.com/compact-iris#",
"property": "http://example.com/property",
"@vocab": "http://example.org/vocab-is-not-considered-for-id"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/expand/0048-out.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"@id": "https://w3c.github.io/json-ld-api/tests/expand/term",
"http://example.com/property": [
{
"@id": "http://example.com/compact-iris-are-considered",
"@id": "http://example.com/compact-iris#are-considered",
"http://example.com/property": [
{ "@value": "@id supports the following values: relative, absolute, and compact IRIs" }
]
Expand Down
8 changes: 8 additions & 0 deletions tests/expand/pr29-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"@context": {
"@version": 1.1,
"tag": {"@id": "http://example.org/ns/tag/", "@prefix": false}
},
"tag:champin.net,2019:prop": "This is not treated as a Compact IRI",
"tag": "tricky"
}
16 changes: 16 additions & 0 deletions tests/expand/pr29-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"http://example.org/ns/tag/": [
{
"@value": "tricky"
}
]
},
{
"tag:champin.net,2019:prop": [
{
"@value": "This is not treated as a Compact IRI"
}
]
}
]
5 changes: 3 additions & 2 deletions tests/flatten-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@
"name": "@set of @value objects with keyword aliases",
"purpose": "Flattening aliased @set and @value",
"input": "flatten/0014-in.jsonld",
"expect": "flatten/0014-out.jsonld"
"expect": "flatten/0014-out.jsonld",
"option": {"specVersion": "json-ld-1.0"}
}, {
"@id": "#t0015",
"@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
Expand Down Expand Up @@ -264,7 +265,7 @@
"@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
"name": "Flattening blank node labels",
"purpose": "Blank nodes are not relabeled during expansion",
"option": {"processingMode": "json-ld-1.0"},
"option": {"specVersion": "json-ld-1.0"},
"input": "flatten/0038-in.jsonld",
"expect": "flatten/0038-out.jsonld"
}, {
Expand Down
3 changes: 2 additions & 1 deletion tests/toRdf-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@
"name": "@set of @value objects with keyword aliases",
"purpose": "RDF version of expand-0014",
"input": "toRdf/0054-in.jsonld",
"expect": "toRdf/0054-out.nq"
"expect": "toRdf/0054-out.nq",
"option": {"specVersion": "json-ld-1.0"}
}, {
"@id": "#t0055",
"@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
Expand Down
2 changes: 1 addition & 1 deletion tests/toRdf/0088-in.jsonld
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"@context": {
"term": "http://example.com/terms-are-not-considered-in-id",
"compact-iris": "http://example.com/compact-iris-",
"compact-iris": "http://example.com/compact-iris#",
"property": "http://example.com/property",
"@vocab": "http://example.org/vocab-is-not-considered-for-id"
},
Expand Down
4 changes: 2 additions & 2 deletions tests/toRdf/0088-out.nq
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<http://example.com/compact-iris-are-considered> <http://example.com/property> "@id supports the following values: relative, absolute, and compact IRIs" .
<http://example.com/compact-iris#are-considered> <http://example.com/property> "@id supports the following values: relative, absolute, and compact IRIs" .
<https://w3c.github.io/json-ld-api/tests/parent-node> <http://example.com/property> "relative IRIs get resolved against the document's base IRI" .
<https://w3c.github.io/json-ld-api/tests/toRdf/term> <http://example.com/property> <http://example.com/compact-iris-are-considered> .
<https://w3c.github.io/json-ld-api/tests/toRdf/term> <http://example.com/property> <http://example.com/compact-iris#are-considered> .
<https://w3c.github.io/json-ld-api/tests/toRdf/term> <http://example.com/property> <https://w3c.github.io/json-ld-api/tests/parent-node> .