--- a/rdf-primer/index.html Tue Aug 13 15:16:29 2013 +0100
+++ b/rdf-primer/index.html Tue Aug 13 18:55:54 2013 +0100
@@ -219,14 +219,14 @@
<pre>
<Bob> <is a friend of> <Alice>.
<Bob> <is born on> <the 4th of July 1990>.
- <Bob> <likes> <La Joconde>.
- <Leonardo da Vinci> <is the creator of> <La Joconde>.
- <La Joconde> <is on display in> <the Louvre>.
+ <Bob> <likes> <the Mona Lisa>.
+ <Leonardo da Vinci> <is the creator of> <the Mona Lisa>.
+ <the Mona Lisa> <is on display in> <the Louvre>.
</pre>
<p>Because RDF statements consist of three elements they are called
<strong>triples</strong>. Resources typically occur in multiple
- triples, for example Bob and the La Joconde painting in the examples above. We
+ triples, for example Bob and the Mona Lisa painting in the examples above. We
can therefore visualise triples as a connected <strong>graph</strong>. Graphs consists
of nodes and arcs. The subjects and
objects of the triples make up the nodes in the graph; the predicates form the arcs. </p>
@@ -259,7 +259,7 @@
in RFC 3987 [[!RFC3987]]. They can be used to identify both documents
(e.g. a Web page) and things (e.g. a person). </p>
- <p>For example, the IRI for the "La Joconde" painting in the <a href="http://www.europeana.eu/">Europeana</a>
+ <p>For example, the IRI for the "Mona Lisa" painting in the <a href="http://www.europeana.eu/">Europeana</a>
digital library is:</p>
<pre>http://data.europeana.eu/item/08501/BFEDA8C5F46930228355F50FA9F5298D982DD6B8</pre>
@@ -288,7 +288,7 @@
<p>Blank nodes can appear in the subject and object position of an RDF statement. They can be used
to denote resources without explicitly naming them with an IRI. For example a blank node could be
- used to express that the "La Joconde" painting has been created by someone whose name is "Leonardo da Vinci"
+ used to express that the "Mona Lisa" painting has been created by someone whose name is "Leonardo da Vinci"
without necessarily identifying him with an IRI.</p>
</section>
@@ -305,15 +305,15 @@
<pre>
<Bob> <is a friend of> <Alice>.
<Bob> <is born on> <the 4th of July 1990>.
- <Bob> <likes> <La Joconde>.
+ <Bob> <likes> <the Mona Lisa>.
</pre>
<p>A second graph could be provided by <a href="http://www.europeana.eu/">Europeana</a>
and identified by <code>http://data.europeana.eu/data/item/08501/BFEDA8C5F46930228355F50FA9F5298D982DD6B8</code>:</p>
<pre>
- <Leonardo da Vinci> <is the creator of> <La Joconde>.
- <La Joconde> <is on display in> <the Louvre>.
+ <Leonardo da Vinci> <is the creator of> <the Mona Lisa>.
+ <The Mona Lisa> <is on display in> <the Louvre>.
</pre>
<p>We can then make statements about these two graphs, for example adding license and provenance
@@ -333,59 +333,55 @@
</section>
-<section id="section-syntax">
+<section id="section-graph-syntax">
- <h2>RDF Syntax</h2>
+ <h2>Writing RDF graphs</h2>
- <p>The RDF Data Model can be expressed in many syntactic forms.
- We give an overview of those various syntaxes below, and illustrate
+ <p>RDF graphs can be expressed in many syntactic forms.
+ We give an overview of these various syntaxes below, and illustrate
them using the example above.</p>
- <h3>N-Triples</h3>
-
- <p><a href="http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/n-triples.html">N-Triples</a>
- provides a simple line-based, plain text way for serializing RDF graphs. Each line represents
- an RDF triple. Its subject, predicate and object are separated by white space. Our example
- can be represented in N-Triples as follows.</p>
-
- <pre>
-<http://example.org/#bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>.
-<http://example.org/#alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>.
-<http://example.org/#bob> <http://xmlns.com/foaf/0.1/knows> <http://example.org/#alice>.
-<http://example.org/#bob> <http://schema.org/birthDate> "1990-07-04"^^<http://www.w3.org/2001/XMLSchema#date>.
-<http://example.org/#da-vinci> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>.
-<http://example.org/#da-vinci> <http://xmlns.com/foaf/0.1/made> <http://example.org/#the-mona-lisa>.
-<http://example.org/#the-mona-lisa> <http://example.org/#on-display-in> <http://example.org/#the-louvre>.
-<http://example.org/#bob> <http://example.org/#likes> <http://example.org/#the-mona-lisa>.
- </pre>
+ <section id="subsection-ntriples">
- <p>N-Triples is often used for RDF examples, exchanging large RDF datasets, and processing large RDF graphs
- with line-oriented text processing tools.</p>
-
- <h3>N-quads</h3>
-
- <p><a href="https://dvcs.w3.org/hg/rdf/raw-file/default/nquads/index.html">N-Quads</a> is
- a simple extension to N-Triples enabling the exchange of RDF datasets. N-Quads adds a fourth
- element to each line, capturing the graph IRI of the triple described on that line. For example,
- we could write the first triple of our example as follows.</p>
+ <h3>N-Triples</h3>
- <pre>
-<http://example.org/#bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.org/#graph-1>.
- </pre>
+ <p><a href="http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/n-triples.html">N-Triples</a>
+ provides a simple line-based, plain text way for serializing RDF graphs. Each line represents
+ an RDF triple. Its subject, predicate and object are separated by white space. Our example
+ can be represented in N-Triples as follows.</p>
- <h3>Turtle</h3>
+ <pre>
+<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/alice#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>.
+<http://example.org/bob#me> <http://xmlns.com/foaf/0.1/knows> <http://example.org/alice#me>.
+<http://example.org/bob#me> <http://schema.org/birthDate> "1990-07-04"^^<http://www.w3.org/2001/XMLSchema#date>.
+<http://viaf.org/viaf/24604287/> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>.
+<http://viaf.org/viaf/24604287/> <http://xmlns.com/foaf/0.1/made> <http://example.org/#the-mona-lisa>.
+<http://viaf.org/viaf/24604287/> <http://xmlns.com/foaf/0.1/name> "Leonardo da Vinci" .
+<http://www.wikidata.org/entity/Q12418> <http://example.org/#on-display-in> <http://example.org/#the-louvre>.
+<http://example.org/bob#me> <http://example.org/#likes> <http://example.org/#the-mona-lisa>.
+ </pre>
- <p><a href="http://www.w3.org/TR/turtle/">Turtle</a> provides a convenient syntax for RDF graphs, introducing numerous
- syntax shortcuts when compared with N-Triples, such as the support for namespaces, lists and shorthands for data-typed
- literals. Turtle provides a good trade-off between ease of writing, ease of parsing and readability.</p>
+ <p>N-Triples is often used for RDF examples, exchanging large RDF datasets, and processing large RDF graphs
+ with line-oriented text processing tools.</p>
- <pre>
+ </section>
+
+ <section id="subsection-turtle">
+
+ <h3>Turtle</h3>
+
+ <p><a href="http://www.w3.org/TR/turtle/">Turtle</a> provides a convenient syntax for RDF graphs, introducing numerous
+ syntax shortcuts when compared with N-Triples, such as the support for namespaces, lists and shorthands for data-typed
+ literals. Turtle provides a good trade-off between ease of writing, ease of parsing and readability.</p>
+
+ <pre>
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix schema: <http://schema.org/> .
@prefix : <http://example.org/#> .
-:bob
+:me
a foaf:Person ;
foaf:knows :alice ;
schema:birthDate "1990-07-04"^^xsd:date ;
@@ -397,17 +393,21 @@
foaf:made :the-mona-lisa .
:the-mona-lisa
:on-display-in :the-louvre .
- </pre>
-
- <h3>JSON-LD</h3>
+ </pre>
- <p><a href="http://www.w3.org/TR/json-ld-syntax/">JSON-LD</a> provides a lightweight JSON syntax for RDF graphs and datasets.
- JSON-LD can be used to transform JSON documents to RDF with minimal changes, therefore bringing the benefits of RDF to the JSON
- world. Those benefits include universal identifiers for JSON objects, a mechanism in which a JSON document can refer to
- an object described in another JSON document elsewhere on the Web, as well as datatype and language handling.
- </p>
+ </section>
- <pre>
+ <section id="subsection-jsonld">
+
+ <h3>JSON-LD</h3>
+
+ <p><a href="http://www.w3.org/TR/json-ld-syntax/">JSON-LD</a> provides a lightweight JSON syntax for RDF graphs and datasets.
+ JSON-LD can be used to transform JSON documents to RDF with minimal changes, therefore bringing the benefits of RDF to the JSON
+ world. Those benefits include universal identifiers for JSON objects, a mechanism in which a JSON document can refer to
+ an object described in another JSON document elsewhere on the Web, as well as datatype and language handling.
+ </p>
+
+ <pre>
{
"@context": {
"foaf": "http://xmlns.com/foaf/0.1/",
@@ -433,15 +433,86 @@
}
}
}
- </pre>
-
- <h3>RDF/XML</h3>
+ </pre>
- <p>...</p>
+ </section>
- <pre>
+ <section id="subsection-rdfxml">
- </pre>
+ <h3>RDF/XML</h3>
+
+ <p>...</p>
+
+ <pre>
+
+ </pre>
+
+ </section>
+
+</section>
+
+<section id="section-dataset-syntax">
+
+ <h2>Writing RDF datasets</h2>
+
+ <p>Among the previous syntaxes, only JSON-LD provides support for RDF datasets (collections of graphs).
+ There are two syntaxes dedicated to serializing and exchanging RDF datasets:
+ <a href="https://dvcs.w3.org/hg/rdf/raw-file/default/nquads/index.html">N-Quads</a> and
+ <a href="https://dvcs.w3.org/hg/rdf/raw-file/default/trig/index.html">TriG</a>, which we summarize below.</p>
+
+ <section id="subsection-nquads">
+
+ <h3>N-Quads</h3>
+
+ <p><a href="https://dvcs.w3.org/hg/rdf/raw-file/default/nquads/index.html">N-Quads</a> is
+ a simple extension to N-Triples enabling the exchange of RDF datasets. N-Quads adds a fourth
+ element to each line, capturing the graph IRI of the triple described on that line. For example,
+ we could write the first triple of our N-Triples example as follows.</p>
+
+ <pre>
+<http://example.org/#bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <http://example.org/#graph-1>.
+ </pre>
+
+ </section>
+
+ <section id="subsection-trig">
+
+ <h3>TriG</h3>
+
+ <p><a href="https://dvcs.w3.org/hg/rdf/raw-file/default/trig/index.html">TriG</a>
+ is an extension to the Turtle syntax enabling the exchange of RDF datasets. For example
+ the "Mona Lisa" example graph could be written as follows.</p>
+
+ <pre>
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix schema: <http://schema.org/> .
+@prefix : <http://example.org/bob#> .
+
+<http://example.org/bob>
+ {
+ :bob
+ a foaf:Person ;
+ foaf:knows :alice ;
+ schema:birthDate "1990-07-04"^^xsd:date ;
+ :likes :the-mona-lisa .
+ :alice
+ a foaf:Person .
+ }
+
+<http://data.europeana.eu/data/item/08501/BFEDA8C5F46930228355F50FA9F5298D982DD6B8>
+ {
+ :da-vinci
+ a foaf:Person ;
+ foaf:made :the-mona-lisa .
+ :the-mona-lisa
+ :on-display-in :the-louvre .
+ }
+
+ </pre>
+
+ </section>
+
</section>