Simple property generator compaction test
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Mon, 10 Dec 2012 19:01:22 +0100
changeset 1015 c30639ca3161
parent 1014 966933d6e7c3
child 1016 29372731bd72
Simple property generator compaction test

This addresses #142 and #160.
test-suite/tests/compact-0031-context.jsonld
test-suite/tests/compact-0031-in.jsonld
test-suite/tests/compact-0031-out.jsonld
test-suite/tests/compact-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0031-context.jsonld	Mon Dec 10 19:01:22 2012 +0100
@@ -0,0 +1,12 @@
+{
+  "@context": {
+    "site": "http://example.com/",
+    "field_tags": {
+      "@id": [ "site:vocab/field_tags", "http://schema.org/about" ],
+      "@container": "@set"
+    },
+    "field_related": {
+      "@id": [ "site:vocab/field_related", "http://schema.org/about" ]
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0031-in.jsonld	Mon Dec 10 19:01:22 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"
+   }]
+}]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0031-out.jsonld	Mon Dec 10 19:01:22 2012 +0100
@@ -0,0 +1,19 @@
+{
+  "@context": {
+    "site": "http://example.com/",
+    "field_tags": {
+      "@id": [ "site:vocab/field_tags", "http://schema.org/about" ],
+      "@container": "@set"
+    },
+    "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"
+  }
+}
--- a/test-suite/tests/compact-manifest.jsonld	Sun Dec 09 19:22:17 2012 +0100
+++ b/test-suite/tests/compact-manifest.jsonld	Mon Dec 10 19:01:22 2012 +0100
@@ -186,5 +186,11 @@
     "input": "compact-0030-in.jsonld",
     "context": "compact-0030-context.jsonld",
     "expect": "compact-0030-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:CompactTest"],
+    "name": "Compacting property generators (no type coercions, language mappings etc.)",
+    "input": "compact-0031-in.jsonld",
+    "context": "compact-0031-context.jsonld",
+    "expect": "compact-0031-out.jsonld"
   }]
 }