Add simple expansion test for property generators
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Thu, 06 Dec 2012 20:56:47 +0100
changeset 994 0c599deb8563
parent 993 4d1e56e4ebd8
child 995 9b207ba64cb8
Add simple expansion test for property generators

This is more or less an exact copy of the example in issue #160. See https://github.com/json-ld/json-ld.org/issues/160#issuecomment-8894278
test-suite/tests/expand-0037-in.jsonld
test-suite/tests/expand-0037-out.jsonld
test-suite/tests/expand-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0037-in.jsonld	Thu Dec 06 20:56:47 2012 +0100
@@ -0,0 +1,18 @@
+{
+  "@context": {
+    "site": "http://example.com/",
+    "field_tags": {
+      "@id": [ "site:vocab/field_tags", "http://schema.org/about" ]
+    },
+    "field_related": {
+      "@id": [ "site:vocab/field_related", "http://schema.org/about" ]
+    }
+  },
+  "@id": "site:node/1",
+  "field_tags": [
+    { "@id": "site:term/this-is-a-tag" }
+  ],
+  "field_related": [
+    { "@id": "site:node/this-is-related-news" }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0037-out.jsonld	Thu Dec 06 20:56:47 2012 +0100
@@ -0,0 +1,14 @@
+[{
+   "@id": "http://example.com/node/1",
+   "http://example.com/vocab/field_related": [{
+      "@id": "http://example.com/node/this-is-related-news"
+   }],
+   "http://schema.org/about": [{
+      "@id": "http://example.com/node/this-is-related-news"
+   }, {
+      "@id": "http://example.com/term/this-is-a-tag"
+   }],
+   "http://example.com/vocab/field_tags": [{
+      "@id": "http://example.com/term/this-is-a-tag"
+   }]
+}]
--- a/test-suite/tests/expand-manifest.jsonld	Wed Dec 05 18:30:10 2012 +0100
+++ b/test-suite/tests/expand-manifest.jsonld	Thu Dec 06 20:56:47 2012 +0100
@@ -186,6 +186,11 @@
       "name": "Expanding @annotation",
       "input": "expand-0036-in.jsonld",
       "expect": "expand-0036-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:ExpandTest"],
+      "name": "Expanding property generators (no type coercions, language mappings etc.)",
+      "input": "expand-0037-in.jsonld",
+      "expect": "expand-0037-out.jsonld"
     }
   ]
 }