RDFa example updated
authorGuus Schreiber <guus.schreiber@vu.nl>
Fri, 21 Feb 2014 12:24:32 +0100
changeset 1990 7046e28cdf2f
parent 1989 47a3733f4058
child 1991 7ef1b1896c2f
RDFa example updated
rdf-primer/index.html
--- a/rdf-primer/index.html	Fri Feb 21 11:10:56 2014 +0000
+++ b/rdf-primer/index.html	Fri Feb 21 12:24:32 2014 +0100
@@ -1089,18 +1089,29 @@
 <span class="linenum">25</span>  &lt;/body&gt;
 </pre>
 
-<p class="issue">Textual description of example in progress (does not
-reflect yet the new RDFa Lite format of the example)</p>
+<p>The example above contains four special RDFa attributes to enable 
+specification of triples within HTML: <code>resource</code>,
+<code>property</code>, <code>typeof</code> and <code>prefix</code>.<p>
 
-<p>RDFa introduces a number of special attributes that enable the
-specification of triples within HTML. For example, the <code>div</code> elements 
-in lines 4 and 14 have a <code>resource</code> 
-attribute, specifying the IRI about which RDF statements can be made within this
-block. In line 6 we see a <code>property</code> attribute; the value
-of this attribute is interpreted as an RDF property IRI. The property
-is specified as an attribute of an <code>a</code> element; the
-<code>href</code> attribute value is interpreted here as the object of the
-triple. This results in the triple: <p>
+<p>The <code>prefix</code> attribute in line 1 specifies IRI
+shorthands in a similar fashion as the Turtle prefixes. Strictly
+speaking, these particular prefixes could have been omitted, as RDFa has a
+list of <a href="http://www.w3.org/2011/rdfa-context/rdfa-1.1">predefined
+prefixes</a> which includes the ones used in this example.</p>
+
+<p>The <code>div</code> elements in lines 4 and 14 have a <code>resource</code> 
+attribute specifying the IRI about which RDF statements can be
+made within this block. The meaning of the <code>typeof</code>
+attribute in line 4 is similar to the <code>(is) a</code> shorthand in
+Turtle: the subject <code>http://example.org/bob#me</code> is an
+instance (<code>rdf:type</code>) of the class <code>foaf>:Person</code>.<p>
+
+<p>In line 6 we see a <code>property</code> attribute; the value
+of this attribute (<code>foaf:knows</code>) is interpreted as an RDF
+property IRI; the value of the <code>href</code> attribute
+(<code>http://example.org/alice#me</code>) is
+interpreted here as the object of the triple. Thus, the RDF statement
+that results from line 6 is:<p>
 
 <pre>
 <code>&lt;http://example.org/bob#me&gt; &lt;http://xmlns.com/foaf/0.1/knows&gt; &lt;http://example.org/alice#me&gt; .</code>
@@ -1108,26 +1119,31 @@
 
 <p>In line 7 we see a triple with as object a literal value. The
 <code>property</code> attribute is specified here on the HTML
-<code>time</code> element. HTML requires that the content of the time element should be some
-valid <a href="http://www.w3.org/TR/html5/text-level-semantics.html#the-time-element">time value</a>.  
-with an attribute can also be used 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
-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 14). </p>
+<code>time</code> element. HTML requires that the content of the time
+element should be some valid <a
+href="http://www.w3.org/TR/html5/text-level-semantics.html#the-time-element">time
+value</a>. By using the built-in HTML semantics of the
+<code>time</code> element RDFa can interpret
+the value correctly without an explicit datatype declaration.<p>
 
-<p>Two more RDFa attributes appear in the example. The
-<code>typeof</code> attribute in line 1 is similar to the Turtle
-shorthand <code>a</code>: it signals the RDF class to which the IRI
-belongs. The <code>rev</code> ("reverse") attribute in line 17 signals
-that the triple specified should be interpreted in the reverse
-order: the "about" IRI is the object of the triple; the "href"
-attribute specifies the subject. </p>
+<p>In lines 10-11 we see the <code>resource</code> also being used for
+specifying the object of a triple. This approach is used when the object is an
+IRI and the IRI itself is not part of the HTML content (like a <code>href</code>
+attribute). Line 16 contains a second example of a literal ("Mona
+Lisa"), defined here as content of the <code>span</code> attribute. If
+RDFa cannot infer the datatype of the litera, it will assume the
+datatype to be <code>xsd:string</code>. </p>
 
-<p>For more information consult the RDFa Primer [[RDFA-PRIMER]] for detailed information about RDFa. </p>
+<p>It is not always possible to define RDF statements as part of the
+HTML content of the document. In that case it is possible to use HTML
+constructs that do not render content to specify a triple. An example
+can be found on lines 22-23. The HTML <code>link</code> element on
+line 23 is used here to specify what 
+the subject of the Europeana video (line 22) is. </p>  
+
+<p>The use of RDFa in this example is limited to RDFa Lite
+[[RDFA-LITE]]. For more information about RDFa please consult the RDFa
+Primer [[RDFA-PRIMER]].</p>
 
 </section>