Harmonized coding style of examples and added reference to issue #68.
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Wed, 25 Jan 2012 13:21:26 +0800
changeset 365 9b63f22d7150
parent 364 64eb4c00f493
child 366 438f56af7354
Harmonized coding style of examples and added reference to issue #68.
spec/latest/json-ld-syntax/index.html
--- a/spec/latest/json-ld-syntax/index.html	Wed Jan 25 11:45:36 2012 +0800
+++ b/spec/latest/json-ld-syntax/index.html	Wed Jan 25 13:21:26 2012 +0800
@@ -583,13 +583,13 @@
     "name": "http://xmlns.com/foaf/0.1/name",
     "depiction":
     {
-       "@id": "http://xmlns.com/foaf/0.1/depiction",
-       "@type": "@id"
+      "@id": "http://xmlns.com/foaf/0.1/depiction",
+      "@type": "@id"
     },
     "homepage":
     {
-       "@id": "http://xmlns.com/foaf/0.1/homepage",
-       "@type": "@id"
+      "@id": "http://xmlns.com/foaf/0.1/homepage",
+      "@type": "@id"
     },
   }
 }
@@ -634,13 +634,13 @@
     "name": "http://xmlns.com/foaf/0.1/name",
     "depiction":
     {
-       "@id": "http://xmlns.com/foaf/0.1/depiction",
-       "@type": "@id"
+      "@id": "http://xmlns.com/foaf/0.1/depiction",
+      "@type": "@id"
     },
     "homepage":
     {
-       "@id": "http://xmlns.com/foaf/0.1/homepage",
-       "@type": "@id"
+      "@id": "http://xmlns.com/foaf/0.1/homepage",
+      "@type": "@id"
     },
   },****
   "name": "Manu Sporny",
@@ -816,8 +816,11 @@
 <pre class="example" data-transform="updateExample">
 <!--
 {
-  "****@context****": { "****name****": "****http://xmlns.com/foaf/0.1/name****" },
+  "****@context****":
+  {
+    "****name****": "****http://xmlns.com/foaf/0.1/name****"
 ...
+  },
   "****name****": "Manu Sporny",
 ...
 }
@@ -831,8 +834,11 @@
 <pre class="example" data-transform="updateExample">
 <!--
 {
-  "****@context****": { "****foaf****": "****http://xmlns.com/foaf/0.1/****" },
+  "****@context****":
+  {
+    "****foaf****": "****http://xmlns.com/foaf/0.1/****"
 ...
+  },
   "****foaf:name****": "Manu Sporny",
 ...
 }
@@ -1160,8 +1166,14 @@
   "@id": "http://example.org/articles/8",
   "dc:title": ****
   [
-    { "@value": "Das Kapital", "@language": "de" },
-    { "@value": "Capital", "@language": "en" }
+    {
+      "@value": "Das Kapital",
+      "@language": "de"
+    },
+    {
+      "@value": "Capital",
+      "@language": "en"
+    }
   ]****
 }-->
 </pre>
@@ -1211,7 +1223,10 @@
   {
   ...
     "@id": "http://example.org/people#joebob",
-    "foaf:nick": ****{ "@list": [ "joe", "bob", "jaybee" ] }****,
+    "foaf:nick":
+    ****{
+      "@list": [ "joe", "bob", "jaybee" ]
+    }****,
   ...
   }
   -->
@@ -1400,7 +1415,9 @@
   ****"@context":
   [
     "http://json-ld.org/contexts/person",
-    { "foaf": "http://xmlns.com/foaf/0.1/" },
+    {
+      "foaf": "http://xmlns.com/foaf/0.1/"
+    },
     "http://json-ld.org/contexts/event",
   ]****
   "name": "Manu Sporny",
@@ -1434,12 +1451,12 @@
     "name": "http://example.com/person#name",
     "details": "http://example.com/person#details"
   },****
-  "****name****": "Markus",
+  "****name****": "Markus Lanthaler",
   ...
   "details":
   {
     ****"@context": { "name": "http://example.com/organization#name" },****
-    "****name****": "Acme, Ltd."
+    "****name****": "Graz University of Technology"
   }
 }
 -->
@@ -1666,14 +1683,26 @@
 {
   "@context":
   {
-     "xsd": "http://www.w3.org/2001/XMLSchema#",
-     "name": "http://xmlns.com/foaf/0.1/name",
-     "age": ****{ "@id": "http://xmlns.com/foaf/0.1/age", "@type": "xsd:integer" }****,
-     "homepage": ****{ "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id", "@list": true }****
+    "xsd": "http://www.w3.org/2001/XMLSchema#",
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "age":
+    ****{
+      "@id": "http://xmlns.com/foaf/0.1/age",
+      "@type": "xsd:integer"
+    }****,
+    "homepage":
+    ****{
+      "@id": "http://xmlns.com/foaf/0.1/homepage",
+      "@type": "@id", "@list": true
+    }****
   },
   "name": "John Smith",
   "age": ****"41"****,
-  "homepage": ****[ "http://personal.example.org/", "http://work.example.com/jsmith/" ]****
+  "homepage":
+  ****[
+    "http://personal.example.org/",
+    "http://work.example.com/jsmith/"
+  ]****
 }
 -->
 </pre>
@@ -1707,8 +1736,15 @@
   {
     ****"xsd": "http://www.w3.org/2001/XMLSchema#"****,
     "name": "http://xmlns.com/foaf/0.1/name",
-    "age": { "@id": "http://xmlns.com/foaf/0.1/age", "@type": ****"xsd:integer"**** },
-    "homepage": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id" }
+    "age":
+    {
+      "@id": "http://xmlns.com/foaf/0.1/age",
+      "@type": ****"xsd:integer"****
+    },
+    "homepage": {
+      "@id": "http://xmlns.com/foaf/0.1/homepage",
+      "@type": "@id"
+    }
   },
   ...
 }
@@ -1729,8 +1765,16 @@
     ****"foaf": "http://xmlns.com/foaf/0.1/"****,
     "xsd": "http://www.w3.org/2001/XMLSchema#",
     "name": ****"foaf:name"****,
-    "age": { "@id": ****"foaf:age"****, "@type": "xsd:integer" },
-    "homepage": { "@id": ****"foaf:homepage"****, "@type": "@id" }
+    "age":
+    {
+      "@id": ****"foaf:age"****,
+      "@type": "xsd:integer"
+    },
+    "homepage":
+    {
+      "@id": ****"foaf:homepage"****,
+      "@type": "@id"
+    }
   },
   ...
 }
@@ -1749,8 +1793,15 @@
     ****"foaf": "http://xmlns.com/foaf/0.1/"****,
     "xsd": "http://www.w3.org/2001/XMLSchema#",
     "name": "foaf:name",
-    "****foaf:age****": { "@id": "foaf:age", "@type": "xsd:integer" },
-    "****foaf:homepage****": ****{ "@type": "@id" }****
+    "****foaf:age****":
+    {
+      "@id": "foaf:age",
+      "@type": "xsd:integer"
+    },
+    "****foaf:homepage****":
+    ****{
+      "@type": "@id"
+    }****
   },
   ...
 }
@@ -1780,8 +1831,15 @@
     "foaf": "http://xmlns.com/foaf/0.1/",
     "xsd": "http://www.w3.org/2001/XMLSchema#",
     "name": "foaf:name",
-    "foaf:age": { "@id": "foaf:age", "@type": "xsd:integer" },
-    "****http://xmlns.com/foaf/0.1/homepage****": { "@type": "@id" }
+    "foaf:age":
+    {
+      "@id": "foaf:age",
+      "@type": "xsd:integer"
+    },
+    "****http://xmlns.com/foaf/0.1/homepage****":
+    {
+      "@type": "@id"
+    }
   },
   ...
 }
@@ -1810,8 +1868,8 @@
 {
   "@context":
   {
-    ****"term1": { "@id": "term2:foo" },
-    "term2": { "@id": "term1:bar" }****
+    ****"term1": "term2:foo",
+    "term2": "term1:bar"****
   },
   ...
 }
@@ -1827,8 +1885,7 @@
     is a commonly used mechanism for creating a parent-child relationship
     between two <tref>subject</tref>s.
   </p>
-  <p>The example shows an two subjects related by a property from the first
-  subject:</p>
+  <p>The example shows two subjects related by a property from the first subject:</p>
 
   <pre class="example" data-transform="updateExample">
   <!--
@@ -1980,7 +2037,7 @@
   "@id": ****":i/public"****,
   "@type": "foaf:Person",
   "foaf:name": "Manu Sporny",
-  "foaf:homepage":  { "@id": ****":" ****}
+  "foaf:homepage": { "@id": ****":" ****}
 }
 -->
 </pre>
@@ -2046,7 +2103,10 @@
   "@id": "http://example.org/people#joebob",
   "@type": "foaf:Person",
   "foaf:name": "Joe Bob",
-  "foaf:nick": { "@list": [ "joe", "bob", "jaybe" ] }
+  "foaf:nick":
+  {
+    "@list": [ "joe", "bob", "jaybe" ]
+  }
 }
 -->
 </pre>
@@ -2078,30 +2138,32 @@
 -->
 </pre>
 
-<p>An example JSON-LD implementation is described below, however, there are
-other ways to mark-up this information such that the <tref>context</tref> is not
-repeated.</p>
+<p>An example JSON-LD implementation using a single <tref>context</tref> is
+described below.</p>
+
+<p class="issue">The syntax to serialize multiple graphs is currently being
+discussed in <a href="https://github.com/json-ld/json-ld.org/issues/68">Issue 68</a>.</p>
 
 <pre class="example" data-transform="updateExample">
 <!--
 {
-  "@context": { "foaf": "http://xmlns.com/foaf/0.1/" },
+  "@context":
+  {
+    "foaf": "http://xmlns.com/foaf/0.1/"
+  },
   "@id":
   [
     {
-      "@id": "_:bnode1",
       "@type": "foaf:Person",
       "foaf:homepage": "http://example.com/bob/",
       "foaf:name": "Bob"
     },
     {
-      "@id": "_:bnode2",
       "@type": "foaf:Person",
       "foaf:homepage": "http://example.com/eve/",
       "foaf:name": "Eve"
     },
     {
-      "@id": "_:bnode3",
       "@type": "foaf:Person",
       "foaf:homepage": "http://example.com/manu/",
       "foaf:name": "Manu"
@@ -2122,7 +2184,7 @@
 <pre class="example" data-transform="updateExample">
 <!--
 <div class="vcard">
- <a class="url fn" href="http://tantek.com/">Tantek Çelik</a>
+ <a class="url fn" href="http://www.markus-lanthaler.com/">Markus Lanthaler</a>
 </div>
 -->
 </pre>
@@ -2138,13 +2200,16 @@
   "@context":
   {
     "vcard": "http://microformats.org/profile/hcard#vcard",
-    "url": { "@id": "http://microformats.org/profile/hcard#url", "@type": "@id" },
+    "url":
+    {
+      "@id": "http://microformats.org/profile/hcard#url",
+      "@type": "@id"
+    },
     "fn": "http://microformats.org/profile/hcard#fn"
   },
-  "@id": "_:bnode1",
   "@type": "vcard",
-  "url": "http://tantek.com/",
-  "fn": "Tantek Çelik"
+  "url": "http://www.markus-lanthaler.com/",
+  "fn": "Markus Lanthaler"
 }
 -->
 </pre>
@@ -2199,7 +2264,10 @@
     "http://purl.org/dc/terms/title": "Just a Geek",
     "http://purl.org/dc/terms/creator": "Whil Wheaton",
     "http://purl.org/vocab/frbr/core#realization":
-      [ "http://purl.oreilly.com/products/9780596007683.BOOK", "http://purl.oreilly.com/products/9780596802189.EBOOK" ]
+    [
+      "http://purl.oreilly.com/products/9780596007683.BOOK",
+      "http://purl.oreilly.com/products/9780596802189.EBOOK"
+    ]
   },
   {
     "@id": "http://purl.oreilly.com/products/9780596007683.BOOK",