Add test for documents with multiple reverse properties
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Tue, 08 Jul 2014 18:01:15 +0200
changeset 2158 016281fb9a68
parent 2157 ae13e72a5ba3
child 2159 4d1a199d9e11
Add test for documents with multiple reverse properties

This test was contributed by Nicholas Bollweg (http://lists.w3.org/Archives/Public/public-linked-json/2014Jul/0000.html).
test-suite/tests/expand-0078-in.jsonld
test-suite/tests/expand-0078-out.jsonld
test-suite/tests/expand-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0078-in.jsonld	Tue Jul 08 18:01:15 2014 +0200
@@ -0,0 +1,29 @@
+{
+  "@context": {
+    "name": "http://example.com/vocab#name",
+    "children": { "@reverse": "http://example.com/vocab#parent" },
+    "pets": { "@reverse": "http://example.com/vocab#owner" }
+  },
+  "@id": "#homer",
+  "name": "Homer",
+  "children": [
+    {
+      "@id": "#bart",
+      "name": "Bart"
+    },
+    {
+      "@id": "#lisa",
+      "name": "Lisa"
+    }
+  ],
+  "pets": [
+    {
+      "@id": "#snowball-ii",
+      "name": "Snowball II"
+    },
+    {
+      "@id": "#santas-little-helper",
+      "name": "Santa's Little Helper"
+    }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0078-out.jsonld	Tue Jul 08 18:01:15 2014 +0200
@@ -0,0 +1,26 @@
+[{
+  "@id": "http://json-ld.org/test-suite/tests/expand-0078-in.jsonld#homer",
+  "@reverse": {
+    "http://example.com/vocab#parent": [
+      {
+        "@id": "http://json-ld.org/test-suite/tests/expand-0078-in.jsonld#bart",
+        "http://example.com/vocab#name": [ { "@value": "Bart" } ]
+      },
+      {
+        "@id": "http://json-ld.org/test-suite/tests/expand-0078-in.jsonld#lisa",
+        "http://example.com/vocab#name": [ { "@value": "Lisa" } ]
+      }
+    ],
+    "http://example.com/vocab#owner": [
+      {
+        "@id": "http://json-ld.org/test-suite/tests/expand-0078-in.jsonld#snowball-ii",
+        "http://example.com/vocab#name": [ { "@value": "Snowball II" } ]
+      },
+      {
+        "@id": "http://json-ld.org/test-suite/tests/expand-0078-in.jsonld#santas-little-helper",
+        "http://example.com/vocab#name": [ { "@value": "Santa's Little Helper" } ]
+      }
+    ]
+  },
+  "http://example.com/vocab#name": [ { "@value": "Homer" } ]
+}]
--- a/test-suite/tests/expand-manifest.jsonld	Wed Jun 18 14:30:21 2014 -0400
+++ b/test-suite/tests/expand-manifest.jsonld	Tue Jul 08 18:01:15 2014 +0200
@@ -551,6 +551,13 @@
       },
       "input": "expand-0077-in.jsonld",
       "expect": "expand-0077-out.jsonld"
+    }, {
+      "@id": "#t0078",
+      "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
+      "name": "multiple reverse properties",
+      "purpose": "Use of multiple reverse properties",
+      "input": "expand-0078-in.jsonld",
+      "expect": "expand-0078-out.jsonld"
     }
   ]
 }