Test that the shortest property generator term is chosen
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Tue, 11 Dec 2012 14:39:20 +0100
changeset 1025 ae990230344a
parent 1024 914dad60667d
child 1026 1eb099ae1fc9
Test that the shortest property generator term is chosen

This addresses #142 and #160.
test-suite/tests/compact-0033-context.jsonld
test-suite/tests/compact-0033-in.jsonld
test-suite/tests/compact-0033-out.jsonld
test-suite/tests/compact-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0033-context.jsonld	Tue Dec 11 14:39:20 2012 +0100
@@ -0,0 +1,19 @@
+{
+  "@context": {
+    "site": "http://example.com/",
+    "field_tags": {
+      "@id": [ "site:vocab/field_tags", "http://schema.org/about" ],
+      "@container": "@set"
+    },
+    "z_tags": {
+      "@id": [ "site:vocab/field_tags", "http://schema.org/about" ],
+      "@container": "@set"
+    },
+    "z_related": {
+      "@id": [ "site:vocab/field_related", "http://schema.org/about" ]
+    },
+    "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-0033-in.jsonld	Tue Dec 11 14:39:20 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-0033-out.jsonld	Tue Dec 11 14:39:20 2012 +0100
@@ -0,0 +1,26 @@
+{
+  "@context": {
+    "site": "http://example.com/",
+    "field_tags": {
+      "@id": [ "site:vocab/field_tags", "http://schema.org/about" ],
+      "@container": "@set"
+    },
+    "z_tags": {
+      "@id": [ "site:vocab/field_tags", "http://schema.org/about" ],
+      "@container": "@set"
+    },
+    "z_related": {
+      "@id": [ "site:vocab/field_related", "http://schema.org/about" ]
+    },
+    "field_related": {
+      "@id": [ "site:vocab/field_related", "http://schema.org/about" ]
+    }
+  },
+  "@id": "site:node/1",
+  "z_tags": [
+    { "@id": "site:term/this-is-a-tag" }
+  ],
+  "z_related": {
+    "@id": "site:node/this-is-related-news"
+  }
+}
--- a/test-suite/tests/compact-manifest.jsonld	Tue Dec 11 13:34:09 2012 +0100
+++ b/test-suite/tests/compact-manifest.jsonld	Tue Dec 11 14:39:20 2012 +0100
@@ -198,5 +198,11 @@
     "input": "compact-0032-in.jsonld",
     "context": "compact-0032-context.jsonld",
     "expect": "compact-0032-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:CompactTest"],
+    "name": "Use shortest property generator term",
+    "input": "compact-0033-in.jsonld",
+    "context": "compact-0033-context.jsonld",
+    "expect": "compact-0033-out.jsonld"
   }]
 }