Test that @vocab is usd to expand keys in reverse-maps
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Mon, 11 Mar 2013 19:30:01 +0100
changeset 1407 483c4f47ea44
parent 1406 4734f5796236
child 1408 77d22cdb6495
Test that @vocab is usd to expand keys in reverse-maps

This addresses #221
test-suite/tests/expand-0066-in.jsonld
test-suite/tests/expand-0066-out.jsonld
test-suite/tests/expand-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0066-in.jsonld	Mon Mar 11 19:30:01 2013 +0100
@@ -0,0 +1,19 @@
+{
+  "@context": {
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "knows": "http://xmlns.com/foaf/0.1/knows",
+    "@vocab": "http://example.com/vocab/"
+  },
+  "@id": "http://example.com/people/markus",
+  "name": "Markus Lanthaler",
+  "@reverse": {
+    "knows": {
+      "@id": "http://example.com/people/dave",
+      "name": "Dave Longley"
+    },
+    "noTerm": {
+      "@id": "relative-node",
+      "name": "Compact keys using @vocab"
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0066-out.jsonld	Mon Mar 11 19:30:01 2013 +0100
@@ -0,0 +1,20 @@
+[
+  {
+    "@id": "http://example.com/people/markus",
+    "@reverse": {
+      "http://xmlns.com/foaf/0.1/knows": [
+        {
+          "@id": "http://example.com/people/dave",
+          "http://xmlns.com/foaf/0.1/name": [ { "@value": "Dave Longley" } ]
+        }
+      ],
+      "http://example.com/vocab/noTerm": [
+        {
+          "@id": "http://json-ld.org/test-suite/tests/relative-node",
+          "http://xmlns.com/foaf/0.1/name": [ { "@value": "Compact keys using @vocab" } ]
+        }
+      ]
+    },
+    "http://xmlns.com/foaf/0.1/name": [ { "@value": "Markus Lanthaler" } ]
+  }
+]
--- a/test-suite/tests/expand-manifest.jsonld	Mon Mar 11 14:21:50 2013 -0400
+++ b/test-suite/tests/expand-manifest.jsonld	Mon Mar 11 19:30:01 2013 +0100
@@ -333,6 +333,11 @@
       "name": "Keys that are not mapped to an IRI in a reverse-map are dropped",
       "input": "expand-0065-in.jsonld",
       "expect": "expand-0065-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:ExpandTest"],
+      "name": "Use @vocab to expand keys in reverse-maps",
+      "input": "expand-0066-in.jsonld",
+      "expect": "expand-0066-out.jsonld"
     }
   ]
 }