Add test for reverse property compaction of unlabeled blank nodes.
authorDave Longley <dlongley@digitalbazaar.com>
Mon, 11 Mar 2013 16:50:47 -0400
changeset 1414 c80805153186
parent 1413 3e32b0bb291e
child 1415 8ae8d9eb17d2
Add test for reverse property compaction of unlabeled blank nodes.
test-suite/tests/compact-0067-context.jsonld
test-suite/tests/compact-0067-in.jsonld
test-suite/tests/compact-0067-out.jsonld
test-suite/tests/compact-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0067-context.jsonld	Mon Mar 11 16:50:47 2013 -0400
@@ -0,0 +1,6 @@
+{
+  "@context": {
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "isKnownBy": { "@reverse": "http://xmlns.com/foaf/0.1/knows" }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0067-in.jsonld	Mon Mar 11 16:50:47 2013 -0400
@@ -0,0 +1,16 @@
+[
+  {
+    "@id": "http://example.com/people/markus",
+    "@reverse": {
+      "http://xmlns.com/foaf/0.1/knows": [
+        {
+          "http://xmlns.com/foaf/0.1/name": [ { "@value": "Dave Longley" } ]
+        },
+        {
+          "http://xmlns.com/foaf/0.1/name": [ { "@value": "Gregg Kellogg" } ]
+        }
+      ]
+    },
+    "http://xmlns.com/foaf/0.1/name": [ { "@value": "Markus Lanthaler" } ]
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0067-out.jsonld	Mon Mar 11 16:50:47 2013 -0400
@@ -0,0 +1,16 @@
+{
+  "@context": {
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "isKnownBy": { "@reverse": "http://xmlns.com/foaf/0.1/knows" }
+  },
+  "@id": "http://example.com/people/markus",
+  "name": "Markus Lanthaler",
+  "isKnownBy": [
+    {
+      "name": "Dave Longley"
+    },
+    {
+      "name": "Gregg Kellogg"
+    }
+  ]
+}
--- a/test-suite/tests/compact-manifest.jsonld	Mon Mar 11 16:15:46 2013 -0400
+++ b/test-suite/tests/compact-manifest.jsonld	Mon Mar 11 16:50:47 2013 -0400
@@ -384,6 +384,12 @@
       "input": "compact-0066-in.jsonld",
       "context": "compact-0066-context.jsonld",
       "expect": "compact-0066-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:CompactTest"],
+      "name": "Compact reverse property whose values are unlabeled blank nodes",
+      "input": "compact-0067-in.jsonld",
+      "context": "compact-0067-context.jsonld",
+      "expect": "compact-0067-out.jsonld"
     }
   ]
 }