Skip to content

Html base #93

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
Nov 16, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[{
"@id": "http://dbpedia.org/resource/John_Lennon",
"http://xmlns.com/foaf/0.1/name": [{"@value": "John Lennon"}],
"http://schema.org/birthDate": [
{"@value": "1940-10-09", "@type": "http://www.w3.org/2001/XMLSchema#date"}
],
"http://schema.org/spouse": [
{"@id": "http://dbpedia.org/resource/Cynthia_Lennon"}
]
}]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

{
"@context": "https://json-ld.org/contexts/person.jsonld",
"@id": "John_Lennon",
"name": "John Lennon",
"born": "1940-10-09",
"spouse": "Cynthia_Lennon"
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<table class="statements" data-result-for="Using the document base URL to establish the default base IRI-expanded" data-to-rdf>
<thead><tr>
<th>Subject</th>
<th>Property</th>
<th>Value</th>
<th>Value Type</th>
</tr></thead>
<tbody>
<tr>
<td>http://dbpedia.org/resource/John_Lennon</td>
<td>foaf:name</td>
<td>John Lennon</td>
<td> </td>
</tr>
<tr>
<td>http://dbpedia.org/resource/John_Lennon</td>
<td>schema:birthDate</td>
<td>1940-10-09</td>
<td>xsd:date</td>
</tr>
<tr>
<td>http://dbpedia.org/resource/John_Lennon</td>
<td>schema:spouse</td>
<td>http://dbpedia.org/resource/Cynthia_Lennon</td>
<td> </td>
</tr>
</tbody>
</table>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@base <http://dbpedia.org/resource/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix schema: <http://schema.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<John_Lennon> foaf:name "John Lennon";
schema:birthDate "1940-10-09"^^xsd:date;
schema:spouse <Cynthia_Lennon> .
90 changes: 87 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8485,10 +8485,94 @@ <h3>Graph Containers</h3>

<p>When processing a JSON-LD
<a data-cite="HTML52/semantics-scripting.html#the-script-element">script element</a>,
only the resolved document location of the
containing HTML document is used to establish the default <a>base IRI</a> of the enclosed
the <a data-cite="HTML52/infrastructure.html#document-base-url">Document Base URL</a>
of the containing HTML document,
as defined in [[HTML52]],
is used to establish the default <a>base IRI</a> of the enclosed
JSON-LD content.</p>

<p class="issue atrisk" data-number="23"></p>

<aside class="example ds-selector-tabs"
title="Using the document base URL to establish the default base IRI">
<div class="selectors">
<button class="selected" data-selects="original">Original</button>
<button data-selects="expanded">Expanded</button>
<button data-selects="statements">Statements</button>
<button data-selects="turtle">Turtle</button>
</div>
<pre class="original selected" data-transform="updateExample"
data-content-type="text/html">
<!--
****<html>
<head>
<base href="http://dbpedia.org/resource/"/>****
<script type="application/ld+json">
< ! - -
{
"@context": "https://json-ld.org/contexts/person.jsonld",
"@id": ****"John_Lennon"****,
"name": "John Lennon",
"born": "1940-10-09",
"spouse": ****"Cynthia_Lennon"****
}
- - >
</script>
****</head>
</html>****
-->
</pre>
<pre class="expanded"
data-transform="updateExample"
data-result-for="Using the document base URL to establish the default base IRI-original">
<!--
[{
"@id": "http://dbpedia.org/resource/John_Lennon",
"http://xmlns.com/foaf/0.1/name": [{"@value": "John Lennon"}],
"http://schema.org/birthDate": [
{"@value": "1940-10-09", "@type": "http://www.w3.org/2001/XMLSchema#date"}
],
"http://schema.org/spouse": [
{"@id": "http://dbpedia.org/resource/Cynthia_Lennon"}
]
}]
-->
</pre>
<table class="statements"
data-result-for="Using the document base URL to establish the default base IRI-expanded"
data-to-rdf>
<thead><tr><th>Subject</th><th>Property</th><th>Value</th><th>Value Type</th></tr></thead>
<tbody>
<tr><td>http://dbpedia.org/resource/John_Lennon</td><td>foaf:name</td><td>John Lennon</td><td>&nbsp;</td></tr>
<tr><td>http://dbpedia.org/resource/John_Lennon</td><td>schema:birthDate</td><td>1940-10-09</td><td>xsd:date</td></tr>
<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>
</tbody>
</table>
<pre class="turtle"
data-content-type="text/turtle"
data-transform="updateExample"
data-result-for="Using the document base URL to establish the default base IRI-expanded"
data-to-rdf>
<!--
@base <http://dbpedia.org/resource/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix schema: <http://schema.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<John_Lennon> foaf:name "John Lennon";
schema:birthDate "1940-10-09"^^xsd:date;
schema:spouse <Cynthia_Lennon> .
-->
</pre>
</aside>

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

<section><h3>Restrictions for contents of JSON-LD <code>script</code> elements</h3>
<p class="issue atrisk">As HTML entities and comments are not allowable in
JSON, the use of comments, escapes,
Expand Down Expand Up @@ -9631,7 +9715,7 @@ <h3>Serializing/Deserializing RDF</h3>

<section class="appendix informative"><h2>Image Desciptions</h2>
<section id="fig-linked-data-graph-descr"><h3>Linked Data Dataset</h3>
<h1>Description of the <a href="#fig-linked-data-graph">Linked Data Dataset figure</a> in <a href="#data-model" class="sectionRef"></a></h1>
<h2>Description of the <a href="#fig-linked-data-graph">Linked Data Dataset figure</a> in <a href="#data-model" class="sectionRef"></a></h2>
<p>The image consists of three dashed boxes, each describing a different
linked data graph. Each box consists of shapes linked with arrows describing
the linked data relationships.</p>
Expand Down
2 changes: 1 addition & 1 deletion yaml/Embedding-JSON-LD-in-HTML-with-comments-expanded.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Example 103: Embedding JSON-LD in HTML with comments-expanded
Example 104: Embedding JSON-LD in HTML with comments-expanded
---
- "@id": http://dbpedia.org/resource/John_Lennon
http://xmlns.com/foaf/0.1/name:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Example 108: Flattened and expanded form for the previous example
Example 109: Flattened and expanded form for the previous example
---
- "@id": _:b0
http://xmlns.com/foaf/0.1/name: Dave Longley
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Example 114: JSON-LD using native data types for numbers and boolean values
Example 115: JSON-LD using native data types for numbers and boolean values
---
"@context":
ex: http://example.com/vocab#
Expand Down
2 changes: 1 addition & 1 deletion yaml/Linked-Data-Dataset-compacted.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Example 106: Linked Data Dataset-compacted
Example 107: Linked Data Dataset-compacted
---
"@context":
- http://schema.org/
Expand Down
2 changes: 1 addition & 1 deletion yaml/Linked-Data-Dataset-expanded.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Example 106: Linked Data Dataset-expanded
Example 107: Linked Data Dataset-expanded
---
- "@id": http://example.com/people/alice
http://schema.org/name:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Example 121: Same book description in JSON-LD (avoiding contexts)
Example 122: Same book description in JSON-LD (avoiding contexts)
---
- "@id": http://purl.oreilly.com/works/45U8QJGZSQKDH8N
"@type": http://purl.org/vocab/frbr/core#Work
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Example 119: Same description in JSON-LD (context shared among node objects)
Example 120: Same description in JSON-LD (context shared among node objects)
---
"@context":
foaf: http://xmlns.com/foaf/0.1/
Expand Down
2 changes: 1 addition & 1 deletion yaml/Same-embedding-example-in-JSON-LD.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Example 113: Same embedding example in JSON-LD
Example 114: Same embedding example in JSON-LD
---
"@context":
foaf: http://xmlns.com/foaf/0.1/
Expand Down
2 changes: 1 addition & 1 deletion yaml/Same-example-with-a-list-of-values-in-JSON-LD.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Example 117: Same example with a list of values in JSON-LD
Example 118: Same example with a list of values in JSON-LD
---
"@context":
foaf: http://xmlns.com/foaf/0.1/
Expand Down
2 changes: 1 addition & 1 deletion yaml/Sample-JSON-LD-document.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Example 107: Sample JSON-LD document
Example 108: Sample JSON-LD document
---
"@context":
name: http://xmlns.com/foaf/0.1/name
Expand Down
2 changes: 1 addition & 1 deletion yaml/The-same-set-of-statements-serialized-in-JSON-LD.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Example 111: The same set of statements serialized in JSON-LD
Example 112: The same set of statements serialized in JSON-LD
---
"@context":
foaf: http://xmlns.com/foaf/0.1/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Example 103: Using the document base URL to establish the default base IRI-expanded
---
- "@id": http://dbpedia.org/resource/John_Lennon
http://xmlns.com/foaf/0.1/name:
- "@value": John Lennon
http://schema.org/birthDate:
- "@value": '1940-10-09'
"@type": http://www.w3.org/2001/XMLSchema#date
http://schema.org/spouse:
- "@id": http://dbpedia.org/resource/Cynthia_Lennon