Test that compaction falls back to term with @set containers if no language maps are available
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Sat, 08 Dec 2012 22:31:49 +0100
changeset 1009 ee4c2b0940a4
parent 1008 f2529feda03b
child 1010 4f19d65d2f3a
Test that compaction falls back to term with @set containers if no language maps are available

Also removed unnecessary data from compact-0026-context.jsonld.

This addresses #133.
test-suite/tests/compact-0026-context.jsonld
test-suite/tests/compact-0027-context.jsonld
test-suite/tests/compact-0027-in.jsonld
test-suite/tests/compact-0027-out.jsonld
test-suite/tests/compact-manifest.jsonld
--- a/test-suite/tests/compact-0026-context.jsonld	Sat Dec 08 21:40:08 2012 +0100
+++ b/test-suite/tests/compact-0026-context.jsonld	Sat Dec 08 22:31:49 2012 +0100
@@ -6,14 +6,5 @@
     "label": {
       "@container": "@language"
     }
-  },
-  "@id": "http://example.com/queen",
-  "label": {
-    "en": "The Queen",
-    "de": [ "Die Königin", "Ihre Majestät" ]
-  },
-  "http://example.com/vocab/label": [
-    "Il re",
-    { "@value": "The king", "@language": "en" }
-  ]
+  }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0027-context.jsonld	Sat Dec 08 22:31:49 2012 +0100
@@ -0,0 +1,6 @@
+{
+  "@context": {
+    "label": "http://example.com/vocab/label",
+    "container": { "@id": "label", "@container": "@set" }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0027-in.jsonld	Sat Dec 08 22:31:49 2012 +0100
@@ -0,0 +1,21 @@
+[{
+   "@id": "http://example.com/queen",
+   "http://example.com/vocab/label": [
+      {
+         "@value": "Il re",
+         "@language": "it"
+      }, {
+         "@value": "The king",
+         "@language": "en"
+      }, {
+         "@value": "The Queen",
+         "@language": "en"
+      }, {
+         "@value": "Die Königin",
+         "@language": "de"
+      }, {
+         "@value": "Ihre Majestät",
+         "@language": "de"
+      }
+   ]
+}]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0027-out.jsonld	Sat Dec 08 22:31:49 2012 +0100
@@ -0,0 +1,25 @@
+{
+  "@context": {
+    "label": "http://example.com/vocab/label",
+    "container": { "@id": "label", "@container": "@set" }
+  },
+  "@id": "http://example.com/queen",
+  "container": [
+    {
+      "@value": "Il re",
+      "@language": "it"
+    }, {
+      "@value": "The king",
+      "@language": "en"
+    }, {
+      "@value": "The Queen",
+      "@language": "en"
+    }, {
+      "@value": "Die Königin",
+      "@language": "de"
+    }, {
+      "@value": "Ihre Majestät",
+      "@language": "de"
+    }
+   ]
+}
--- a/test-suite/tests/compact-manifest.jsonld	Sat Dec 08 21:40:08 2012 +0100
+++ b/test-suite/tests/compact-manifest.jsonld	Sat Dec 08 22:31:49 2012 +0100
@@ -162,5 +162,11 @@
     "input": "compact-0026-in.jsonld",
     "context": "compact-0026-context.jsonld",
     "expect": "compact-0026-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:CompactTest"],
+    "name": "Fall back to term with @set container if term with language map is defined",
+    "input": "compact-0027-in.jsonld",
+    "context": "compact-0027-context.jsonld",
+    "expect": "compact-0027-out.jsonld"
   }]
 }