--- a/rdf-primer/index.html Mon Nov 11 19:10:49 2013 +0100
+++ b/rdf-primer/index.html Mon Nov 11 22:29:42 2013 +0100
@@ -218,7 +218,7 @@
<section id="subsection-statement">
- <h3>RDF Statement</h3>
+ <h3>Triples</h3>
<p>RDF allows us to make statements about resources.
The format of these statements is simple. It always
@@ -230,7 +230,10 @@
make a statement about. The <strong>predicate</strong> represents
the feature we want to make a statement about. The
<strong>object</strong> represents the value of the feature
- for this subject. Informally speaking, RDF allows us to make
+ for this subject.Because RDF statements consist of three elements they are called
+ <strong>triples</strong>.</p>
+
+ <p>Informally speaking, RDF allows us to make
statements of the form:</p>
<pre class="example">
@@ -243,8 +246,7 @@
<This video document> <is about> <the Mona Lisa>
</pre>
- <p>Because RDF statements consist of three elements they are called
- <strong>triples</strong>. Resources typically occur in multiple
+ <p>Resources typically occur in multiple
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
@@ -417,41 +419,18 @@
We give an overview of these various syntaxes below, and illustrate
them using the example above.</p>
- <section id="subsection-ntriples">
-
- <h3>N-Triples</h3>
-
- <p>N-Triples [[N-TRIPLES]]
- 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#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://example.org/bob#me> <http://xmlns.com/foaf/0.1/topic_interest> <http://www.wikidata.org/entity/Q12418>.
-<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/name> "Leonardo da Vinci".
-<http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/creator> <http://viaf.org/viaf/24604287/>.
-<http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619> <http://purl.org/dc/terms/subject> <http://www.wikidata.org/entity/Q12418>.
- </pre>
-
- <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>
-
- </section>
-
<section id="subsection-turtle">
<h3>Turtle</h3>
<p>Turtle [[TURTLE]] 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. Our example can be represented in
- Turtle as follows.</p>
+ syntax shortcuts, such as the
+ support for namespaces, lists and shorthands for datatyped
+ literals. Turtle provides a good trade-off between ease of
+ writing, ease of parsing and readability. Our single-graph example can be
+ represented in Turtle as follows.</p>
- <pre>
+ <pre class="example" id="turtle-example">
@base <http://example.org/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@@ -478,18 +457,167 @@
</section>
+ <section id="subsection-trig">
+
+ <h3>TriG</h3>
+
+ <p>TriG [[TRIG]] is an extension to the Turtle syntax enabling
+ the exchange of multiple graphs in the form of RDF datasets. For example we could write
+ our multi-graph example in TriG as follows.</p>
+
+ <pre class="example" id="trig-example">
+@base <http://example.org/> .
+@prefix foaf: <http://xmlns.com/foaf/0.1/> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
+@prefix schema: <http://schema.org/> .
+@prefix dcterms: <http://purl.org/dc/terms/> .
+@prefix wd: <http://www.wikidata.org/entity/> .
+
+<http://example.org/bob>
+ {
+ <bob#me>
+ a foaf:Person ;
+ foaf:knows <alice#me> ;
+ schema:birthDate "1990-07-04"^^xsd:date ;
+ foaf:topic_interest wd:Q12418 .
+ }
+
+<https://www.wikidata.org/wiki/Special:EntityData/Q12418>
+ {
+ <http://viaf.org/viaf/24604287/>
+ a foaf:Person ;
+ foaf:name "Leonardo da Vinci" .
+
+ wd:Q12418
+ dcterms:creator <http://viaf.org/viaf/24604287/> .
+
+ <http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619>
+ dcterms:subject wd:Q12418 .
+ }
+ </pre>
+
+ </section>
+
+ <section id="subsection-other-syntaxes">
+
+ <h3>Other concrete syntaxes for RDF</h3>
+
+ <dl>
+ <dt>RDFa</dt>
+ <dd>RDFa [[RDFA-PRIMER]] can be used to embed RDF data within
+ HTML documents. @@ extend, <a href="#rdfa-example">example</a></dd>
+
+ <dt>JSON-LD</dt>
+ <dd>JSON-LD [[JSON-LD]] provides a 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. These 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. JSON-LD
+ [[JSON-LD]] also provides a way to serialize RDF datasets
+ through the use of the <code>@graph</code> keyword.
+ We could write our dataset example in JSON-LD as follows.</dd>
+
+ <dt>N-Triples</dt>
+ <dd>N-Triples [[N-TRIPLES]]
+ 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. N-Triples is often used for RDF examples,
+ exchanging large RDF datasets, and processing large RDF graphs
+ with line-oriented text processing tools.</dd>
+
+ <dt>N-Quads</dt>
+ <dd>N-Quads [[N-QUADS]] 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 split our "Mona Lisa" example in two graphs <a
+ href="#subsection-graphs">as we did above</a>
+ and serialize the resulting dataset in N-Quads as follows.</dd>
+
+ <dt>RDF/XML</dt>
+ <dd>RDF/XML [[RDF-SYNTAX-GRAMMAR]] provides an XML syntax for RDF
+ graphs. RDF/XML was the only normative syntax for RDF before the
+ RDF 1.1 set of recommendations introduced multiple
+ syntaxes for RDF graphs. Our example can be represented in RDF/XML as follows.</dd>
+ </dl>
+
+
+
+
+<section id="section-vocabulary">
+
+ <h2>RDF Data and Vocabularies</h2>
+
+ <p></p>
+
+</section>
+
+<section id="section-semantics">
+
+ <h2>RDF Graphs and what you can do with them</h2>
+
+ <p></p>
+
+</section>
+
+
+<section id="section-roadmap">
+ <h2>Document roadmap</h2>
+</section>
+
+
+
+
+<section id="section-syntaxes" class="appendix">
+
+<p>In Sec. <a href="#section-graph-syntax">"Writing RDF Graphs"</a> the
+different concrete syntaxes of RDF are briefly described. Examples are
+given only of the Turtle and TriG syntax. This appendix lists
+corresponding examples for the other syntaxes listed. The
+single-graph examples encode the same information as the <a href="#turtle-example">Turtle
+example</a>; the mutiple-graphs examples encode the same information as the <a href="#trig-example">Trig
+example</a>. </p>
+
+
+ <section id="subsection-rdfa">
+
+ <h3>RDFa</h3>
+
+ <p>Single-graph example:</p>
+
+ <pre class="example" id="rdfa-example">
+<div prefix="
+ rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
+ foaf: http://xmlns.com/foaf/0.1/
+ wd: http://www.wikidata.org/entity/
+ dcterms: http://purl.org/dc/terms/
+ xsd: http://www.w3.org/2001/XMLSchema#">
+ <div typeof="foaf:Person" about="http://example.org/bob#me">
+ <p>
+ Bob knows <a rel="foaf:knows" href="http://example.org/alice#me">Alice</a>
+ and was born on the <span property="schema:birthDate" datatype="xsd:date">1990-07-04</span>.
+ </p>
+ <p>
+ Bob is interested in <a rel="foaf:topic_interest" resource="wd:Q12418">the Mona Lisa</a>.
+ </p>
+ <div about="wd:Q12418">
+ The Mona Lisa was painted by <a rel="dcterms:creator" typeof="foaf:Person" href="http://viaf.org/viaf/24604287/"><span property="foaf:name">Leonardo da Vinci</span></a>
+ and is the subject of this <a rev="dcterms:subject" href="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">video document</a>.
+ </div>
+ </div>
+</div>
+ </pre>
+
+ </section>
+
<section id="subsection-jsonld">
<h3>JSON-LD</h3>
- <p>JSON-LD [[JSON-LD]] provides a 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. These 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. Our example
- can be represented in JSON-LD as follows.
- </p>
+ Single-graph example:
- <pre>
+ <pre class="example" id="json-ld-example-signle">
{
"@context": {
"foaf": "http://xmlns.com/foaf/0.1/",
@@ -523,158 +651,9 @@
}
</pre>
- </section>
-
- <section id="subsection-rdfa">
-
- <h3>RDFa</h3>
-
- <p>RDFa [[RDFA-PRIMER]] can be used to embed RDF data within HTML documents. Our example
- can be represented in RDFa as follows.
- </p>
-
- <pre>
-<div prefix="
- rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
- foaf: http://xmlns.com/foaf/0.1/
- wd: http://www.wikidata.org/entity/
- dcterms: http://purl.org/dc/terms/
- xsd: http://www.w3.org/2001/XMLSchema#">
- <div typeof="foaf:Person" about="http://example.org/bob#me">
- <p>
- Bob knows <a rel="foaf:knows" href="http://example.org/alice#me">Alice</a>
- and was born on the <span property="schema:birthDate" datatype="xsd:date">1990-07-04</span>.
- </p>
- <p>
- Bob is interested in <a rel="foaf:topic_interest" resource="wd:Q12418">the Mona Lisa</a>.
- </p>
- <div about="wd:Q12418">
- The Mona Lisa was painted by <a rel="dcterms:creator" typeof="foaf:Person" href="http://viaf.org/viaf/24604287/"><span property="foaf:name">Leonardo da Vinci</span></a>
- and is the subject of this <a rev="dcterms:subject" href="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">video document</a>.
- </div>
- </div>
-</div>
- </pre>
-
- </section>
-
- <section id="subsection-rdfxml">
-
- <h3>RDF/XML</h3>
-
- <p>RDF/XML [[RDF-SYNTAX-GRAMMAR]] provides an XML syntax for RDF
- graphs. RDF/XML was the only normative syntax for RDF before the RDF 1.1 set of recommendations introduced multiple
- syntaxes for RDF graphs. Our example can be represented in RDF/XML as follows.</p>
-
- <pre>
-<?xml version="1.0" encoding="utf-8"?>
-<rdf:RDF
- xmlns:dcterms="http://purl.org/dc/terms/"
- xmlns:foaf="http://xmlns.com/foaf/0.1/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:schema="http://schema.org/"
- xmlns:wd="http://www.wikidata.org/entity/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
- <foaf:Person rdf:about="http://example.org/bob#me">
- <schema:birthDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">1990-07-04</schema:birthDate>
- <foaf:knows rdf:resource="http://example.org/alice#me"/>
- <foaf:topic_interest rdf:resource="http://www.wikidata.org/entity/Q12418"/>
- </foaf:Person>
- <foaf:Person rdf:about="http://viaf.org/viaf/24604287/">
- <foaf:name>Leonardo da Vinci</foaf:name>
- </foaf:Person>
- <rdf:Description rdf:about="http://www.wikidata.org/entity/Q12418">
- <dcterms:creator rdf:resource="http://viaf.org/viaf/24604287/"/>
- </rdf:Description>
- <rdf:Description rdf:about="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">
- <dcterms:subject rdf:resource="http://www.wikidata.org/entity/Q12418"/>
- </rdf:Description>
-</rdf:RDF>
- </pre>
-
- </section>
-
-</section>
-
-<section id="section-dataset-syntax">
+ <p>Multiple-graphs example:</p>
- <h2>Writing RDF datasets</h2>
-
- <p>Syntaxes are also available to serialize and exchange RDF datasets (collections of graphs).</p>
-
- <section id="subsection-nquads">
-
- <h3>N-Quads</h3>
-
- <p>N-Quads [[N-QUADS]] 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 split our "Mona Lisa" example in two graphs <a href="#subsection-graphs">as we did above</a>
- and serialize the resulting dataset in N-Quads as follows.</p>
-
- <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/bob> .
-<http://example.org/bob#me> <http://xmlns.com/foaf/0.1/knows> <http://example.org/alice#me> <http://example.org/bob> .
-<http://example.org/bob#me> <http://schema.org/birthDate> "1990-07-04"^^<http://www.w3.org/2001/XMLSchema#date> <http://example.org/bob> .
-<http://example.org/bob#me> <http://xmlns.com/foaf/0.1/topic_interest> <http://www.wikidata.org/entity/Q12418> <http://example.org/bob> .
-<http://viaf.org/viaf/24604287/> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .
-<http://viaf.org/viaf/24604287/> <http://xmlns.com/foaf/0.1/name> "Leonardo da Vinci" <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .
-<http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/creator> <http://viaf.org/viaf/24604287/> <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .
-<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> .
- </pre>
-
- </section>
-
- <section id="subsection-trig">
-
- <h3>TriG</h3>
-
- <p>TriG [[TRIG]]
- is an extension to the Turtle syntax enabling the exchange of RDF datasets. For example we could write
- our example in TriG as follows.</p>
-
- <pre>
-@base <http://example.org/> .
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix schema: <http://schema.org/> .
-@prefix dcterms: <http://purl.org/dc/terms/> .
-@prefix wd: <http://www.wikidata.org/entity/> .
-
-<http://example.org/bob>
- {
- <bob#me>
- a foaf:Person ;
- foaf:knows <alice#me> ;
- schema:birthDate "1990-07-04"^^xsd:date ;
- foaf:topic_interest wd:Q12418 .
- }
-
-<https://www.wikidata.org/wiki/Special:EntityData/Q12418>
- {
- <http://viaf.org/viaf/24604287/>
- a foaf:Person ;
- foaf:name "Leonardo da Vinci" .
-
- wd:Q12418
- dcterms:creator <http://viaf.org/viaf/24604287/> .
-
- <http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619>
- dcterms:subject wd:Q12418 .
- }
- </pre>
-
- </section>
-
- <section id="subsection-jsonld-dataset">
-
- <h3>JSON-LD</h3>
-
- <p>JSON-LD [[JSON-LD]] also provides a way to serialize RDF datasets
- through the use of the <code>@graph</code> keyword.
- We could write our dataset example in JSON-LD as follows.</p>
-
- <pre>
+ <pre class="example" id="json-ld-example-multiple">
{
"@context": {
"foaf": "http://xmlns.com/foaf/0.1/",
@@ -724,36 +703,88 @@
</section>
-</section>
-<section id="section-vocabulary">
+<section id="subsection-ntriples">
- <h2>RDF Data and Vocabularies</h2>
+ <h3>N-Triples</h3>
- <p></p>
+ <p>Single-graph example: </p>
+
+ <pre class="example" id="n-triples-example">
+<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#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://example.org/bob#me> <http://xmlns.com/foaf/0.1/topic_interest> <http://www.wikidata.org/entity/Q12418>.
+<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/name> "Leonardo da Vinci".
+<http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/creator> <http://viaf.org/viaf/24604287/>.
+<http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619> <http://purl.org/dc/terms/subject> <http://www.wikidata.org/entity/Q12418>.
+ </pre>
+
+ </section>
+
+ <section id="subsection-nquads">
+
+ <h3>N-Quads</h3>
+
+ <pre class="example" id="n-quads-example">
+<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> .
+<http://example.org/bob#me> <http://xmlns.com/foaf/0.1/knows> <http://example.org/alice#me> <http://example.org/bob> .
+<http://example.org/bob#me> <http://schema.org/birthDate> "1990-07-04"^^<http://www.w3.org/2001/XMLSchema#date> <http://example.org/bob> .
+<http://example.org/bob#me> <http://xmlns.com/foaf/0.1/topic_interest> <http://www.wikidata.org/entity/Q12418> <http://example.org/bob> .
+<http://viaf.org/viaf/24604287/> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .
+<http://viaf.org/viaf/24604287/> <http://xmlns.com/foaf/0.1/name> "Leonardo da Vinci" <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .
+<http://www.wikidata.org/entity/Q12418> <http://purl.org/dc/terms/creator> <http://viaf.org/viaf/24604287/> <https://www.wikidata.org/wiki/Special:EntityData/Q12418> .
+<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> .
+ </pre>
+
+ </section>
+
+ <section id="subsection-rdf-xml">
+
+ <h3>RDF/XML</h3>
+
+ <p>Single-graph example:</p>
+
+ <pre class="example" id="rdf-xml-example">
+<?xml version="1.0" encoding="utf-8"?>
+<rdf:RDF
+ xmlns:dcterms="http://purl.org/dc/terms/"
+ xmlns:foaf="http://xmlns.com/foaf/0.1/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:schema="http://schema.org/"
+ xmlns:wd="http://www.wikidata.org/entity/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
+ <foaf:Person rdf:about="http://example.org/bob#me">
+ <schema:birthDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">1990-07-04</schema:birthDate>
+ <foaf:knows rdf:resource="http://example.org/alice#me"/>
+ <foaf:topic_interest rdf:resource="http://www.wikidata.org/entity/Q12418"/>
+ </foaf:Person>
+ <foaf:Person rdf:about="http://viaf.org/viaf/24604287/">
+ <foaf:name>Leonardo da Vinci</foaf:name>
+ </foaf:Person>
+ <rdf:Description rdf:about="http://www.wikidata.org/entity/Q12418">
+ <dcterms:creator rdf:resource="http://viaf.org/viaf/24604287/"/>
+ </rdf:Description>
+ <rdf:Description rdf:about="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">
+ <dcterms:subject rdf:resource="http://www.wikidata.org/entity/Q12418"/>
+ </rdf:Description>
+</rdf:RDF>
+ </pre>
</section>
-<section id="section-semantics">
+</section>
+
+<section class="appendix" id="changes">
+ <h2>Changes from RDF 2004</h2>
- <h2>RDF Graphs and what you can do with them</h2>
-
- <p></p>
-
+ <ul>
+ <li>..</li>
+ </ul>
</section>
-<section id="section=multiple-graphs">
-
- <h2>Multiple graphs</h2>
-
-</section>
-
-
-<section id="section-roadmap">
- <h2>Document roadmap</h2>
-</section>
-
-<section id="section-Acknowledgments">
+ <section id="section-Acknowledgments" class-"appendix">
<h2>Acknowledgments</h2>
<p class="issue">This section does not yet list those who made
@@ -777,15 +808,6 @@
</section>
-<section class="appendix informative" id="changes">
- <h2>Changes from RDF 2004</h2>
-
- <ul>
- <li>..</li>
- </ul>
-</section>
-
-
<section id="references"></section>
</body>