Add language map compaction test with @vocab, a default language, and a competing term
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Sat, 08 Dec 2012 21:40:08 +0100
changeset 1008 f2529feda03b
parent 1007 51112e97499e
child 1009 ee4c2b0940a4
Add language map compaction test with @vocab, a default language, and a competing term

This addresses #133.
test-suite/tests/compact-0026-context.jsonld
test-suite/tests/compact-0026-in.jsonld
test-suite/tests/compact-0026-out.jsonld
test-suite/tests/compact-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0026-context.jsonld	Sat Dec 08 21:40:08 2012 +0100
@@ -0,0 +1,19 @@
+{
+  "@context": {
+    "@vocab": "http://example.com/vocab/",
+    "@language": "it",
+    "s": { "@id": "label", "@language": "en" },
+    "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-0026-in.jsonld	Sat Dec 08 21:40:08 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-0026-out.jsonld	Sat Dec 08 21:40:08 2012 +0100
@@ -0,0 +1,16 @@
+{
+  "@context": {
+    "@vocab": "http://example.com/vocab/",
+    "@language": "it",
+    "s": { "@id": "label", "@language": "en" },
+    "label": {
+      "@container": "@language"
+    }
+  },
+  "@id": "http://example.com/queen",
+  "label": {
+    "it": "Il re",
+    "en": [ "The king", "The Queen" ],
+    "de": [ "Die Königin", "Ihre Majestät" ]
+  }
+}
--- a/test-suite/tests/compact-manifest.jsonld	Sat Dec 08 21:31:19 2012 +0100
+++ b/test-suite/tests/compact-manifest.jsonld	Sat Dec 08 21:40:08 2012 +0100
@@ -156,5 +156,11 @@
     "input": "compact-0025-in.jsonld",
     "context": "compact-0025-context.jsonld",
     "expect": "compact-0025-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:CompactTest"],
+    "name": "Using language maps with @vocab, a default language, and a competing term",
+    "input": "compact-0026-in.jsonld",
+    "context": "compact-0026-context.jsonld",
+    "expect": "compact-0026-out.jsonld"
   }]
 }