Add test to ensure that prefixes have precedence over @vocab - even if the result is longer
--- /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"
}]
}