Skip to content

Commit 2960428

Browse files
BigBlueHatgkellogg
authored andcommitted
Move base element handling into dedicated section
1 parent dccd725 commit 2960428

File tree

1 file changed

+90
-88
lines changed

1 file changed

+90
-88
lines changed

index.html

Lines changed: 90 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -8726,99 +8726,101 @@ <h3>Graph Containers</h3>
87268726
</pre>
87278727
</aside>
87288728

8729-
<p>When processing a JSON-LD
8730-
<a data-cite="HTML52/semantics-scripting.html#the-script-element">script element</a>,
8731-
the <a data-cite="HTML52/infrastructure.html#document-base-url">Document Base URL</a>
8732-
of the containing HTML document,
8733-
as defined in [[HTML52]],
8734-
is used to establish the default <a>base IRI</a> of the enclosed
8735-
JSON-LD content.</p>
8736-
8737-
<p class="issue atrisk" data-number="23">
8738-
The use of the <a data-cite="HTML52/infrastructure.html#document-base-url">Document Base URL</a>
8739-
from [[HTML52]] for setting the <a>base IRI</a> of the enclosed JSON-LD
8740-
is an experimental feature, which may be changed in a future version of this specification.
8741-
</p>
8729+
<section><h3>Inheriting base IRI from HTML's <code>base</code> element</h3>
8730+
<p>When processing a JSON-LD
8731+
<a data-cite="HTML52/semantics-scripting.html#the-script-element">script element</a>,
8732+
the <a data-cite="HTML52/infrastructure.html#document-base-url">Document Base URL</a>
8733+
of the containing HTML document,
8734+
as defined in [[HTML52]],
8735+
is used to establish the default <a>base IRI</a> of the enclosed
8736+
JSON-LD content.</p>
8737+
8738+
<p class="issue atrisk" data-number="23">
8739+
The use of the <a data-cite="HTML52/infrastructure.html#document-base-url">Document Base URL</a>
8740+
from [[HTML52]] for setting the <a>base IRI</a> of the enclosed JSON-LD
8741+
is an experimental feature, which may be changed in a future version of this specification.
8742+
</p>
87428743

8743-
<aside class="example ds-selector-tabs"
8744-
title="Using the document base URL to establish the default base IRI">
8745-
<div class="selectors">
8746-
<button class="selected" data-selects="original">Original</button>
8747-
<button data-selects="expanded">Expanded</button>
8748-
<button data-selects="statements">Statements</button>
8749-
<button data-selects="turtle">Turtle</button>
8750-
</div>
8751-
<pre class="original selected" data-transform="updateExample"
8752-
data-content-type="text/html">
8753-
<!--
8754-
****<html>
8755-
<head>
8756-
<base href="http://dbpedia.org/resource/"/>****
8757-
<script type="application/ld+json">
8758-
< ! - -
8759-
{
8760-
"@context": "https://json-ld.org/contexts/person.jsonld",
8761-
"@id": ****"John_Lennon"****,
8762-
"name": "John Lennon",
8763-
"born": "1940-10-09",
8764-
"spouse": ****"Cynthia_Lennon"****
8765-
}
8766-
- - >
8767-
</script>
8768-
****</head>
8769-
</html>****
8770-
-->
8771-
</pre>
8772-
<pre class="expanded"
8773-
data-transform="updateExample"
8774-
data-result-for="Using the document base URL to establish the default base IRI-original">
8775-
<!--
8776-
[{
8777-
"@id": "http://dbpedia.org/resource/John_Lennon",
8778-
"http://xmlns.com/foaf/0.1/name": [{"@value": "John Lennon"}],
8779-
"http://schema.org/birthDate": [
8780-
{"@value": "1940-10-09", "@type": "http://www.w3.org/2001/XMLSchema#date"}
8781-
],
8782-
"http://schema.org/spouse": [
8783-
{"@id": "http://dbpedia.org/resource/Cynthia_Lennon"}
8784-
]
8785-
}]
8786-
-->
8787-
</pre>
8788-
<table class="statements"
8744+
<aside class="example ds-selector-tabs"
8745+
title="Using the document base URL to establish the default base IRI">
8746+
<div class="selectors">
8747+
<button class="selected" data-selects="original">Original</button>
8748+
<button data-selects="expanded">Expanded</button>
8749+
<button data-selects="statements">Statements</button>
8750+
<button data-selects="turtle">Turtle</button>
8751+
</div>
8752+
<pre class="original selected" data-transform="updateExample"
8753+
data-content-type="text/html">
8754+
<!--
8755+
****<html>
8756+
<head>
8757+
<base href="http://dbpedia.org/resource/"/>****
8758+
<script type="application/ld+json">
8759+
< ! - -
8760+
{
8761+
"@context": "https://json-ld.org/contexts/person.jsonld",
8762+
"@id": ****"John_Lennon"****,
8763+
"name": "John Lennon",
8764+
"born": "1940-10-09",
8765+
"spouse": ****"Cynthia_Lennon"****
8766+
}
8767+
- - >
8768+
</script>
8769+
****</head>
8770+
</html>****
8771+
-->
8772+
</pre>
8773+
<pre class="expanded"
8774+
data-transform="updateExample"
8775+
data-result-for="Using the document base URL to establish the default base IRI-original">
8776+
<!--
8777+
[{
8778+
"@id": "http://dbpedia.org/resource/John_Lennon",
8779+
"http://xmlns.com/foaf/0.1/name": [{"@value": "John Lennon"}],
8780+
"http://schema.org/birthDate": [
8781+
{"@value": "1940-10-09", "@type": "http://www.w3.org/2001/XMLSchema#date"}
8782+
],
8783+
"http://schema.org/spouse": [
8784+
{"@id": "http://dbpedia.org/resource/Cynthia_Lennon"}
8785+
]
8786+
}]
8787+
-->
8788+
</pre>
8789+
<table class="statements"
8790+
data-result-for="Using the document base URL to establish the default base IRI-expanded"
8791+
data-to-rdf>
8792+
<thead><tr><th>Subject</th><th>Property</th><th>Value</th><th>Value Type</th></tr></thead>
8793+
<tbody>
8794+
<tr><td>http://dbpedia.org/resource/John_Lennon</td><td>foaf:name</td><td>John Lennon</td><td>&nbsp;</td></tr>
8795+
<tr><td>http://dbpedia.org/resource/John_Lennon</td><td>schema:birthDate</td><td>1940-10-09</td><td>xsd:date</td></tr>
8796+
<tr><td>http://dbpedia.org/resource/John_Lennon</td><td>schema:spouse</td><td>http://dbpedia.org/resource/Cynthia_Lennon</td><td>&nbsp;</td></tr>
8797+
</tbody>
8798+
</table>
8799+
<pre class="turtle"
8800+
data-content-type="text/turtle"
8801+
data-transform="updateExample"
87898802
data-result-for="Using the document base URL to establish the default base IRI-expanded"
87908803
data-to-rdf>
8791-
<thead><tr><th>Subject</th><th>Property</th><th>Value</th><th>Value Type</th></tr></thead>
8792-
<tbody>
8793-
<tr><td>http://dbpedia.org/resource/John_Lennon</td><td>foaf:name</td><td>John Lennon</td><td>&nbsp;</td></tr>
8794-
<tr><td>http://dbpedia.org/resource/John_Lennon</td><td>schema:birthDate</td><td>1940-10-09</td><td>xsd:date</td></tr>
8795-
<tr><td>http://dbpedia.org/resource/John_Lennon</td><td>schema:spouse</td><td>http://dbpedia.org/resource/Cynthia_Lennon</td><td>&nbsp;</td></tr>
8796-
</tbody>
8797-
</table>
8798-
<pre class="turtle"
8799-
data-content-type="text/turtle"
8800-
data-transform="updateExample"
8801-
data-result-for="Using the document base URL to establish the default base IRI-expanded"
8802-
data-to-rdf>
8803-
<!--
8804-
@base <http://dbpedia.org/resource/> .
8805-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
8806-
@prefix schema: <http://schema.org/> .
8807-
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
8804+
<!--
8805+
@base <http://dbpedia.org/resource/> .
8806+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
8807+
@prefix schema: <http://schema.org/> .
8808+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
88088809
8809-
<John_Lennon> foaf:name "John Lennon";
8810-
schema:birthDate "1940-10-09"^^xsd:date;
8811-
schema:spouse <Cynthia_Lennon> .
8812-
-->
8813-
</pre>
8814-
</aside>
8810+
<John_Lennon> foaf:name "John Lennon";
8811+
schema:birthDate "1940-10-09"^^xsd:date;
8812+
schema:spouse <Cynthia_Lennon> .
8813+
-->
8814+
</pre>
8815+
</aside>
88158816

8816-
<p>HTML allows for <a data-cite="HTML52/infrastructure.html#dynamic-changes-to-base-urls">Dynamic changes to base URLs</a>.
8817-
This specification does not require any specific behavior,
8818-
and to ensure that all systems process the <a>base IRI</a> equivalently, authors SHOULD
8819-
either use <a>absolute IRIs</a>, or explicitly as defined in <a href="#base-iri" class="sectionRef"></a>.
8820-
Implementations (particularly those natively operating in the [[!DOM]]) MAY take into consideration
8821-
<a data-cite="HTML52/infrastructure.html#dynamic-changes-to-base-urls">Dynamic changes to base URLs</a>.</p>
8817+
<p>HTML allows for <a data-cite="HTML52/infrastructure.html#dynamic-changes-to-base-urls">Dynamic changes to base URLs</a>.
8818+
This specification does not require any specific behavior,
8819+
and to ensure that all systems process the <a>base IRI</a> equivalently, authors SHOULD
8820+
either use <a>absolute IRIs</a>, or explicitly as defined in <a href="#base-iri" class="sectionRef"></a>.
8821+
Implementations (particularly those natively operating in the [[!DOM]]) MAY take into consideration
8822+
<a data-cite="HTML52/infrastructure.html#dynamic-changes-to-base-urls">Dynamic changes to base URLs</a>.</p>
8823+
</section>
88228824

88238825
<section><h3>Restrictions for contents of JSON-LD <code>script</code> elements</h3>
88248826
<p class="issue atrisk">This section adds additional requirements for escaping

0 commit comments

Comments
 (0)