Stripping context out of example, explanations on multigraphs JSON-LD
authorYves Raimond <yves.raimond@bbc.co.uk>
Mon, 17 Feb 2014 17:44:38 +0000
changeset 1945 31247b763f0b
parent 1943 4108e0768a9a
child 1946 49901902b96c
Stripping context out of example, explanations on multigraphs JSON-LD
rdf-primer/index.html
--- a/rdf-primer/index.html	Mon Feb 17 17:06:39 2014 +0000
+++ b/rdf-primer/index.html	Mon Feb 17 17:44:38 2014 +0000
@@ -964,7 +964,7 @@
       </pre>
 
       <p>The <code>@context</code> key on line 2
-      points to <a href="example-context.jsonld">a JSON document</a>
+      points to <a href="#appendix-jsonld-3">a JSON document</a>
       describing how the document can be mapped to an RDF graph.
       For example it will specify that the <code>born</code> key
       maps to the <code>schema:birthDate</code> property IRI, and that
@@ -1361,6 +1361,8 @@
 
 <h3>JSON-LD</h3>
 
+      <section id="appendix-jsonld-1">
+
       <p>In this section we describe several
       alternative serialisations for JSON-LD, adding to the example
       in the <a href="#json-ld">JSON-LD section above</a>.</p>
@@ -1415,6 +1417,10 @@
      <p>Literals with datatypes can be expressed through the <code>@value</code> and <code>@type</code>
      attributes, as in lines 14 and 15.</p>
 
+     </section>
+
+     <section id="appendix-jsonld-2">
+
      <p>JSON-LD can also be used for RDF datasets, through the use of the <code>@graph</code> keyword. 
     The example below encodes the
     RDF dataset depicted in <a href="#fig5">Fig.&nbsp;5</a></p>
@@ -1472,9 +1478,19 @@
 50    }
       </pre>
 
-<p>Below is an alternate single-graph example with more idiomatic
-JSON data, at the cost of a more elaborate definition of
-<code>@context</code>. </p>
+      <p>On line 8 we use the <code>@graph</code> keyword to describe two
+      distinct graphs, identified using <code>@id</code> attributes
+      on lines 10 and 35. The content of these graphs is given in
+      lines 11 to 26 and lines 36 to 47. The extra provenance and rights
+      information is given on lines 27 to 32.</p>
+
+      </section>
+
+      <section id="appendix-jsonld-3">
+
+<p>The <code>@context</code> of a JSON-LD document can be factored out
+and refered to by its IRI. The following is the context used in the example
+in the <a href="#json-ld">JSON-LD section above</a>.</p>
 
 <pre class="example">
 01    {
@@ -1506,25 +1522,10 @@
 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    }
+30    }
 </pre>
 
-The context can also be held in a separate file, as in the example presented in the <a href="#json-ld">JSON-LD section above</a>.
+    </section>
 
 </section>