Disallow blank nodes as data types
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Tue, 25 Jun 2013 18:55:08 +0200
changeset 1737 d74548f99e2e
parent 1736 ae8788c658c6
child 1738 a1164ec280b2
Disallow blank nodes as data types

This closes #257
spec/latest/json-ld-api/index.html
spec/latest/json-ld/index.html
test-suite/tests/expand-0038-in.jsonld
test-suite/tests/expand-0038-out.jsonld
test-suite/tests/flatten-0038-in.jsonld
test-suite/tests/flatten-0038-out.jsonld
test-suite/tests/toRdf-0078-in.jsonld
test-suite/tests/toRdf-0078-out.nq
--- a/spec/latest/json-ld-api/index.html	Sun Jun 23 15:46:00 2013 -0400
+++ b/spec/latest/json-ld-api/index.html	Tue Jun 25 18:55:08 2013 +0200
@@ -187,6 +187,7 @@
     <li>Clarify that the <i>identifier map</i> and the <i>counter</i> used by the
       Generate Blank Node Identifier algorithm are reset before running the Flattening
       and the Convert to RDF algorithms</li>
+    <li>Raise an error if a blank node is used as data type</li>
   </ul>
 </section>
 
@@ -1696,7 +1697,7 @@
               error has been detected (only <tref title="string">strings</tref>
               can be language-tagged) and processing is aborted.</li>
             <li>Otherwise, if the <i>result</i> has a <code>@type</code> member
-              and its value is not a <tref>string</tref>, an
+              and its value is not an <tref>IRI</tref>, an
               <code class="error"><a href="#idl-def-JsonLdErrorCode.invalid-typed-value">invalid typed value</a></code>
               error has been detected and processing is aborted.</li>
           </ol>
--- a/spec/latest/json-ld/index.html	Sun Jun 23 15:46:00 2013 -0400
+++ b/spec/latest/json-ld/index.html	Tue Jun 25 18:55:08 2013 +0200
@@ -162,6 +162,7 @@
     <li>Support relative IRIs in <code>@base</code></li>
     <li>Clarify how the <code>profile</code> media type parameter is used in the content
       negotiation process</li>
+    <li>Update grammar to disallow blank nodes as data types</li>
   </ul>
 </section>
 
@@ -3116,8 +3117,7 @@
 
   <p>If the <tref>expanded term definition</tref> contains the <code>@type</code>
     <tref>keyword</tref>, its value MUST be an <tref>absolute IRI</tref>, a
-    <tref>compact IRI</tref>, a <tref>blank node identifier</tref>, a <tref>term</tref> or
-    the <tref>active context</tref>, <tref>null</tref>, or the one of the
+    <tref>compact IRI</tref>, a <tref>term</tref>, <tref>null</tref>, or the one of the
     <tref title="keyword">keywords</tref> <code>@id</code> or <code>@vocab</code>.</p>
 
   <p>If the <tref>expanded term definition</tref> contains the <code>@language</code> <tref>keyword</tref>,
--- a/test-suite/tests/expand-0038-in.jsonld	Sun Jun 23 15:46:00 2013 -0400
+++ b/test-suite/tests/expand-0038-in.jsonld	Tue Jun 25 18:55:08 2013 +0200
@@ -1,16 +1,14 @@
 {
   "@context": {
     "term": "_:term",
-    "termId": { "@id": "term", "@type": "@id" },
-    "termTyped": { "@id": "term", "@type": "_:term" }
+    "termId": { "@id": "term", "@type": "@id" }
   },
   "@id": "_:term",
   "@type": "_:term",
   "term": [
     {
       "@id": "_:term",
-      "@type": "term",
-      "termTyped": "typed value term"
+      "@type": "term"
     },
     {
       "@id": "_:Bx",
@@ -19,21 +17,12 @@
     "plain value",
     {
       "@id": "_:term"
-    },
-    {
-      "@value": "term: typed value with type set to bnode",
-      "@type": "_:term"
-    },
-    {
-      "@value": "term: typed value with type set to term",
-      "@type": "term"
     }
   ],
   "termId": [
     {
       "@id": "_:term",
-      "@type": "term",
-      "termTyped": "typed value termId"
+      "@type": "term"
     },
     {
       "@id": "_:Cx",
@@ -44,17 +33,6 @@
     "relativeIri",
     {
       "@id": "_:term"
-    },
-    {
-      "@value": "termId: typed value with type set to bnode",
-      "@type": "_:term"
-    },
-    {
-      "@value": "termId: typed value with type set to term",
-      "@type": "term"
     }
-  ],
-  "termTyped": [
-    "termTyped: value"
   ]
 }
--- a/test-suite/tests/expand-0038-out.jsonld	Sun Jun 23 15:46:00 2013 -0400
+++ b/test-suite/tests/expand-0038-out.jsonld	Tue Jun 25 18:55:08 2013 +0200
@@ -9,12 +9,6 @@
         "@id": "_:term",
         "@type": [
           "_:term"
-        ],
-        "_:term": [
-          {
-            "@value": "typed value term",
-            "@type": "_:term"
-          }
         ]
       },
       {
@@ -32,23 +26,9 @@
         "@id": "_:term"
       },
       {
-        "@type": "_:term",
-        "@value": "term: typed value with type set to bnode"
-      },
-      {
-        "@type": "_:term",
-        "@value": "term: typed value with type set to term"
-      },
-      {
         "@id": "_:term",
         "@type": [
           "_:term"
-        ],
-        "_:term": [
-          {
-            "@value": "typed value termId",
-            "@type": "_:term"
-          }
         ]
       },
       {
@@ -70,18 +50,6 @@
       },
       {
         "@id": "_:term"
-      },
-      {
-        "@type": "_:term",
-        "@value": "termId: typed value with type set to bnode"
-      },
-      {
-        "@type": "_:term",
-        "@value": "termId: typed value with type set to term"
-      },
-      {
-        "@value": "termTyped: value",
-        "@type": "_:term"
       }
     ]
   }
--- a/test-suite/tests/flatten-0038-in.jsonld	Sun Jun 23 15:46:00 2013 -0400
+++ b/test-suite/tests/flatten-0038-in.jsonld	Tue Jun 25 18:55:08 2013 +0200
@@ -1,16 +1,14 @@
 {
   "@context": {
     "term": "_:term",
-    "termId": { "@id": "term", "@type": "@id" },
-    "termTyped": { "@id": "term", "@type": "_:term" }
+    "termId": { "@id": "term", "@type": "@id" }
   },
   "@id": "_:term",
   "@type": "_:term",
   "term": [
     {
       "@id": "_:term",
-      "@type": "term",
-      "termTyped": "typed value term"
+      "@type": "term"
     },
     {
       "@id": "_:Bx",
@@ -19,41 +17,22 @@
     "plain value",
     {
       "@id": "_:term"
-    },
-    {
-      "@value": "term: typed value with type set to bnode",
-      "@type": "_:term"
-    },
-    {
-      "@value": "term: typed value with type set to term",
-      "@type": "term"
     }
   ],
   "termId": [
     {
       "@id": "_:term",
-      "@type": "term",
-      "termTyped": "typed value termId"
+      "@type": "term"
     },
     {
       "@id": "_:Cx",
       "term": "termId"
     },
     "term:AppendedToBlankNode",
+    "_:termAppendedToBlankNode",
     "relativeIri",
     {
       "@id": "_:term"
-    },
-    {
-      "@value": "termId: typed value with type set to bnode",
-      "@type": "_:term"
-    },
-    {
-      "@value": "termId: typed value with type set to term",
-      "@type": "term"
     }
-  ],
-  "termTyped": [
-    "termTyped: value"
   ]
 }
--- a/test-suite/tests/flatten-0038-out.jsonld	Sun Jun 23 15:46:00 2013 -0400
+++ b/test-suite/tests/flatten-0038-out.jsonld	Tue Jun 25 18:55:08 2013 +0200
@@ -9,28 +9,12 @@
                 "@id": "_:b0"
             },
             {
-                "@value": "typed value term",
-                "@type": "_:b0"
-            },
-            {
                 "@id": "_:b1"
             },
             {
                 "@value": "plain value"
             },
             {
-                "@type": "_:b0",
-                "@value": "term: typed value with type set to bnode"
-            },
-            {
-                "@type": "_:b0",
-                "@value": "term: typed value with type set to term"
-            },
-            {
-                "@value": "typed value termId",
-                "@type": "_:b0"
-            },
-            {
                 "@id": "_:b2"
             },
             {
@@ -38,18 +22,6 @@
             },
             {
                 "@id": "http://json-ld.org/test-suite/tests/relativeIri"
-            },
-            {
-                "@type": "_:b0",
-                "@value": "termId: typed value with type set to bnode"
-            },
-            {
-                "@type": "_:b0",
-                "@value": "termId: typed value with type set to term"
-            },
-            {
-                "@value": "termTyped: value",
-                "@type": "_:b0"
             }
         ]
     },
--- a/test-suite/tests/toRdf-0078-in.jsonld	Sun Jun 23 15:46:00 2013 -0400
+++ b/test-suite/tests/toRdf-0078-in.jsonld	Tue Jun 25 18:55:08 2013 +0200
@@ -1,16 +1,14 @@
 {
   "@context": {
     "term": "_:term",
-    "termId": { "@id": "term", "@type": "@id" },
-    "termTyped": { "@id": "term", "@type": "_:term" }
+    "termId": { "@id": "term", "@type": "@id" }
   },
   "@id": "_:term",
   "@type": "_:term",
   "term": [
     {
       "@id": "_:term",
-      "@type": "term",
-      "termTyped": "typed value term"
+      "@type": "term"
     },
     {
       "@id": "_:Bx",
@@ -19,21 +17,12 @@
     "plain value",
     {
       "@id": "_:term"
-    },
-    {
-      "@value": "term: typed value with type set to bnode",
-      "@type": "_:term"
-    },
-    {
-      "@value": "term: typed value with type set to term",
-      "@type": "term"
     }
   ],
   "termId": [
     {
       "@id": "_:term",
-      "@type": "term",
-      "termTyped": "typed value termId"
+      "@type": "term"
     },
     {
       "@id": "_:Cx",
@@ -44,17 +33,6 @@
     "relativeIri",
     {
       "@id": "_:term"
-    },
-    {
-      "@value": "termId: typed value with type set to bnode",
-      "@type": "_:term"
-    },
-    {
-      "@value": "termId: typed value with type set to term",
-      "@type": "term"
     }
-  ],
-  "termTyped": [
-    "termTyped: value"
   ]
 }
--- a/test-suite/tests/toRdf-0078-out.nq	Sun Jun 23 15:46:00 2013 -0400
+++ b/test-suite/tests/toRdf-0078-out.nq	Tue Jun 25 18:55:08 2013 +0200
@@ -1,12 +1,5 @@
 _:b0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> _:b0 .
 _:b0 _:b0 "plain value" .
-_:b0 _:b0 "term: typed value with type set to bnode"^^<_:b0> .
-_:b0 _:b0 "term: typed value with type set to term"^^<_:b0> .
-_:b0 _:b0 "termId: typed value with type set to bnode"^^<_:b0> .
-_:b0 _:b0 "termId: typed value with type set to term"^^<_:b0> .
-_:b0 _:b0 "termTyped: value"^^<_:b0> .
-_:b0 _:b0 "typed value term"^^<_:b0> .
-_:b0 _:b0 "typed value termId"^^<_:b0> .
 _:b0 _:b0 <http://json-ld.org/test-suite/tests/relativeIri> .
 _:b0 _:b0 _:b0 .
 _:b0 _:b0 _:b1 .