Work in progress - still using Europeana examples
authorYves Raimond <yves.raimond@bbc.co.uk>
Tue, 13 Aug 2013 18:55:54 +0100
changeset 987 5814908c5da9
parent 986 6a55fce65fc3
child 988 ea07b2419247
Work in progress - still using Europeana examples
rdf-primer/index.html
--- 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>
       &lt;Bob&gt; &lt;is a friend of&gt; &lt;Alice&gt;.
       &lt;Bob&gt; &lt;is born on&gt; &lt;the 4th of July 1990&gt;. 
-      &lt;Bob&gt; &lt;likes&gt; &lt;La Joconde&gt;.
-      &lt;Leonardo da Vinci&gt; &lt;is the creator of&gt; &lt;La Joconde&gt;.
-      &lt;La Joconde&gt; &lt;is on display in&gt; &lt;the Louvre&gt;.       
+      &lt;Bob&gt; &lt;likes&gt; &lt;the Mona Lisa&gt;.
+      &lt;Leonardo da Vinci&gt; &lt;is the creator of&gt; &lt;the Mona Lisa&gt;.
+      &lt;the Mona Lisa&gt; &lt;is on display in&gt; &lt;the Louvre&gt;.       
     </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>
         &lt;Bob&gt; &lt;is a friend of&gt; &lt;Alice&gt;.
         &lt;Bob&gt; &lt;is born on&gt; &lt;the 4th of July 1990&gt;.
-        &lt;Bob&gt; &lt;likes&gt; &lt;La Joconde&gt;.
+        &lt;Bob&gt; &lt;likes&gt; &lt;the Mona Lisa&gt;.
       </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>
-        &lt;Leonardo da Vinci&gt; &lt;is the creator of&gt; &lt;La Joconde&gt;.
-        &lt;La Joconde&gt; &lt;is on display in&gt; &lt;the Louvre&gt;.
+        &lt;Leonardo da Vinci&gt; &lt;is the creator of&gt; &lt;the Mona Lisa&gt;.
+        &lt;The Mona Lisa&gt; &lt;is on display in&gt; &lt;the Louvre&gt;.
       </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>
-&lt;http://example.org/#bob&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/Person&gt;.
-&lt;http://example.org/#alice&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/Person&gt;.
-&lt;http://example.org/#bob&gt; &lt;http://xmlns.com/foaf/0.1/knows&gt; &lt;http://example.org/#alice&gt;.
-&lt;http://example.org/#bob&gt; &lt;http://schema.org/birthDate&gt; "1990-07-04"^^&lt;http://www.w3.org/2001/XMLSchema#date&gt;.
-&lt;http://example.org/#da-vinci&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/Person&gt;.
-&lt;http://example.org/#da-vinci&gt; &lt;http://xmlns.com/foaf/0.1/made&gt; &lt;http://example.org/#the-mona-lisa&gt;.
-&lt;http://example.org/#the-mona-lisa&gt; &lt;http://example.org/#on-display-in&gt; &lt;http://example.org/#the-louvre&gt;.
-&lt;http://example.org/#bob&gt; &lt;http://example.org/#likes&gt; &lt;http://example.org/#the-mona-lisa&gt;.
-    </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>
-&lt;http://example.org/#bob&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/Person&gt; &lt;http://example.org/#graph-1&gt;.
-    </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>
+&lt;http://example.org/bob#me&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/Person&gt;.
+&lt;http://example.org/alice#me&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/Person&gt;.
+&lt;http://example.org/bob#me&gt; &lt;http://xmlns.com/foaf/0.1/knows&gt; &lt;http://example.org/alice#me&gt;.
+&lt;http://example.org/bob#me&gt; &lt;http://schema.org/birthDate&gt; "1990-07-04"^^&lt;http://www.w3.org/2001/XMLSchema#date&gt;.
+&lt;http://viaf.org/viaf/24604287/&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/Person&gt;.
+&lt;http://viaf.org/viaf/24604287/&gt; &lt;http://xmlns.com/foaf/0.1/made&gt; &lt;http://example.org/#the-mona-lisa&gt;.
+&lt;http://viaf.org/viaf/24604287/&gt; &lt;http://xmlns.com/foaf/0.1/name&gt; "Leonardo da Vinci" .
+&lt;http://www.wikidata.org/entity/Q12418&gt; &lt;http://example.org/#on-display-in&gt; &lt;http://example.org/#the-louvre&gt;.
+&lt;http://example.org/bob#me&gt; &lt;http://example.org/#likes&gt; &lt;http://example.org/#the-mona-lisa&gt;.
+      </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: &lt;http://xmlns.com/foaf/0.1/&gt; .
 @prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .
 @prefix schema: &lt;http://schema.org/&gt; .
 @prefix : &lt;http://example.org/#&gt; .
 
-: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>
+&lt;http://example.org/#bob&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/Person&gt; &lt;http://example.org/#graph-1&gt;.
+      </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: &lt;http://xmlns.com/foaf/0.1/&gt; .
+@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .
+@prefix schema: &lt;http://schema.org/&gt; .
+@prefix : &lt;http://example.org/bob#&gt; .
+
+&lt;http://example.org/bob&gt;
+  {
+    :bob
+      a foaf:Person ;
+      foaf:knows :alice ;
+      schema:birthDate "1990-07-04"^^xsd:date ;
+      :likes :the-mona-lisa .
+    :alice
+      a foaf:Person .
+    }
+
+&lt;http://data.europeana.eu/data/item/08501/BFEDA8C5F46930228355F50FA9F5298D982DD6B8&gt;
+  {
+    :da-vinci
+      a foaf:Person ;
+      foaf:made :the-mona-lisa .
+    :the-mona-lisa
+      :on-display-in :the-louvre .
+  }
+
+      </pre>
+
+    </section>
+
 
 </section>