Skip to content

Commit d7c9cde

Browse files
committed
Explain "//" safety measure in compact IRIs
I've added an explanation of the "//" safety measure in compact IRIs. This closes #46.
1 parent c2bea5f commit d7c9cde

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

spec/latest/json-ld-syntax/index.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,15 +1315,17 @@ <h2>Compact IRIs</h2>
13151315
Instead of having to remember and type out the entire IRI, the developer
13161316
can instead use the prefix in their JSON-LD markup.
13171317
</p>
1318-
<p>To generate an <tref>IRI</tref> out of a <tref>compact IRI</tref>,
1319-
the value is first split into a <em>prefix</em> and
1320-
<em>suffix</em> at the first occurrence of a colon (<code>:</code>).
1321-
If the <tref>active context</tref> contains a term mapping for
1322-
<em>prefix</em>, an IRI is generated by prepending the mapped
1323-
<em>prefix</em> to the (possibly empty) <em>suffix</em> using textual
1324-
concatenation. If no prefix mapping is defined, the value is used
1325-
directly as an IRI. If the prefix is an underscore
1326-
(<code>_</code>), the IRI remains unchanged.
1318+
<p>Terms are interpreted as <tref>compact IRI</tref>s if they contain at least one
1319+
colon and the first colon is not followed by two slashes (<code>//</code>, as in
1320+
<code>http://example.com</code>). To generate the full <tref>IRI</tref>,
1321+
the value is first split into a <em>prefix</em> and <em>suffix</em> at the first
1322+
occurrence of a colon (<code>:</code>). If the <tref>active context</tref>
1323+
contains a term mapping for <em>prefix</em>, an IRI is generated by
1324+
prepending the mapped <em>prefix</em> to the (possibly empty) <em>suffix</em>
1325+
using textual concatenation. If no prefix mapping is defined, the value is used
1326+
directly as an <tref>absolute IRI</tref>. If the prefix is an underscore
1327+
(<code>_</code>), the IRI remains unchanged. This effectively means that every term
1328+
containing a colon will be interpreted by a JSON-LD processor as an IRI.
13271329
</p>
13281330
<p>
13291331
The ability to use <tref title="compact_iri">compact IRIs</tref> reduces the need for developers

0 commit comments

Comments
 (0)