--- a/rdf-primer/index.html Sun Feb 16 18:35:27 2014 +0100
+++ b/rdf-primer/index.html Sun Feb 16 23:02:25 2014 +0100
@@ -1135,18 +1135,15 @@
<h2>Examples of RDF syntaxes</h2>
<p>In <a href="#section-graph-syntax">Sec. 5</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 graph as in
-<a href="#fig4">Fig. 4</a>;
-the mutiple-graphs examples encode the same graph as in
-<a href="#fig5">Fig. 5</a>. </p>
+different concrete syntaxes of RDF are briefly described.
+This appendix lists
+corresponding examples for two other RDF syntaxes, namely RDFa and
+RDF/XML. Also, more elaborate examples of JSON-LD are included.</p>
<section id="subsection-rdfa">
<h3>RDFa</h3>
-<p>RDFa [[RDFA-PRIMER]] is an RDF syntax for encoding RDF
+<p>RDFa is an RDF syntax for encoding RDF
triples in an HTML document. The HTML example below encodes the
RDF graph depicted in <a href="#fig4">Fig. 4</a>:</p>
@@ -1154,45 +1151,47 @@
01 <div about="http://example.org/bob#me" typeof="http://xmlns.com/foaf/0.1/Person">
02 <p>
03 Bob knows <a rel="http://xmlns.com/foaf/0.1/knows" href="http://example.org/alice#me">Alice</a>
-04 and was born on the
-05 <span property="http://schema.org/birthDate" datatype="http://www.w3.org/2001/XMLSchema#date">1990-07-04</span>.
+04 and was born on the <span property="http://schema.org/birthDate"
+05 datatype="http://www.w3.org/2001/XMLSchema#date">1990-07-04</span>.
06 </p>
07 <p>
-08 Bob is interested in <a rel="http://xmlns.com/foaf/0.1/topic_interest" href="http://www.wikidata.org/entity/Q12418">the Mona Lisa</a>.
-09 </p>
-10 </div>
-11 <div about="http://www.wikidata.org/entity/Q12418">
-12 <p>
-13 The <span property="http://purl.org/dc/terms/title">Mona Lisa</span>
-14 was painted by
-15 <a rel="http://purl.org/dc/terms/creator" href="http://dbpedia.org/resource/Leonardo_da_Vinci">Leonardo da Vinci</a>
-16 and is the subject of the video
-17 <a rev="http://purl.org/dc/terms/subject" href="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">'La Joconde à Washington'</a>.
-18 </p>
-19 </div>
- </pre>
+08 Bob is interested in <a rel="http://xmlns.com/foaf/0.1/topic_interest"
+09 href="http://www.wikidata.org/entity/Q12418">the Mona Lisa</a>.
+10 </p>
+11 </div>
+12 <div about="http://www.wikidata.org/entity/Q12418">
+13 <p>
+14 The <span property="http://purl.org/dc/terms/title">Mona Lisa</span>
+15 was painted by <a rel="http://purl.org/dc/terms/creator"
+16 href="http://dbpedia.org/resource/Leonardo_da_Vinci">Leonardo da Vinci</a>
+17 and is the subject of the video <a rev="http://purl.org/dc/terms/subject"
+18 href="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">
+19 'La Joconde à Washington'</a>.
+20 </p>
+21 </div>
+</pre>
<p>RDFa introduces a number special attributes that enable the
specification of triples within HTML. For example, the <code>div</code> elements
-in lines 1 and 11 have an <code>about</code>
+in lines 1 and 12 have an <code>about</code>
attribute, specifying the IRI about which RDF statements can be made within this
-block. In line 3 we see a <code>rel</code> ("relation") attribute that an RDFa
--aware processor should interpret as an RDF property IRI. The
+block. In line 3 we see a <code>rel</code> ("relation") attribute that
+an RDFa-aware processor should interpret as an RDF property IRI. The
<code>href</code> attribute value is the object of the triple. Th
result is the triple: <p>
-<p class="example">
+<pre class="example">
<http://example.org/bob#me> <http://xmlns.com/foaf/0.1/knows> <http://example.org/alice#me> .
-</p>
+</pre>
<p>The <code>rel</code> is used in cases where the object is an
IRI. Two more examples are found in lines 8 and 15. If the object of
the triple is a literal, then RDFa uses the
<code>property</code> attribute to specify the RDF property IRI. Lines
-5 and 13 contain examples of such triples. A <code>datatype</code>
+4-5 and 14 contain examples of such triples. A <code>datatype</code>
attribute is used to indicate the datatype of the literal (line 5). If
no datatype or language tag is specified the literal is assumed to
-have the datatype <code>xsd:string</code> (line 13). </p>
+have the datatype <code>xsd:string</code> (line 14). </p>
<p>Two more RDFa attributes appear in the example. The
<code>typeof</code> attribute in line 1 is similar to the Turtle
@@ -1202,62 +1201,74 @@
order: the "about" IRI is the object of the triple; the "href"
attribute specifies the subject. </p>
-<p>The RDFa Primer provides detailed information about RDFa [[RDFA-PRIMER]]. Below shows the HTML rendered from the example:</p>
-
-<blockquote>
-<div about="http://example.org/bob#me" typeof="http://xmlns.com/foaf/0.1/Person">
- <p>
- Bob knows <a rel="http://xmlns.com/foaf/0.1/knows" href="http://example.org/alice#me">Alice</a>
- and was born on the
- <span property="http://schema.org/birthDate" datatype="http://www.w3.org/2001/XMLSchema#date">1990-07-04</span>.
- </p>
- <p>
- Bob is interested in <a rel="http://xmlns.com/foaf/0.1/topic_interest" href="http://www.wikidata.org/entity/Q12418">the Mona Lisa</a>.
- </p>
- </div>
- <div about="http://www.wikidata.org/entity/Q12418">
- <p>
- The <span property="http://purl.org/dc/terms/title">Mona Lisa</span>
- was painted by
- <a rel="http://purl.org/dc/terms/creator" href="http://dbpedia.org/resource/Leonardo_da_Vinci">Leonardo da Vinci</a>
- and is the subject of the video
- <a rev="http://purl.org/dc/terms/subject" href="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">'La Joconde à Washington'</a>.
- </p>
- </div>
-</blockquote>
-
+<p>For more information consult the RDFa Primer [[RDFA-PRIMER]] for detailed information about RDFa. </p>
-<!-- <p>Single-graph example:</p>
- <pre class="example" id="rdfa-example">
-01 <div prefix="
-02 rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
-03 foaf: http://xmlns.com/foaf/0.1/
-04 wd: http://www.wikidata.org/entity/
-05 dcterms: http://purl.org/dc/terms/
-06 xsd: http://www.w3.org/2001/XMLSchema#">
-07 <div typeof="foaf:Person" about="http://example.org/bob#me">
-08 <p>
-09 Bob knows <a rel="foaf:knows" href="http://example.org/alice#me">Alice</a>
-10 and was born on the <span property="schema:birthDate" datatype="xsd:date">1990-07-04</span>.
-11 </p>
-12 <p>
-13 Bob is interested in <a rel="foaf:topic_interest" resource="wd:Q12418">the Mona Lisa</a>.
-14 </p>
-15 <div about="wd:Q12418">
-16 The <span property="dcterms:title">Mona Lisa</span> was painted by <a rel="dcterms:creator" href="http://dbpedia.org/resource/Leonardo_da_Vinci">Leonardo da Vinci</a>
-17 and is the subject of the video <a rev="dcterms:subject" href="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">'La Joconde à Washington'</a>.
-18 </div>
-19 </div>
-20 </div>
- </pre>
--->
+</section>
-
- </section>
+<section id="subsection-rdf-xml">
- <section id="subsection-jsonld">
+<h3>RDF/XML</h3>
- <h3>JSON-LD</h3>
+<p>RDF/XML [[RDF-XML]] is an XML syntax for RDFD. When RDF was original developed in the late 1990s, RDF/XML was its only syntax for RDF. RDF/XML. 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>
+
+<p>In RDF/XML RDF triples are specified within an XML element
+<code>rdf:RDF</code> (lines 2 and 20). The attributes of the
+<code>rdf:RDF</code> start tag (lines 3-6) provide a shorthand for writing down
+names of XML elements and attributes. The XML element
+<code>rdf;Description</code> (short for
+<code>http://www.w3.org/1999/02/22-rdf-syntax-ns#Description</code>)
+is used to define sets of triples, in which the subject is the IRI
+specified in the <code>about</code> attribute. The first description
+block (line 7-12) has four sub-elements. The name of the subelement is
+the property IRI, e.g., <code>rdf:type</code> (line 8). Here, each
+subelement represents one triple. In case the object is also an IRI
+the property subelement has no content and
+the object IRI is specified using the <code>rdf;resource</code>
+attribute (lines 8, 10-11, 15 and 18). In case the object of the
+triple is a literal the literal value is given as content of the
+property element (lines 9 and 14). The datatype is specified as
+attribute of the property element (line 9). If the datatype is
+omitted (line 14) and no language tag is present the literal is
+considered to have the default datatype <code>xsd:string</code>.
+
+<p>The example shows the baseline syntax; please consult the RDF/XML
+document [[RDF-XML for a more in-depth treatment of the syntax. It
+might seem strange that the attribute values contain full IRIs,
+despite the fact that for some of these namespace prefixes were
+defined. This is because these prefixes can only be used for XML
+element and attribute names. In practice, developers use XML entity
+declarations to provide also shorthands for attribute vales. </p>
+
+</section>
+
+
+<section id="subsection-jsonld">
+
+<h3>JSON-LD</h3>
Single-graph example:
@@ -1464,38 +1475,9 @@
</section>
- <section id="subsection-rdf-xml">
-
- <h3>RDF/XML</h3>
-
- <p>Single-graph example:</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 xmlns:wd="http://www.wikidata.org/entity/"
-08 xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
-09 <foaf:Person rdf:about="http://example.org/bob#me">
-10 <schema:birthDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">1990-07-04</schema:birthDate>
-11 <foaf:knows rdf:resource="http://example.org/alice#me"/>
-12 <foaf:topic_interest rdf:resource="http://www.wikidata.org/entity/Q12418"/>
-13 </foaf:Person>
-14 <rdf:Description rdf:about="http://www.wikidata.org/entity/Q12418">
-15 <dcterms:title>Mona Lisa</dcterms:title>
-16 <dcterms:creator rdf:resource="http://dbpedia.org/resource/Leonardo_da_Vinci"/>
-17 </rdf:Description>
-18 <rdf:Description rdf:about="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619">
-19 <dcterms:subject rdf:resource="http://www.wikidata.org/entity/Q12418"/>
-20 </rdf:Description>
-21 </rdf:RDF>
- </pre>
- </section>
- </section>
+</section>
</body>