Test that most specific property generator is chosen
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Tue, 11 Dec 2012 14:49:37 +0100
changeset 1026 1eb099ae1fc9
parent 1025 ae990230344a
child 1027 c70fa7769546
Test that most specific property generator is chosen

This addresses #142 and #160.
test-suite/tests/compact-0034-context.jsonld
test-suite/tests/compact-0034-in.jsonld
test-suite/tests/compact-0034-out.jsonld
test-suite/tests/compact-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0034-context.jsonld	Tue Dec 11 14:49:37 2012 +0100
@@ -0,0 +1,13 @@
+{
+  "@context": {
+    "site": "http://example.com/",
+    "field_tags_nc": { "@id": [ "site:vocab/field_tags", "http://schema.org/about" ] },
+    "field_tags_set": { "@id": [ "site:vocab/field_tags", "http://schema.org/about" ], "@container": "@set" },
+    "field_tags_set_id": { "@id": [ "site:vocab/field_tags", "http://schema.org/about" ], "@container": "@set", "@type": "@id" },
+    "field_related_nc": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ] },
+    "field_related_set": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@set" },
+    "field_related_list": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@list" },
+    "field_related_list_id": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@list", "@type": "@id" },
+    "field_related_list_lang": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@list", "@language": "en" }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0034-in.jsonld	Tue Dec 11 14:49:37 2012 +0100
@@ -0,0 +1,39 @@
+[
+   {
+      "@id": "http://example.com/node/1",
+      "http://example.com/vocab/field_related": [
+         {
+            "@list": [
+               {
+                  "@id": "http://example.com/node/this-is-related-news"
+               },
+               {
+                  "@value": "This is a related string",
+                  "@language": "en"
+               }
+            ]
+         }
+      ],
+      "http://schema.org/about": [
+         {
+            "@list": [
+               {
+                  "@id": "http://example.com/node/this-is-related-news"
+               },
+               {
+                  "@value": "This is a related string",
+                  "@language": "en"
+               }
+            ]
+         },
+         {
+            "@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-0034-out.jsonld	Tue Dec 11 14:49:37 2012 +0100
@@ -0,0 +1,26 @@
+{
+  "@context": {
+    "site": "http://example.com/",
+    "field_tags_nc": { "@id": [ "site:vocab/field_tags", "http://schema.org/about" ] },
+    "field_tags_set": { "@id": [ "site:vocab/field_tags", "http://schema.org/about" ], "@container": "@set" },
+    "field_tags_set_id": { "@id": [ "site:vocab/field_tags", "http://schema.org/about" ], "@container": "@set", "@type": "@id" },
+    "field_related_nc": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ] },
+    "field_related_set": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@set" },
+    "field_related_list": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@list" },
+    "field_related_list_id": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@list", "@type": "@id" },
+    "field_related_list_lang": { "@id": [ "site:vocab/field_related", "http://schema.org/about" ], "@container": "@list", "@language": "en" }
+  },
+  "@id": "site:node/1",
+  "field_tags_set_id": [
+    "site:term/this-is-a-tag"
+  ],
+  "field_related_list": [
+    {
+      "@id": "site:node/this-is-related-news"
+    },
+    {
+      "@value": "This is a related string",
+      "@language": "en"
+    }
+  ]
+}
--- a/test-suite/tests/compact-manifest.jsonld	Tue Dec 11 14:39:20 2012 +0100
+++ b/test-suite/tests/compact-manifest.jsonld	Tue Dec 11 14:49:37 2012 +0100
@@ -204,5 +204,11 @@
     "input": "compact-0033-in.jsonld",
     "context": "compact-0033-context.jsonld",
     "expect": "compact-0033-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:CompactTest"],
+    "name": "Choose most specific property generator",
+    "input": "compact-0034-in.jsonld",
+    "context": "compact-0034-context.jsonld",
+    "expect": "compact-0034-out.jsonld"
   }]
 }