Added more explanation about the context-sensitivity for @type.
authorManu Sporny <msporny@digitalbazaar.com>
Sun, 19 Aug 2012 12:27:22 -0400
changeset 828 d2ad17452b11
parent 827 49103fb9c560
child 829 1fb5c742dd97
Added more explanation about the context-sensitivity for @type.
spec/latest/json-ld-syntax/index.html
--- a/spec/latest/json-ld-syntax/index.html	Sun Aug 19 11:45:19 2012 -0400
+++ b/spec/latest/json-ld-syntax/index.html	Sun Aug 19 12:27:22 2012 -0400
@@ -1057,8 +1057,8 @@
 <h2>Specifying the Type</h2>
 
 <p>The type of a particular subject can be specified using the
-<code>@type</code> <tref>keyword</tref>. Specifying the type in this way will generate a
-triple of the form (subject, type, type-IRI). To be considered
+<code>@type</code> <tref>keyword</tref>. Specifying the type in this way will 
+generate a triple of the form (subject, type, type-IRI). To be considered
 <tref>Linked Data</tref>, types MUST be uniquely identified by
 an <tref>IRI</tref>.</p>
 
@@ -1398,14 +1398,42 @@
 also possible to use a <tref>term</tref> or a <tref>compact IRI</tref> to
 express the value of a type.</p>
 
-<p class="note">
-  The <code>@type</code> <tref>keyword</tref> is also used to associate a type with
-  a <tref>subject</tref>. Although the same keyword is used in both places,
-  the concept of an <em>object type</em> and a <em>value type</em>
-  are different. This is similar to object-oriented programming languages
-  where both scalar and structured types use the same class inheritance
-  mechanism, even though scalar types and structured types are
-  inherently different.
+The <code>@type</code> <tref>keyword</tref> is also used to associate a type 
+with a <tref>subject</tref>. The concept of an <tdef>subject type</tdef> and 
+a <tdef>value type</tdef> are different. This is similar to object-oriented 
+programming languages where both scalar and structured types use the same 
+class inheritance mechanism, even though scalar types and structured types are
+inherently different.
+
+<pre class="example" data-transform="updateExample"
+     title="Example demonstrating the context-sensitivity for @type">
+<!--
+{
+...
+  "@id": "http://example.org/posts#TripToWestVirginia",
+  ****"@type": "http://schema.org/BlogPosting"****,
+  "modified":
+  {
+    "@value": "2010-05-29T14:17:39+02:00",
+    ****"@type": "http://www.w3.org/2001/XMLSchema#dateTime"****
+  }
+...
+}
+-->
+</pre>
+
+<p>
+The first use of <code>@type</code> associates a <tref>subject type</tref>
+(<code>http://schema.org/BlogPosting</code>) with the <tref>subject</tref>,
+which is expressed using the <code>@id</code> <tref>keyword</tref>. 
+The second use of <code>@type</code> associates a <tref>value type</tref>
+(<code>http://www.w3.org/2001/XMLSchema#dateTime</code>) with the 
+<tref>object</tref>, which is expressed using the <code>@value</code> 
+<tref>keyword</tref>. As a general rule, when <code>@value</code> and
+<code>@type</code> are used in the same <tref>JSON object</tref> 
+in JSON-LD data, the <code>@type</code> <tref>keyword</tref> is expressing a
+<tref>value type</tref>. Otherwise, the <code>@type</code> 
+<tref>keyword</tref> is expressing a <tref>subject type</tref>.
 </p>
 
 </section>