--- a/rdf-primer/index.html Wed Feb 19 17:58:04 2014 +0100
+++ b/rdf-primer/index.html Wed Feb 19 23:12:07 2014 +0100
@@ -110,6 +110,7 @@
figure { text-align: center; }
img.graph { width: 60%; }
table td, table th { border: 1px solid #ddd; padding: 0.2em 0.5em; }
+ .linenum {color: grey}
</style>
</head>
@@ -256,9 +257,9 @@
three elements they are called <strong>triples</strong>.
</p>
- <p>Here are examples of RDF triples:</p>
+ <p>Here are examples of RDF triples (informally expressed in pseudocode):</p>
- <pre class="example" id="example-1">
+ <pre class="example" title="Example triples (informal)" id="example1">
<Bob> <is a> <person>.
<Bob> <is a friend of> <Alice>.
<Bob> <is born on> <the 4th of July 1990>.
@@ -266,10 +267,6 @@
<the Mona Lisa> <was created by> <Leonardo da Vinci>.
<the video 'La Joconde à Washington'> <is about> <the Mona Lisa>
</pre>
-
- <p class="note">The example above does not constitute actual RDF
- syntax; it is just intended to provide an informal
- view of the notion of RDF triples. </p>
<p>The same resource is often referenced in multiple triples. In the example above,
Bob is the subject of four triples, and the Mona Lisa is the subject of
@@ -328,12 +325,7 @@
<p>As mentioned, IRIs are used to identify resources such as documents,
people, physical objects, and abstract concepts.
- For example, the IRI for the "Mona Lisa" painting in
- <a href="http://www.wikidata.org/">Wikidata</a> is:</p>
-
- <div class="example"><a href="http://www.wikidata.org/entity/Q12418">http://www.wikidata.org/entity/Q12418</a></div>
-
- <p>The IRI for Leonardo da Vinci in <a
+ For example, the IRI for Leonardo da Vinci in <a
href="http://dbpedia.org">DBpedia</a> is:</p>
<div class="example"><a href="http://dbpedia.org/resource/Leonardo_da_Vinci">http://dbpedia.org/resource/Leonardo_da_Vinci</a></div>
@@ -373,7 +365,8 @@
tag</i>. For example, "Léonard de Vinci" could
be associated with the "fr" language tag and "李奥纳多·达·文西"
with the "zh" language tag.</p>
-
+
+ <!--
<p class="note">The 2004 version of RDF contained the notion of a
"plain literal" with no datatype. This feature has been removed, as the
distinction between "plain" literals and literals with datatype
@@ -383,7 +376,8 @@
datatype. The special datatype
<code>rdf:langString</code> is assigned to language-tagged
literals.</p>
-
+ -->
+
<p>Literals may only appear in the <strong>object position</strong> of a triple.</p>
<p>The RDF Concepts document provides a (non-exhaustive)
@@ -399,7 +393,7 @@
<p>IRIs and literals together provide the basic material for
writing down RDF statements. In addition, it is sometimes handy
- to be able to talk about resources without bothering to use an
+ to be able to talk about resources without bothering to use a global
identifier. For example, we might want to state that the Mona
Lisa painting has in its background an unidentified tree which
we know to be a cypress tree. Resources without identifiers such as the
@@ -415,8 +409,6 @@
to denote resources without explicitly naming them with an
IRI.</p>
- <p class="issue">Fine-tune diagram</p>
-
<figure id="fig2">
<img class="graph" src="example-blank-node.jpg"
alt="Blank node example: cypress tree">
@@ -432,7 +424,7 @@
<h3>Multiple graphs</h3>
<p>RDF provides a mechanism to group RDF statements in multiple
- graphs and associate each graph with an IRI . Multiple graphs are a recent extension of the RDF
+ graphs and associate graphs with an IRI . Multiple graphs are a recent extension of the RDF
data model. In practice, RDF tool builders and data managers
needed a mechanism to talk about subsets of a collection of
triples. Multiple graphs were first introduced in the RDF query
@@ -446,12 +438,12 @@
at most one unnamed ("default") graph. </p><p>
<p>For example, the
- statements in the <a href="#section-triple">first example</a>
+ statements in the <a href="#example1">Example 1</a>
could be grouped in two named
graphs. A first graph could be provided by a social networking
site and identified by <code>http://example.org/bob</code>:</p>
- <pre class="example">
+ <pre class="example" title="First graph in the sample dataset">
<Bob> <is a> <person>.
<Bob> <is a friend of> <Alice>.
<Bob> <is born on> <the 4th of July 1990>.
@@ -466,7 +458,7 @@
and identified by
<code>https://www.wikidata.org/wiki/Special:EntityData/Q12418</code>:</p>
- <pre class="example">
+ <pre class="example" title="Second graph in the sample dataset">
<Leonardo da Vinci> <is the creator of> <the Mona Lisa>.
<The video 'La Joconde à Washington'> <is about> <the Mona Lisa>
</pre>
@@ -476,7 +468,7 @@
as subject. The triples associate publisher and license information with
this graph IRI: </p>
- <pre class="example">
+ <pre class="example" title="Unnamed graph in the sample dataset">
<http://example.org/bob> <is published by> <http://example.org>.
<http://example.org/bob> <has license> <http://creativecommons.org/licenses/by/3.0/>.
</pre>
@@ -599,7 +591,7 @@
<p>With the help of RDF Schema one can build a model of RDF data. A
simple informal example:</p>
- <pre class="example" id="rdfs-example">
+ <pre class="example" title="RDF Schema example" id="rdfs-example">
<Person> <<strong>type</strong>> <Class>
<is a friend of> <<strong>type</strong>> <Property>
<is a friend of> <<strong>domain</strong>> <Person>
@@ -609,7 +601,7 @@
<p>Note that, while <code><is a friend of></code> is a
property typically used as the predicate of a triple (as it was in
-<a href="#example-1">Example 1</a>), properties like this are themselves resources that can be
+<a href="#example1">Example 1</a>), properties like this are themselves resources that can be
described by triples or provide values in the descriptions of other
resources. In this example, <code><is a friend of></code> is the subject of triples
that assign type, domain, and range values to it, and it's the object of
@@ -632,7 +624,7 @@
providers. The idea is that webmasters can use these terms to mark-up
Web pages, so that search engines understand what the pages are
about.</dd>
-
+
<dt><a href="http://www.w3.org/2004/02/skos/">SKOS</a></dt>
<dd>SKOS is a vocabulary for publishing classification schemes
such as terminologies and thesauri on the Web. SKOS is since 2009 a W3C
@@ -642,9 +634,9 @@
vocabulary</a>.</dd>
</dl>
-<p>Vocabularies get their value from reuse: the more vocabulary ITIs
+<p>Vocabularies get their value from reuse: the more vocabulary IRIs
are reused by others, the more valuable it becomes to use the
-IRIs (the so-called netwrok effect). This means you should prefer
+IRIs (the so-called network effect). This means you should prefer
re-using someone else's IRI instead of inventing a new one. </p>
<p>For a formal specification of the semantics of the RDF Schema
@@ -664,7 +656,7 @@
graphs. However, different ways of writing down the same graph lead
to exactly the same triples, and are thus logically equivalent. </p>
- <p>In this section we briefly introduce, through an annotated example, the following syntaxes:
+ <p>In this section we briefly introduce, through annotated examples, the following syntaxes:
<ul>
<li>Turtle family of RDF languages
(<a href="#section-n-triples">N-Triples</a>,
@@ -691,25 +683,23 @@
<h4>N-Triples</h4>
<p>N-Triples [[N-TRIPLES]] provides a simple line-based, plain-text way for serializing RDF
-graphs. Each line represents an RDF triple. The informal graph in <a
+graphs. The informal graph in <a
href="#fig1">Fig. 1</a> can be represented in N-Triples in the
following way:</p>
-<pre class="example" id="n-triples-example">
-01 <http://example.org/bob#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
-02 <http://example.org/bob#me> <http://xmlns.com/foaf/0.1/knows> <http://example.org/alice#me> .
-03 <http://example.org/bob#me> <http://schema.org/birthDate> "1990-07-04"^^<http://www.w3.org/2001/XMLSchema#date> .
-04 <http://example.org/bob#me> <http://xmlns.com/foaf/0.1/topic_interest> <http://www.wikidata.org/entity/Q12418> .
-05 <http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/title> "Mona Lisa" .
-06 <http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/creator> <http://dbpedia.org/resource/Leonardo_da_Vinci> .
-07 <http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619> <http://purl.org/dc/terms/subject> <http://www.wikidata.org/entity/Q12418> .
+<pre class="example" title="N-Triples example" id="n-triples-example">
+<span class="linenum">01</span> <http://example.org/bob#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
+<span class="linenum">02</span> <http://example.org/bob#me> <http://xmlns.com/foaf/0.1/knows> <http://example.org/alice#me> .
+<span class="linenum">03</span> <http://example.org/bob#me> <http://schema.org/birthDate> "1990-07-04"^^<http://www.w3.org/2001/XMLSchema#date> .
+<span class="linenum">04</span> <http://example.org/bob#me> <http://xmlns.com/foaf/0.1/topic_interest> <http://www.wikidata.org/entity/Q12418> .
+<span class="linenum">05</span> <http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/title> "Mona Lisa" .
+<span class="linenum">06</span> <http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/creator> <http://dbpedia.org/resource/Leonardo_da_Vinci> .
+<span class="linenum">07</span> <http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619> <http://purl.org/dc/terms/subject> <http://www.wikidata.org/entity/Q12418> .
</pre>
-<p>In N-Triples each line represents a triple. Full IRIs are enclosed in angle brackets
+<p>Each line represents a triple. Full IRIs are enclosed in angle brackets
(<code><></code>). The period at the end of the line signals the
-end of the triple.</p>
-
-<p>In line 3 we see an example of a literal, in this case a date. The
+end of the triple. In line 3 we see an example of a literal, in this case a date. The
datatype is appended to the literal through a <code>^^</code> delimiter. The date
representation follows the conventions of the XML Schema datatype
<a href="http://www.w3.org/TR/xmlschema11-2/#date">date</a>.</p>
@@ -750,33 +740,33 @@
<p>Turtle [[TURTLE]] is an <strong>extension of N-Triples</strong>.
In addition to the basic N-Triples syntax, Turtle
-introduces a number of syntax shortcuts, such as
-support for namespaces, lists and shorthands for datatyped
+introduces a number of syntactic shortcuts, such as
+support for namespace prefixes, lists and shorthands for datatyped
literals. Turtle provides a trade-off between ease of
writing, ease of parsing and readability. The graph shown in
<a href="#fig4">Fig. 4</a> can be
represented in Turtle as follows:</p>
- <pre class="example" id="turtle-example">
-01 BASE <http://example.org/>
-02 PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-03 PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-04 PREFIX schema: <http://schema.org/>
-05 PREFIX dcterms: <http://purl.org/dc/terms/>
-06 PREFIX wd: <http://www.wikidata.org/entity/>
-07
-08 <bob#me>
-09 a foaf:Person ;
-10 foaf:knows <alice#me> ;
-11 schema:birthDate "1990-07-04"^^xsd:date ;
-12 foaf:topic_interest wd:Q12418 .
-13
-14 wd:Q12418
-15 dcterms:title "Mona Lisa" ;
-16 dcterms:creator <http://dbpedia.org/resource/Leonardo_da_Vinci> .
-17
-18 <http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619>
-19 dcterms:subject wd:Q12418 .
+<pre class="example" title="Turtle example" id="turtle-example">
+<span class="linenum">01</span> BASE <http://example.org/>
+<span class="linenum">02</span> PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+<span class="linenum">03</span> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
+<span class="linenum">04</span> PREFIX schema: <http://schema.org/>
+<span class="linenum">05</span> PREFIX dcterms: <http://purl.org/dc/terms/>
+<span class="linenum">06</span> PREFIX wd: <http://www.wikidata.org/entity/>
+<span class="linenum">07</span>
+<span class="linenum">08</span> <bob#me>
+<span class="linenum">09</span> a foaf:Person ;
+<span class="linenum">10</span> foaf:knows <alice#me> ;
+<span class="linenum">11</span> schema:birthDate "1990-07-04"^^xsd:date ;
+<span class="linenum">12</span> foaf:topic_interest wd:Q12418 .
+<span class="linenum">13</span>
+<span class="linenum">14</span> wd:Q12418
+<span class="linenum">15</span> dcterms:title "Mona Lisa" ;
+<span class="linenum">16</span> dcterms:creator <http://dbpedia.org/resource/Leonardo_da_Vinci> .
+<span class="linenum">17</span>
+<span class="linenum">18</span> <http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619>
+<span class="linenum">19</span> dcterms:subject wd:Q12418 .
</pre>
<p>The Turtle example is logically equivalent to the <a href="#n-triples-example">N-Triples</a>
@@ -807,10 +797,10 @@
<h5>Representation of blank nodes</h5>
-<p>Below is sample Turtle syntax for blank nodes, using the
+<p>Below is syntactic variants for writing down blank nodes, using the
earlier cypress tree example:</p>
-<pre class="example">
+<pre class="example" title="Blank node example">
PREFIX lio: <http://purl.org/net/lio#>
<http://dbpedia.org/resource/Mona_Lisa> lio:shows _:x .
@@ -823,8 +813,25 @@
<code>Cypress</code> class. The example above provides concrete syntax
for the informal graph in <a href="#fig2">Fig. 2</a>.</p>
-<p>This section gives by no means a full account of the Turtle syntax. For
-more details about the syntax of Turtle please consult the Turtle specification [[TURTLE]].</p>
+<p>Turtle also has an alternative notation for blank nodes, which
+does not require the use of the syntax like <code>_:x</code>: </p>
+
+<pre class="example" title="Blank node example (alternative notation)">
+ @prefix foaf: <http://xmlns.com/foaf/0.1/> .
+
+ # Some resource (blank node) is interested in some other resource
+ # entitled "Mona Lisa" and created by Leonardo da Vinci.
+
+ [] foaf:topic_interest [
+ dcterms:title "Mona Lisa" ;
+ dcterms:creator <http://dbpedia.org/resource/Leonardo_da_Vinci> ] .
+</pre>
+
+<p>Square brackets represent a blank node. Predicate-object pairs within
+the square brackets are interpreted as triples with the blank node as
+subject.
+
+<p>For more details about the syntax of Turtle please consult the Turtle specification [[TURTLE]].</p>
</section>
@@ -844,36 +851,36 @@
<p>The <a href="#section-multiple-graphs">multiple-graphs version of our example</a>
can be specified in TriG as follows:</p>
- <pre class="example" id="trig-example">
-01 BASE <http://example.org/>
-02 PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-03 PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
-04 PREFIX schema: <http://schema.org/>
-05 PREFIX dcterms: <http://purl.org/dc/terms/>
-06 PREFIX wd: <http://www.wikidata.org/entity/>
-07
-08 GRAPH <http://example.org/bob>
-09 {
-10 <bob#me>
-11 a foaf:Person ;
-12 foaf:knows <alice#me> ;
-13 schema:birthDate "1990-07-04"^^xsd:date ;
-14 foaf:topic_interest wd:Q12418 .
-15 }
-16
-17 GRAPH <https://www.wikidata.org/wiki/Special:EntityData/Q12418>
-18 {
-19 wd:Q12418
-20 dcterms:title "Mona Lisa" ;
-21 dcterms:creator <http://dbpedia.org/resource/Leonardo_da_Vinci> .
-22
-23 <http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619>
-24 dcterms:subject wd:Q12418 .
-25 }
-26
-27 <http://example.org/bob>
-28 dcterms:publisher <http://example.org> ;
-29 dcterms:rights <http://creativecommons.org/licenses/by/3.0/> .
+<pre class="example" title="TriG example" id="trig-example">
+<span class="linenum">01</span> BASE <http://example.org/>
+<span class="linenum">02</span> PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+<span class="linenum">03</span> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
+<span class="linenum">04</span> PREFIX schema: <http://schema.org/>
+<span class="linenum">05</span> PREFIX dcterms: <http://purl.org/dc/terms/>
+<span class="linenum">06</span> PREFIX wd: <http://www.wikidata.org/entity/>
+<span class="linenum">07</span>
+<span class="linenum">08</span> GRAPH <http://example.org/bob>
+<span class="linenum">09</span> {
+<span class="linenum">10</span> <bob#me>
+<span class="linenum">11</span> a foaf:Person ;
+<span class="linenum">12</span> foaf:knows <alice#me> ;
+<span class="linenum">13</span> schema:birthDate "1990-07-04"^^xsd:date ;
+<span class="linenum">14</span> foaf:topic_interest wd:Q12418 .
+<span class="linenum">15</span> }
+<span class="linenum">16</span>
+<span class="linenum">17</span> GRAPH <https://www.wikidata.org/wiki/Special:EntityData/Q12418>
+<span class="linenum">18</span> {
+<span class="linenum">19</span> wd:Q12418
+<span class="linenum">20</span> dcterms:title "Mona Lisa" ;
+<span class="linenum">21</span> dcterms:creator <http://dbpedia.org/resource/Leonardo_da_Vinci> .
+<span class="linenum">22</span>
+<span class="linenum">23</span> <http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619>
+<span class="linenum">24</span> dcterms:subject wd:Q12418 .
+<span class="linenum">25</span> }
+<span class="linenum">26</span>
+<span class="linenum">27</span> <http://example.org/bob>
+<span class="linenum">28</span> dcterms:publisher <http://example.org> ;
+<span class="linenum">29</span> dcterms:rights <http://creativecommons.org/licenses/by/3.0/> .
</pre>
<p>This RDF dataset contains two named graphs. Lines 8 and 17 list
@@ -886,7 +893,7 @@
<p>The syntax of the triples and of the directives at the top conforms to
the Turtle syntax.</p>
- <p>The two triples specified on lines 30-32 are not part of any
+ <p>The two triples specified on lines 27-29 are not part of any
named graph. Together they form the unnamed ("default") graph of this RDF
dataset.</p>
@@ -909,15 +916,15 @@
N-Quads version of the TriG example above:</p>
<pre class="example" id="n-quads-example">
-01 <http://example.org/bob#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.org/bob> .
-02 <http://example.org/bob#me> <http://xmlns.com/foaf/0.1/knows> <http://example.org/alice#me> <http://example.org/bob> .
-03 <http://example.org/bob#me> <http://schema.org/birthDate> "1990-07-04"^^<http://www.w3.org/2001/XMLSchema#date> <http://example.org/bob> .
-04 <http://example.org/bob#me> <http://xmlns.com/foaf/0.1/topic_interest> <http://www.wikidata.org/entity/Q12418> <http://example.org/bob> .
-05 <http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/title> "Mona Lisa" <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .
-06 <http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/creator> <http://dbpedia.org/resource/Leonardo_da_Vinci> <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .
-07 <http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619> <http://purl.org/dc/terms/subject> <http://www.wikidata.org/entity/Q12418> <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .
-08 <http://example.org/bob> <http://purl.org/dc/terms/publisher> <http://example.org> .
-09 <http://example.org/bob> <http://purl.org/dc/terms/rights> <http://creativecommons.org/licenses/by/3.0/> .
+<span class="linenum">01</span> <http://example.org/bob#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.org/bob> .
+<span class="linenum">02</span> <http://example.org/bob#me> <http://xmlns.com/foaf/0.1/knows> <http://example.org/alice#me> <http://example.org/bob> .
+<span class="linenum">03</span> <http://example.org/bob#me> <http://schema.org/birthDate> "1990-07-04"^^<http://www.w3.org/2001/XMLSchema#date> <http://example.org/bob> .
+<span class="linenum">04</span> <http://example.org/bob#me> <http://xmlns.com/foaf/0.1/topic_interest> <http://www.wikidata.org/entity/Q12418> <http://example.org/bob> .
+<span class="linenum">05</span> <http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/title> "Mona Lisa" <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .
+<span class="linenum">06</span> <http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/creator> <http://dbpedia.org/resource/Leonardo_da_Vinci> <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .
+<span class="linenum">07</span> <http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619> <http://purl.org/dc/terms/subject> <http://www.wikidata.org/entity/Q12418> <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .
+<span class="linenum">08</span> <http://example.org/bob> <http://purl.org/dc/terms/publisher> <http://example.org> .
+<span class="linenum">09</span> <http://example.org/bob> <http://purl.org/dc/terms/rights> <http://creativecommons.org/licenses/by/3.0/> .
</pre>
<p>The nine lines in the N-Quads example correspond to the nine
@@ -950,24 +957,24 @@
<p>The following JSON-LD example encodes the graph of <a
href="#fig4">Fig. 4</a>:</p>
- <pre class="example">
-01 {
-02 "@context": "example-context.json",
-03 "uri": "bob#me",
-04 "type": "Person",
-05 "born": "1990-07-04",
-06 "friends": ["alice#me"],
-07 "interest": [
-08 {
-09 "uri": "wd:Q12418",
-10 "title": "Mona Lisa",
-11 "subject_of": "http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619",
-12 "creator": {
-13 "uri": "http://dbpedia.org/resource/Leonardo_da_Vinci"
-14 }
-15 }
-16 ]
-17 }
+ <pre class="example" title="JSON-LD example">
+<span class="linenum">01</span> {
+<span class="linenum">02</span> "@context": "example-context.json",
+<span class="linenum">03</span> "uri": "bob#me",
+<span class="linenum">04</span> "type": "Person",
+<span class="linenum">05</span> "born": "1990-07-04",
+<span class="linenum">06</span> "friends": ["alice#me"],
+<span class="linenum">07</span> "interest": [
+<span class="linenum">08</span> {
+<span class="linenum">09</span> "uri": "wd:Q12418",
+<span class="linenum">10</span> "title": "Mona Lisa",
+<span class="linenum">11</span> "subject_of": "http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619",
+<span class="linenum">12</span> "creator": {
+<span class="linenum">13</span> "uri": "http://dbpedia.org/resource/Leonardo_da_Vinci"
+<span class="linenum">14</span> }
+<span class="linenum">15</span> }
+<span class="linenum">16</span> ]
+<span class="linenum">17</span> }
</pre>
<p>The <code>@context</code> key on line 2
@@ -1003,32 +1010,32 @@
<p>The HTML example below encodes the
RDF graph depicted in <a href="#fig4">Fig. 4</a>:</p>
-<pre class="example" id="rdfa-example">
-01 <body prefix="foaf: http://xmlns.com/foaf/0.1/
-02 schema: http://schema.org/
-03 dcterms: http://purl.org/dc/terms/">
-04 <div resource="http://example.org/bob#me" typeof="foaf:Person">
-05 <p>
-06 Bob knows <a property="foaf:knows" href="http://example.org/alice#me">Alice</a>
-07 and was born on the <time property="schema:birthDate">1990-07-04</time>.
-08 </p>
-09 <p>
-10 Bob is interested in <span property="foaf:topic_interest"
-11 resource="http://www.wikidata.org/entity/">the Mona Lisa</span>.
-12 </p>
-13 </div>
-14 <div resource="http://www.wikidata.org/entity/">
-15 <p>
-16 The <span property="dcterms:title">Mona Lisa</span> was painted by
-17 <a property="dcterms:creator" href="http://dbpedia.org/resource/Leonardo_da_Vinci">Leonardo da Vinci</a>
-18 and is the subject of the video
-19 <a href="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">'La Joconde à Washington'</a>.
-20 </p>
-21 </div>
-22 <div resource="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">
-23 <link property="dcterms:subject" href="http://www.wikidata.org/entity/Q12418">
-24 </div>
-25 </body>
+<pre class="example" title="RDFa example" id="rdfa-example">
+<span class="linenum">01</span> <body prefix="foaf: http://xmlns.com/foaf/0.1/
+<span class="linenum">02</span> schema: http://schema.org/
+<span class="linenum">03</span> dcterms: http://purl.org/dc/terms/">
+<span class="linenum">04</span> <div resource="http://example.org/bob#me" typeof="foaf:Person">
+<span class="linenum">05</span> <p>
+<span class="linenum">06</span> Bob knows <a property="foaf:knows" href="http://example.org/alice#me">Alice</a>
+<span class="linenum">07</span> and was born on the <time property="schema:birthDate">1990-07-04</time>.
+<span class="linenum">08</span> </p>
+<span class="linenum">09</span> <p>
+<span class="linenum">10</span> Bob is interested in <span property="foaf:topic_interest"
+<span class="linenum">11</span> resource="http://www.wikidata.org/entity/">the Mona Lisa</span>.
+<span class="linenum">12</span> </p>
+<span class="linenum">13</span> </div>
+<span class="linenum">14</span> <div resource="http://www.wikidata.org/entity/">
+<span class="linenum">15</span> <p>
+<span class="linenum">16</span> The <span property="dcterms:title">Mona Lisa</span> was painted by
+<span class="linenum">17</span> <a property="dcterms:creator" href="http://dbpedia.org/resource/Leonardo_da_Vinci">Leonardo da Vinci</a>
+<span class="linenum">18</span> and is the subject of the video
+<span class="linenum">19</span> <a href="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">'La Joconde à Washington'</a>.
+<span class="linenum">20</span> </p>
+<span class="linenum">21</span> </div>
+<span class="linenum">22</span> <div resource="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">
+<span class="linenum">23</span> <link property="dcterms:subject" href="http://www.wikidata.org/entity/Q12418">
+<span class="linenum">24</span> </div>
+<span class="linenum">25</span> </body>
</pre>
<p class="issue">Textual description of example in progress (does not
@@ -1086,27 +1093,27 @@
<p>The RDF/XML example below encodes the
RDF graph depicted in <a href="#fig4">Fig. 4</a>:</p>
-<pre class="example" id="rdf-xml-example">
-01 <?xml version="1.0" encoding="utf-8"?>
-02 <rdf:RDF
-03 xmlns:dcterms="http://purl.org/dc/terms/"
-04 xmlns:foaf="http://xmlns.com/foaf/0.1/"
-05 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-06 xmlns:schema="http://schema.org/">
-07 <rdf:Description rdf:about="http://example.org/bob#me">
-08 <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
-09 <schema:birthDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">1990-07-04</schema:birthDate>
-10 <foaf:knows rdf:resource="http://example.org/alice#me"/>
-11 <foaf:topic_interest rdf:resource="http://www.wikidata.org/entity/Q12418"/>
-12 </rdf:Description>
-13 <rdf:Description rdf:about="http://www.wikidata.org/entity/Q12418">
-14 <dcterms:title>Mona Lisa</dcterms:title>
-15 <dcterms:creator rdf:resource="http://dbpedia.org/resource/Leonardo_da_Vinci"/>
-16 </rdf:Description>
-17 <rdf:Description rdf:about="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">
-18 <dcterms:subject rdf:resource="http://www.wikidata.org/entity/Q12418"/>
-19 </rdf:Description>
-20 </rdf:RDF>
+<pre class="example" title="RDF/XML example" id="rdf-xml-example">
+<span class="linenum">01</span> <?xml version="1.0" encoding="utf-8"?>
+<span class="linenum">02</span> <rdf:RDF
+<span class="linenum">03</span> xmlns:dcterms="http://purl.org/dc/terms/"
+<span class="linenum">04</span> xmlns:foaf="http://xmlns.com/foaf/0.1/"
+<span class="linenum">05</span> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+<span class="linenum">06</span> xmlns:schema="http://schema.org/">
+<span class="linenum">07</span> <rdf:Description rdf:about="http://example.org/bob#me">
+<span class="linenum">08</span> <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/>
+<span class="linenum">09</span> <schema:birthDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">1990-07-04</schema:birthDate>
+<span class="linenum">10</span> <foaf:knows rdf:resource="http://example.org/alice#me"/>
+<span class="linenum">11</span> <foaf:topic_interest rdf:resource="http://www.wikidata.org/entity/Q12418"/>
+<span class="linenum">12</span> </rdf:Description>
+<span class="linenum">13</span> <rdf:Description rdf:about="http://www.wikidata.org/entity/Q12418">
+<span class="linenum">14</span> <dcterms:title>Mona Lisa</dcterms:title>
+<span class="linenum">15</span> <dcterms:creator rdf:resource="http://dbpedia.org/resource/Leonardo_da_Vinci"/>
+<span class="linenum">16</span> </rdf:Description>
+<span class="linenum">17</span> <rdf:Description rdf:about="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">
+<span class="linenum">18</span> <dcterms:subject rdf:resource="http://www.wikidata.org/entity/Q12418"/>
+<span class="linenum">19</span> </rdf:Description>
+<span class="linenum">20</span> </rdf:RDF>
</pre>
<p>In RDF/XML RDF triples are specified within an XML element
@@ -1289,7 +1296,7 @@
Vinci. With the help of <code>owl:sameAs</code> we can record this
information:</p>
- <pre class="example">
+ <pre class="example" title="Example link between datasets">
<http://dbpedia.org/resource/Leonardo_da_Vinci>
owl:sameAs <http://viaf.org/viaf/24604287/> .
</pre>
@@ -1321,7 +1328,7 @@
<p>We are grateful for the comments provided by (in
alphabetical order) Gareth Adams, Thomas Baker, Dan Brickley, Pierre-Antoine
Champin, Bob DuCharme, Sandro Hawke, Patrick
- Hayes, Ivan Herman, Antoine Isaac, Markus Lanthaler, and David Wood. </p>
+ Hayes, Ivan Herman, Kingsley Idehen, Antoine Isaac, Markus Lanthaler, and David Wood. </p>
</section>
@@ -1359,36 +1366,36 @@
encoding IRIs, literal values and datatypes:</p>
<pre class="example" id="json-ld-example-single">
-01 {
-02 "@context": {
-03 "foaf": "http://xmlns.com/foaf/0.1/",
-04 "xsd": "http://www.w3.org/2001/XMLSchema#",
-05 "schema": "http://schema.org/",
-06 "dcterms": "http://purl.org/dc/terms/",
-07 "wd": "http://www.wikidata.org/entity/",
-08 "@base": "http://example.org/",
-09 "subject_of": {"@reverse": "dcterms:subject"}
-10 },
-11 "@id": "bob#me",
-12 "@type": "foaf:Person",
-13 "schema:birthDate": {
-14 "@value": "1990-07-04",
-15 "@type": "xsd:date"
-16 },
-17 "foaf:knows": {
-18 "@id": "alice#me"
-19 },
-20 "foaf:topic_interest": {
-21 "@id": "wd:Q12418",
-22 "dcterms:title": "Mona Lisa",
-22 "subject_of": {
-23 "@id": "http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619"
-24 },
-25 "dcterms:creator": {
-26 "@id": "http://dbpedia.org/resource/Leonardo_da_Vinci"
-27 }
-28 }
-29 }
+<span class="linenum">01</span> {
+<span class="linenum">02</span> "@context": {
+<span class="linenum">03</span> "foaf": "http://xmlns.com/foaf/0.1/",
+<span class="linenum">04</span> "xsd": "http://www.w3.org/2001/XMLSchema#",
+<span class="linenum">05</span> "schema": "http://schema.org/",
+<span class="linenum">06</span> "dcterms": "http://purl.org/dc/terms/",
+<span class="linenum">07</span> "wd": "http://www.wikidata.org/entity/",
+<span class="linenum">08</span> "@base": "http://example.org/",
+<span class="linenum">09</span> "subject_of": {"@reverse": "dcterms:subject"}
+<span class="linenum">10</span> },
+<span class="linenum">11</span> "@id": "bob#me",
+<span class="linenum">12</span> "@type": "foaf:Person",
+<span class="linenum">13</span> "schema:birthDate": {
+<span class="linenum">14</span> "@value": "1990-07-04",
+<span class="linenum">15</span> "@type": "xsd:date"
+<span class="linenum">16</span> },
+<span class="linenum">17</span> "foaf:knows": {
+<span class="linenum">18</span> "@id": "alice#me"
+<span class="linenum">19</span> },
+<span class="linenum">20</span> "foaf:topic_interest": {
+<span class="linenum">21</span> "@id": "wd:Q12418",
+<span class="linenum">22</span> "dcterms:title": "Mona Lisa",
+<span class="linenum">22</span> "subject_of": {
+<span class="linenum">23</span> "@id": "http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619"
+<span class="linenum">24</span> },
+<span class="linenum">25</span> "dcterms:creator": {
+<span class="linenum">26</span> "@id": "http://dbpedia.org/resource/Leonardo_da_Vinci"
+<span class="linenum">27</span> }
+<span class="linenum">28</span> }
+<span class="linenum">29</span> }
</pre>
<p>On lines 2 to 10 we define various prefixes that are going to be used in the rest of
@@ -1413,56 +1420,56 @@
RDF dataset depicted in <a href="#fig5">Fig. 5</a></p>
<pre class="example" id="json-ld-example-multiple">
-01 {
-02 "@context": {
-03 "foaf": "http://xmlns.com/foaf/0.1/",
-04 "schema": "http://schema.org/",
-05 "xsd": "http://www.w3.org/2001/XMLSchema#",
-06 "dcterms": "http://purl.org/dc/terms/"
-07 },
-08 "@graph": [
-09 {
-10 "@id": "http://example.org/bob",
-11 "@graph": [
-12 {
-13 "@id": "http://example.org/bob#me",
-14 "@type": "foaf:Person",
-15 "foaf:knows": {
-16 "@id": "http://example.org/alice#me"
-17 },
-18 "foaf:topic_interest": {
-19 "@id": "http://www.wikidata.org/entity/Q12418"
-20 },
-21 "schema:birthDate": {
-22 "@value": "1990-07-04",
-23 "@type": "xsd:date"
-24 }
-25 }
-26 ],
-27 "dcterms:publisher": {
-28 "@id": "http://example.org"
-29 },
-30 "dcterms:rights": {
-31 "@id": "http://creativecommons.org/licenses/by/3.0/"
-32 }
-33 },
-34 {
-35 "@id": "https://www.wikidata.org/wiki/Special:EntityData/Q12418",
-36 "@graph": [
-37 {
-38 "@id": "http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619",
-39 "dcterms:subject": {
-40 "@id": "http://www.wikidata.org/entity/Q12418",
-41 "dcterms:title": "Mona Lisa",
-42 "dcterms:creator": {
-43 "@id": "http://dbpedia.org/resource/Leonardo_da_Vinci"
-44 }
-45 }
-46 }
-47 ]
-48 }
-49 ]
-50 }
+<span class="linenum">01</span> {
+<span class="linenum">02</span> "@context": {
+<span class="linenum">03</span> "foaf": "http://xmlns.com/foaf/0.1/",
+<span class="linenum">04</span> "schema": "http://schema.org/",
+<span class="linenum">05</span> "xsd": "http://www.w3.org/2001/XMLSchema#",
+<span class="linenum">06</span> "dcterms": "http://purl.org/dc/terms/"
+<span class="linenum">07</span> },
+<span class="linenum">08</span> "@graph": [
+<span class="linenum">09</span> {
+<span class="linenum">10</span> "@id": "http://example.org/bob",
+<span class="linenum">11</span> "@graph": [
+<span class="linenum">12</span> {
+<span class="linenum">13</span> "@id": "http://example.org/bob#me",
+<span class="linenum">14</span> "@type": "foaf:Person",
+<span class="linenum">15</span> "foaf:knows": {
+<span class="linenum">16</span> "@id": "http://example.org/alice#me"
+<span class="linenum">17</span> },
+<span class="linenum">18</span> "foaf:topic_interest": {
+<span class="linenum">19</span> "@id": "http://www.wikidata.org/entity/Q12418"
+<span class="linenum">20</span> },
+<span class="linenum">21</span> "schema:birthDate": {
+<span class="linenum">22</span> "@value": "1990-07-04",
+<span class="linenum">23</span> "@type": "xsd:date"
+<span class="linenum">24</span> }
+<span class="linenum">25</span> }
+<span class="linenum">26</span> ],
+<span class="linenum">27</span> "dcterms:publisher": {
+<span class="linenum">28</span> "@id": "http://example.org"
+<span class="linenum">29</span> },
+<span class="linenum">30</span> "dcterms:rights": {
+<span class="linenum">31</span> "@id": "http://creativecommons.org/licenses/by/3.0/"
+<span class="linenum">32</span> }
+<span class="linenum">33</span> },
+<span class="linenum">34</span> {
+<span class="linenum">35</span> "@id": "https://www.wikidata.org/wiki/Special:EntityData/Q12418",
+<span class="linenum">36</span> "@graph": [
+<span class="linenum">37</span> {
+<span class="linenum">38</span> "@id": "http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619",
+<span class="linenum">39</span> "dcterms:subject": {
+<span class="linenum">40</span> "@id": "http://www.wikidata.org/entity/Q12418",
+<span class="linenum">41</span> "dcterms:title": "Mona Lisa",
+<span class="linenum">42</span> "dcterms:creator": {
+<span class="linenum">43</span> "@id": "http://dbpedia.org/resource/Leonardo_da_Vinci"
+<span class="linenum">44</span> }
+<span class="linenum">45</span> }
+<span class="linenum">46</span> }
+<span class="linenum">47</span> ]
+<span class="linenum">48</span> }
+<span class="linenum">49</span> ]
+<span class="linenum">50</span> }
</pre>
<p>On line 8 we use the <code>@graph</code> keyword to describe two
@@ -1480,36 +1487,36 @@
in the <a href="#section-json-ld">JSON-LD section</a> above.</p>
<pre class="example">
-01 {
-02 "@context": {
-03 "foaf": "http://xmlns.com/foaf/0.1/",
-04 "xsd": "http://www.w3.org/2001/XMLSchema#",
-05 "schema": "http://schema.org/",
-06 "dcterms": "http://purl.org/dc/terms/",
-07 "wd": "http://www.wikidata.org/entity/",
-08 "@base": "http://example.org/",
+<span class="linenum">01</span> {
+<span class="linenum">02</span> "@context": {
+<span class="linenum">03</span> "foaf": "http://xmlns.com/foaf/0.1/",
+<span class="linenum">04</span> "xsd": "http://www.w3.org/2001/XMLSchema#",
+<span class="linenum">05</span> "schema": "http://schema.org/",
+<span class="linenum">06</span> "dcterms": "http://purl.org/dc/terms/",
+<span class="linenum">07</span> "wd": "http://www.wikidata.org/entity/",
+<span class="linenum">08</span> "@base": "http://example.org/",
09
-10 "uri": "@id",
-11 "type": "@type",
-12 "Person": "foaf:Person",
-13 "born": {
-14 "@id": "schema:birthDate",
-15 "@type": "xsd:date"
-16 },
-17 "friends": {
-18 "@id": "foaf:knows",
-19 "@type": "@id"
-20 },
-21 "interest": "http://xmlns.com/foaf/0.1/topic_interest",
-22 "subject_of": {
-23 "@reverse": "dcterms:subject",
-24 "@type": "@id"
-25 },
-26 "creator": "dcterms:creator",
-27 "title": "dcterms:title",
-28 "name": "foaf:name"
-29 },
-30 }
+<span class="linenum">10</span> "uri": "@id",
+<span class="linenum">11</span> "type": "@type",
+<span class="linenum">12</span> "Person": "foaf:Person",
+<span class="linenum">13</span> "born": {
+<span class="linenum">14</span> "@id": "schema:birthDate",
+<span class="linenum">15</span> "@type": "xsd:date"
+<span class="linenum">16</span> },
+<span class="linenum">17</span> "friends": {
+<span class="linenum">18</span> "@id": "foaf:knows",
+<span class="linenum">19</span> "@type": "@id"
+<span class="linenum">20</span> },
+<span class="linenum">21</span> "interest": "http://xmlns.com/foaf/0.1/topic_interest",
+<span class="linenum">22</span> "subject_of": {
+<span class="linenum">23</span> "@reverse": "dcterms:subject",
+<span class="linenum">24</span> "@type": "@id"
+<span class="linenum">25</span> },
+<span class="linenum">26</span> "creator": "dcterms:creator",
+<span class="linenum">27</span> "title": "dcterms:title",
+<span class="linenum">28</span> "name": "foaf:name"
+<span class="linenum">29</span> },
+<span class="linenum">30</span> }
</pre>
<p>For detailed information about JSON-LD please consult the JSON-LD