Updating examples (diagram to be updated)
authorYves Raimond <yves.raimond@bbc.co.uk>
Wed, 04 Dec 2013 13:57:05 +0000
changeset 1468 824e8a1f449c
parent 1467 df97b7d1107c
child 1469 5ac5e4dc75bf
Updating examples (diagram to be updated)
rdf-primer/example-context.json
rdf-primer/index.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rdf-primer/example-context.json	Wed Dec 04 13:57:05 2013 +0000
@@ -0,0 +1,28 @@
+{
+  "@context": {
+    "foaf": "http://xmlns.com/foaf/0.1/",
+    "xsd": "http://www.w3.org/2001/XMLSchema#",
+    "schema": "http://schema.org/",
+    "dcterms": "http://purl.org/dc/terms/",
+    "wd": "http://www.wikidata.org/entity/",
+    "@base": "http://example.org/",
+    "uri": "@id",
+    "type": "@type",
+    "Person": "foaf:Person",
+    "born": {
+        "@id": "schema:birthDate",
+        "@type": "xsd:date"
+    },
+    "friends": {
+        "@id": "foaf:knows",
+        "@type": "@id"
+    },
+    "interest": "http://xmlns.com/foaf/0.1/topic_interest",
+    "subject_of": {
+        "@reverse": "dcterms:subject",
+        "@type": "@id"
+    },
+    "creator": "dcterms:creator",
+    "title": "dcterms:title",
+    "name": "foaf:name"
+}
--- a/rdf-primer/index.html	Tue Dec 03 18:20:35 2013 -0800
+++ b/rdf-primer/index.html	Wed Dec 04 13:57:05 2013 +0000
@@ -702,15 +702,12 @@
 11        schema:birthDate "1990-07-04"^^xsd:date ;
 12        foaf:topic_interest wd:Q12418 .
 13
-14    &lt;http://dbpedia.org/resource/Leonardo_da_Vinci&gt;
-15        a foaf:Person ;
-16        foaf:name "Leonardo da Vinci" .
+14    wd:Q12418
+15        dcterms:title "Mona Lisa" ;
+16        dcterms:creator &lt;http://dbpedia.org/resource/Leonardo_da_Vinci&gt; .
 17
-18    wd:Q12418
-19        dcterms:creator &lt;http://dbpedia.org/resource/Leonardo_da_Vinci&gt; .
-20
-21    &lt;http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D61set&gt;
-22        dcterms:subject wd:Q12418 .
+18    &lt;http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619&gt;
+19        dcterms:subject wd:Q12418 .
 </pre>
 
 <p>Lines 1-6 contain a number of directives which provide shorthands for
@@ -833,20 +830,17 @@
 16
 17    &lt;https://www.wikidata.org/wiki/Special:EntityData/Q12418&gt;
 18      {
-19        &lt;http://dbpedia.org/resource/Leonardo_da_Vinci&gt;
-20            a foaf:Person ;
-21            foaf:name "Leonardo da Vinci" .
+19        wd:Q12418
+20            dcterms:title "Mona Lisa" ;
+21            dcterms:creator &lt;http://dbpedia.org/resource/Leonardo_da_Vinci&gt; .
 22    
-23        wd:Q12418
-24            dcterms:creator &lt;http://dbpedia.org/resource/Leonardo_da_Vinci&gt; .
-25    
-26        &lt;http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619&gt;
-27           dcterms:subject wd:Q12418 .
-28      }
-29
-30    &lt;http://example.org/bob&gt;
-31        dcterms:publisher &lt;http://example.org&gt; ;
-32        dcterms:rights &lt;http://creativecommons.org/licenses/by/3.0/&gt; .
+23        &lt;http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619&gt;
+24           dcterms:subject wd:Q12418 .
+25      }
+26
+27    &lt;http://example.org/bob&gt;
+28        dcterms:publisher &lt;http://example.org&gt; ;
+29        dcterms:rights &lt;http://creativecommons.org/licenses/by/3.0/&gt; .
       </pre>
 
     <p>This RDF dataset contains two named graphs. Lines 8 and 16 list
@@ -1149,7 +1143,7 @@
 13            Bob is interested in &lt;a rel="foaf:topic_interest" resource="wd:Q12418"&gt;the Mona Lisa&lt;/a&gt;.
 14          &lt;/p&gt;
 15          &lt;div about="wd:Q12418"&gt;
-16            The Mona Lisa was painted by &lt;a rel="dcterms:creator" typeof="foaf:Person" href="http://dbpedia.org/resource/Leonardo_da_Vinci"&gt;&lt;span property="foaf:name"&gt;Leonardo da Vinci&lt;/span&gt;&lt;/a&gt;
+16            The &lt;span property="dcterms:title"&gt;Mona Lisa&lt;/span&gt; was painted by &lt;a rel="dcterms:creator" href="http://dbpedia.org/resource/Leonardo_da_Vinci"&gt;Leonardo da Vinci&lt;/a&gt;
 17            and is the subject of the video &lt;a rev="dcterms:subject" href="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619"&gt;'La Joconde à Washington'&lt;/a&gt;.
 18          &lt;/div&gt;
 19      &lt;/div&gt;
@@ -1186,16 +1180,15 @@
 19      },
 20      "foaf:topic_interest": {
 21        "@id": "wd:Q12418",
+22        "dcterms:title": "Mona Lisa",
 22        "subject_of": {
 23            "@id": "http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619"
 24        },
 25        "dcterms:creator": {
-26          "@id": "http://dbpedia.org/resource/Leonardo_da_Vinci",
-27          "@type": "foaf:Person",
-28          "foaf:name": "Leonardo da Vinci"
-29        }
-30      }
-31    }
+26          "@id": "http://dbpedia.org/resource/Leonardo_da_Vinci"
+27        }
+28      }
+29    }
       </pre>
 
      <p>Multiple-graphs example:</p>
@@ -1241,17 +1234,16 @@
 38              "@id": "http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619",
 39              "dcterms:subject": {
 40                "@id": "http://www.wikidata.org/entity/Q12418",
-41                "dcterms:creator": {
-42                  "@id": "http://dbpedia.org/resource/Leonardo_da_Vinci",
-43                  "@type": "foaf:Person",
-44                  "foaf:name": "Leonardo da Vinci"
-45                }
-46              }
-47            }
-48          ]
-49        }
-50      ]
-51    }
+41                "dcterms:title": "Mona Lisa",
+42                "dcterms:creator": {
+43                  "@id": "http://dbpedia.org/resource/Leonardo_da_Vinci"
+44                }
+45              }
+46            }
+47          ]
+48        }
+49      ]
+50    }
       </pre>
 
 <p>Below is an alternate single-graph example with more idiomatic
@@ -1261,53 +1253,74 @@
 <p class="issue">Should we include this alternative example?</p>
 
 <pre class="example">
-01  {
-02    "@context": {
-03      "foaf": "http://xmlns.com/foaf/0.1/",
-04      "xsd": "http://www.w3.org/2001/XMLSchema#",
-05      "schema": "http://schema.org/",
-06      "dcterms": "http://purl.org/dc/terms/",
-07      "wd": "http://www.wikidata.org/entity/",
-08      "@base": "http://example.org/",
+01    {
+02      "@context": {
+03        "foaf": "http://xmlns.com/foaf/0.1/",
+04        "xsd": "http://www.w3.org/2001/XMLSchema#",
+05        "schema": "http://schema.org/",
+06        "dcterms": "http://purl.org/dc/terms/",
+07        "wd": "http://www.wikidata.org/entity/",
+08        "@base": "http://example.org/",
 09
-10      "uri": "@id",
-11      "type": "@type",
-12      "Person": "foaf:Person",
-13      "born": {
+10        "uri": "@id",
+11        "type": "@type",
+12        "Person": "foaf:Person",
+13        "born": {
 14          "@id": "schema:birthDate",
 15          "@type": "xsd:date"
-16      },
-17      "friends": {
+16        },
+17        "friends": {
 18          "@id": "foaf:knows",
 19          "@type": "@id"
-20      },
-21      "interest": "http://xmlns.com/foaf/0.1/topic_interest",
-22      "subject_of": {
+20        },
+21        "interest": "http://xmlns.com/foaf/0.1/topic_interest",
+22        "subject_of": {
 23          "@reverse": "dcterms:subject",
 24          "@type": "@id"
-25      },
-26      "creator": "dc:creator",
-27      "name": "foaf:name"
-28    },
-29
-30    "uri": "bob#me",
-31    "type": "Person",
-32    "born": "1990-07-04",
-33    "friends": ["alice#me"],
-34    "interest": [
-35      {
-36          "uri": "wd:Q12418",
-37          "subject_of": "http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619",
-38          "creator": {
-39              "uri": "http://dbpedia.org/resource/Leonardo_da_Vinci",
-40              "type": "Person",
-41              "name": "Leonardo da Vinci"
+25        },
+26        "creator": "dcterms:creator",
+27        "title": "dcterms:title",
+28        "name": "foaf:name"
+29      },
+30
+31      "uri": "bob#me",
+32      "type": "Person",
+33      "born": "1990-07-04",
+34      "friends": ["alice#me"],
+35      "interest": [
+36        {
+37          "uri": "wd:Q12418",
+38          "title": "Mona Lisa",
+39          "subject_of": "http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619",
+40          "creator": {
+41            "uri": "http://dbpedia.org/resource/Leonardo_da_Vinci"
 42          }
-43      }
-44    ]
-45  }
+43        }
+44      ]
+45    }
 </pre>
 
+The context can also be held in a separate file, as in the following example.
+
+<pre class="example">
+01    {
+02      "context": "example-context.json",
+03      "uri": "bob#me",
+04      "type": "Person",
+05      "born": "1990-07-04",
+06      "friends": ["alice#me"],
+07      "interest": [
+08        {
+09          "uri": "wd:Q12418",
+10          "title": "Mona Lisa",
+11          "subject_of": "http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619",
+12          "creator": {
+13            "uri": "http://dbpedia.org/resource/Leonardo_da_Vinci"
+14          }
+15        }
+16      ]
+17    }
+</pre>
 
     </section>
 
@@ -1319,14 +1332,13 @@
       <p>Single-graph example: </p>
 
       <pre class="example" id="n-triples-example">
-01    &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;.
-02    &lt;http://example.org/bob#me&gt; &lt;http://xmlns.com/foaf/0.1/knows&gt; &lt;http://example.org/alice#me&gt;.
-03    &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;.
-04    &lt;http://example.org/bob#me&gt; &lt;http://xmlns.com/foaf/0.1/topic_interest&gt; &lt;http://www.wikidata.org/entity/Q12418&gt;.
-05    &lt;http://dbpedia.org/resource/Leonardo_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;.
-06    &lt;http://dbpedia.org/resource/Leonardo_da_Vinci&gt; &lt;http://xmlns.com/foaf/0.1/name&gt; "Leonardo da Vinci".
-07    &lt;http://www.wikidata.org/entity/Q12418&gt; &lt;http://purl.org/dc/terms/creator&gt; &lt;http://dbpedia.org/resource/Leonardo_da_Vinci&gt;.
-08    &lt;http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619&gt; &lt;http://purl.org/dc/terms/subject&gt; &lt;http://www.wikidata.org/entity/Q12418&gt;.
+01    &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; .
+02    &lt;http://example.org/bob#me&gt; &lt;http://xmlns.com/foaf/0.1/knows&gt; &lt;http://example.org/alice#me&gt; .
+03    &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; .
+04    &lt;http://example.org/bob#me&gt; &lt;http://xmlns.com/foaf/0.1/topic_interest&gt; &lt;http://www.wikidata.org/entity/Q12418&gt; .
+05    &lt;http://www.wikidata.org/entity/Q12418&gt; &lt;http://purl.org/dc/terms/title&gt; "Mona Lisa" .
+06    &lt;http://www.wikidata.org/entity/Q12418&gt; &lt;http://purl.org/dc/terms/creator&gt; &lt;http://dbpedia.org/resource/Leonardo_da_Vinci&gt; .
+07    &lt;http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619&gt; &lt;http://purl.org/dc/terms/subject&gt; &lt;http://www.wikidata.org/entity/Q12418&gt; .
       </pre>
 
      </section>
@@ -1342,12 +1354,11 @@
 02    &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&gt; .
 03    &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://example.org/bob&gt; .
 04    &lt;http://example.org/bob#me&gt; &lt;http://xmlns.com/foaf/0.1/topic_interest&gt; &lt;http://www.wikidata.org/entity/Q12418&gt; &lt;http://example.org/bob&gt; .
-05    &lt;http://dbpedia.org/resource/Leonardo_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;https://www.wikidata.org/wiki/Special:EntityData/Q12418&gt; .
-06    &lt;http://dbpedia.org/resource/Leonardo_da_Vinci&gt; &lt;http://xmlns.com/foaf/0.1/name&gt; "Leonardo da Vinci" &lt;https://www.wikidata.org/wiki/Special:EntityData/Q12418&gt; .
-07    &lt;http://www.wikidata.org/entity/Q12418&gt; &lt;http://purl.org/dc/terms/creator&gt; &lt;http://dbpedia.org/resource/Leonardo_da_Vinci&gt; &lt;https://www.wikidata.org/wiki/Special:EntityData/Q12418&gt; .
-08    &lt;http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619&gt; &lt;http://purl.org/dc/terms/subject&gt; &lt;http://www.wikidata.org/entity/Q12418&gt; &lt;https://www.wikidata.org/wiki/Special:EntityData/Q12418&gt; .
-09    &lt;http://example.org/bob&gt; &lt;http://purl.org/dc/terms/publisher&gt; &lt;http://example.org&gt; .
-10    &lt;http://example.org/bob&gt; &lt;http://purl.org/dc/terms/rights&gt; &lt;http://creativecommons.org/licenses/by/3.0/&gt; .
+05    &lt;http://www.wikidata.org/entity/Q12418&gt; &lt;http://purl.org/dc/terms/title&gt; "Mona Lisa" &lt;https://www.wikidata.org/wiki/Special:EntityData/Q12418&gt; .
+06    &lt;http://www.wikidata.org/entity/Q12418&gt; &lt;http://purl.org/dc/terms/creator&gt; &lt;http://dbpedia.org/resource/Leonardo_da_Vinci&gt; &lt;https://www.wikidata.org/wiki/Special:EntityData/Q12418&gt; .
+07    &lt;http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619&gt; &lt;http://purl.org/dc/terms/subject&gt; &lt;http://www.wikidata.org/entity/Q12418&gt; &lt;https://www.wikidata.org/wiki/Special:EntityData/Q12418&gt; .
+08    &lt;http://example.org/bob&gt; &lt;http://purl.org/dc/terms/publisher&gt; &lt;http://example.org&gt; .
+09    &lt;http://example.org/bob&gt; &lt;http://purl.org/dc/terms/rights&gt; &lt;http://creativecommons.org/licenses/by/3.0/&gt; .
       </pre>
 
     </section>
@@ -1372,16 +1383,14 @@
 11        &lt;foaf:knows rdf:resource="http://example.org/alice#me"/&gt;
 12        &lt;foaf:topic_interest rdf:resource="http://www.wikidata.org/entity/Q12418"/&gt;
 13      &lt;/foaf:Person&gt;
-14      &lt;foaf:Person rdf:about="http://dbpedia.org/resource/Leonardo_da_Vinci"&gt;
-15        &lt;foaf:name&gt;Leonardo da Vinci&lt;/foaf:name&gt;
-16      &lt;/foaf:Person&gt;
-17      &lt;rdf:Description rdf:about="http://www.wikidata.org/entity/Q12418"&gt;
-18        &lt;dcterms:creator rdf:resource="http://dbpedia.org/resource/Leonardo_da_Vinci"/&gt;
-19      &lt;/rdf:Description&gt;
-20      &lt;rdf:Description rdf:about="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619"&gt;
-21        &lt;dcterms:subject rdf:resource="http://www.wikidata.org/entity/Q12418"/&gt;
-22      &lt;/rdf:Description&gt;
-23    &lt;/rdf:RDF&gt;
+14      &lt;rdf:Description rdf:about="http://www.wikidata.org/entity/Q12418"&gt;
+15        &lt;dcterms:title&gt;Mona Lisa&lt;/dcterms:title&gt;
+16        &lt;dcterms:creator rdf:resource="http://dbpedia.org/resource/Leonardo_da_Vinci"/&gt;
+17      &lt;/rdf:Description&gt;
+18      &lt;rdf:Description rdf:about="http://data.europeana.eu/item/04802/243FA8618938F4117025F17A8B813C5F9AA4D619"&gt;
+19        &lt;dcterms:subject rdf:resource="http://www.wikidata.org/entity/Q12418"/&gt;
+20      &lt;/rdf:Description&gt;
+21    &lt;/rdf:RDF&gt;
       </pre>
 
     </section>