Add reverse properties flattening tests
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Mon, 11 Mar 2013 18:52:56 +0100
changeset 1404 f4a3eaf19735
parent 1403 e8bc0b737650
child 1405 8be04258d819
Add reverse properties flattening tests

This addresses #221.
test-suite/tests/flatten-0037-in.jsonld
test-suite/tests/flatten-0037-out.jsonld
test-suite/tests/flatten-0039-in.jsonld
test-suite/tests/flatten-0039-out.jsonld
test-suite/tests/flatten-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0037-in.jsonld	Mon Mar 11 18:52:56 2013 +0100
@@ -0,0 +1,16 @@
+[
+  {
+    "@id": "http://example.com/people/markus",
+    "@reverse": {
+      "http://xmlns.com/foaf/0.1/knows": [
+        {
+          "@id": "http://example.com/people/dave"
+        },
+        {
+          "@id": "http://example.com/people/gregg"
+        }
+      ]
+    },
+    "http://xmlns.com/foaf/0.1/name": [ { "@value": "Markus Lanthaler" } ]
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0037-out.jsonld	Mon Mar 11 18:52:56 2013 +0100
@@ -0,0 +1,14 @@
+[
+  {
+    "@id": "http://example.com/people/dave",
+    "http://xmlns.com/foaf/0.1/knows": [ { "@id": "http://example.com/people/markus" } ]
+  },
+  {
+    "@id": "http://example.com/people/gregg",
+    "http://xmlns.com/foaf/0.1/knows": [ { "@id": "http://example.com/people/markus" } ]
+  },
+  {
+    "@id": "http://example.com/people/markus",
+    "http://xmlns.com/foaf/0.1/name": [ { "@value": "Markus Lanthaler" } ]
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/flatten-0039-in.jsonld	Mon Mar 11 18:52:56 2013 +0100
@@ -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": "Dave Longley"
+        },
+        {
+          "http://xmlns.com/foaf/0.1/name": "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/flatten-0039-out.jsonld	Mon Mar 11 18:52:56 2013 +0100
@@ -0,0 +1,16 @@
+[
+  {
+    "@id": "_:b0",
+    "http://xmlns.com/foaf/0.1/name": [ { "@value": "Dave Longley" } ],
+    "http://xmlns.com/foaf/0.1/knows": [ { "@id": "http://example.com/people/markus" } ]
+  },
+  {
+    "@id": "_:b1",
+    "http://xmlns.com/foaf/0.1/name": [ { "@value": "Gregg Kellogg" } ],
+    "http://xmlns.com/foaf/0.1/knows": [ { "@id": "http://example.com/people/markus" } ]
+  },
+  {
+    "@id": "http://example.com/people/markus",
+    "http://xmlns.com/foaf/0.1/name": [ { "@value": "Markus Lanthaler" } ]
+  }
+]
--- a/test-suite/tests/flatten-manifest.jsonld	Mon Mar 11 18:43:21 2013 +0100
+++ b/test-suite/tests/flatten-manifest.jsonld	Mon Mar 11 18:52:56 2013 +0100
@@ -188,11 +188,21 @@
       "expect": "flatten-0036-out.jsonld"
     }, {
       "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Flattening reverse properties",
+      "input": "flatten-0037-in.jsonld",
+      "expect": "flatten-0037-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
       "name": "Ensure all blank nodes are relabeled when flattening.",
       "input": "flatten-0038-in.jsonld",
       "expect": "flatten-0038-out.jsonld"
     }, {
       "@type": ["test:TestCase", "jld:FlattenTest"],
+      "name": "Flattening reverse properties using blank nodes",
+      "input": "flatten-0039-in.jsonld",
+      "expect": "flatten-0039-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:FlattenTest"],
       "name": "Only invoke language and index map expansion if the value is a JSON object",
       "input": "flatten-0040-in.jsonld",
       "expect": "flatten-0040-out.jsonld"