Add test to ensure that prefixes have precedence over @vocab - even if the result is longer
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Sat, 08 Dec 2012 14:29:33 +0100
changeset 1001 4dbe6fbe0689
parent 1000 bc5e4a37c3a9
child 1002 a5368d60ebfd
Add test to ensure that prefixes have precedence over @vocab - even if the result is longer
test-suite/tests/compact-0023-context.jsonld
test-suite/tests/compact-0023-in.jsonld
test-suite/tests/compact-0023-out.jsonld
test-suite/tests/compact-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0023-context.jsonld	Sat Dec 08 14:29:33 2012 +0100
@@ -0,0 +1,7 @@
+{
+  "@context": {
+    "@vocab": "http://example.com/subdir/",
+    "ex": "http://example.com/",
+    "ex:subdir/vocab/date": { "@type": "vocab/dateTime" }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0023-in.jsonld	Sat Dec 08 14:29:33 2012 +0100
@@ -0,0 +1,23 @@
+[
+  {
+    "@id": "http://example.com/subdir/id/1",
+    "@type": [ "http://example.com/subdir/vocab/Test" ],
+    "http://example.com/subdir/vocab/date": [
+      {
+        "@value": "2011-01-25T00:00:00Z",
+        "@type": "http://example.com/subdir/vocab/dateTime"
+      }
+    ],
+    "http://example.com/subdir/vocab/embed": [
+      {
+        "@id": "http://example.com/subdir/id/2",
+        "http://example.com/subdir/vocab/expandedDate": [
+          {
+            "@value": "2012-08-01T00:00:00Z",
+            "@type": "http://example.com/subdir/vocab/dateTime"
+          }
+        ]
+      }
+    ]
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0023-out.jsonld	Sat Dec 08 14:29:33 2012 +0100
@@ -0,0 +1,17 @@
+{
+  "@context": {
+    "@vocab": "http://example.com/subdir/",
+    "ex": "http://example.com/",
+    "ex:subdir/vocab/date": { "@type": "vocab/dateTime" }
+  },
+  "@id": "ex:subdir/id/1",
+  "@type": "ex:subdir/vocab/Test",
+  "ex:subdir/vocab/date": "2011-01-25T00:00:00Z",
+  "ex:subdir/vocab/embed": {
+    "@id": "ex:subdir/id/2",
+    "ex:subdir/vocab/expandedDate": {
+      "@value": "2012-08-01T00:00:00Z",
+      "@type": "ex:subdir/vocab/dateTime"
+    }
+  }
+}
--- a/test-suite/tests/compact-manifest.jsonld	Sat Dec 08 14:13:40 2012 +0100
+++ b/test-suite/tests/compact-manifest.jsonld	Sat Dec 08 14:29:33 2012 +0100
@@ -138,5 +138,11 @@
     "input": "compact-0022-in.jsonld",
     "context": "compact-0022-context.jsonld",
     "expect": "compact-0022-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:CompactTest"],
+    "name": "Prefixes have precedence over @vocab even if the result is longer",
+    "input": "compact-0023-in.jsonld",
+    "context": "compact-0023-context.jsonld",
+    "expect": "compact-0023-out.jsonld"
   }]
 }