Skip to content

Update IRI Expansion to not return values including a : that are not absolute IRIs #42

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
Oct 4, 2018
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: 7 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,8 @@ <h3>Algorithm</h3>
for <var>prefix</var>, return the result of concatenating
the <a>IRI mapping</a> associated with <var>prefix</var> and
<var>suffix</var>.</li>
<li>Return <var>value</var> as it is already an <a>absolute IRI</a>.</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>
</li>
<li>If <var>vocab</var> is <code>true</code>, and
Expand Down Expand Up @@ -5510,6 +5511,11 @@ <h2>Changes since JSON-LD Community Group Final Report</h2>
to ensure that <code>@type</code> members are always represented as an array. This
also allows a term to be defined for <code>@type</code>, where the value MUST be a <a>dictionary</a>
with <code>@container</code> set to <code>@set</code>.</li>
<li>Updated the <a href="#iri-expansion">IRI Expansion algorithm</a> so that
if <var>value</var> contains a colon (<code>:</code>), but
<var>prefix</var> is not a <a>term</a>, to only return <var>value</var>
if it has the form of an <a>absolute IRI</a>, otherwise fall through to
the rest of the algorithm.</li>
</ul>
</section>

Expand Down
7 changes: 7 additions & 0 deletions tests/expand-manifest.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,13 @@
"input": "expand/0108-in.jsonld",
"expect": "expand/0108-out.jsonld",
"option": {"processingMode": "json-ld-1.1", "specVersion": "json-ld-1.1"}
}, {
"@id": "#t0109",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
"name": "IRI expansion of fragments including ':'",
"purpose": "Do not treat as absolute IRIs values that look like compact IRIs if they're not absolute",
"input": "expand/0109-in.jsonld",
"expect": "expand/0109-out.jsonld"
}, {
"@id": "#tc001",
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
Expand Down
7 changes: 7 additions & 0 deletions tests/expand/0109-in.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"@context": {
"@base": "https://ex.org/",
"u": {"@id": "urn:u:", "@type": "@id"}
},
"u": ["#Test", "#Test:2"]
}
6 changes: 6 additions & 0 deletions tests/expand/0109-out.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[{
"urn:u:": [
{"@id": "https://ex.org/#Test"},
{"@id": "https://ex.org/#Test:2"}
]
}]