Reset @vocab if set to null
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Fri, 01 Mar 2013 13:54:58 +0100
changeset 1365 ab425c98c080
parent 1364 aee9eb73fda4
child 1366 2f15f9c563c8
Reset @vocab if set to null
test-suite/tests/expand-0059-in.jsonld
test-suite/tests/expand-0059-out.jsonld
test-suite/tests/expand-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0059-in.jsonld	Fri Mar 01 13:54:58 2013 +0100
@@ -0,0 +1,16 @@
+{
+  "@context": {
+    "@vocab": "http://example.org/vocab#"
+  },
+  "@id": "example-with-vocab",
+  "@type": "vocab-prefixed",
+  "property": "property expanded using @vocab",
+  "embed": {
+    "@context": {
+      "@vocab": null
+    },
+    "@id": "example-vocab-reset",
+    "@type": "document-relative",
+    "property": "@vocab reset, property will be dropped"
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0059-out.jsonld	Fri Mar 01 13:54:58 2013 +0100
@@ -0,0 +1,13 @@
+[
+  {
+    "@id": "http://json-ld.org/test-suite/tests/example-with-vocab",
+    "@type": [ "http://example.org/vocab#vocab-prefixed" ],
+    "http://example.org/vocab#embed": [
+      {
+        "@id": "http://json-ld.org/test-suite/tests/example-vocab-reset",
+        "@type": [ "http://json-ld.org/test-suite/tests/document-relative" ]
+      }
+    ],
+    "http://example.org/vocab#property": [ { "@value": "property expanded using @vocab" } ]
+  }
+]
--- a/test-suite/tests/expand-manifest.jsonld	Fri Mar 01 13:29:11 2013 +0100
+++ b/test-suite/tests/expand-manifest.jsonld	Fri Mar 01 13:54:58 2013 +0100
@@ -298,6 +298,11 @@
       "name": "Expand compact IRI with @type: @vocab",
       "input": "expand-0058-in.jsonld",
       "expect": "expand-0058-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:ExpandTest"],
+      "name": "Reset @vocab by setting it to null",
+      "input": "expand-0059-in.jsonld",
+      "expect": "expand-0059-out.jsonld"
     }
   ]
 }