Some more simple test cases @type: @vocab for compact and relative IRIs
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Thu, 14 Feb 2013 19:03:51 +0100
changeset 1258 a68f8f6c2d0d
parent 1257 e649bac38640
child 1259 20e58aab52ed
Some more simple test cases @type: @vocab for compact and relative IRIs

This addresses #204
test-suite/tests/compact-0062-context.jsonld
test-suite/tests/compact-0062-in.jsonld
test-suite/tests/compact-0062-out.jsonld
test-suite/tests/compact-0063-context.jsonld
test-suite/tests/compact-0063-in.jsonld
test-suite/tests/compact-0063-out.jsonld
test-suite/tests/compact-manifest.jsonld
test-suite/tests/expand-0057-in.jsonld
test-suite/tests/expand-0057-out.jsonld
test-suite/tests/expand-0058-in.jsonld
test-suite/tests/expand-0058-out.jsonld
test-suite/tests/expand-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0062-context.jsonld	Thu Feb 14 19:03:51 2013 +0100
@@ -0,0 +1,5 @@
+{
+  "@context": {
+    "term": { "@id": "http://example.org/term", "@type": "@vocab" }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0062-in.jsonld	Thu Feb 14 19:03:51 2013 +0100
@@ -0,0 +1,6 @@
+{
+  "@context": {
+    "term": { "@id": "http://example.org/term", "@type": "@vocab" }
+  },
+  "term": "not-a-term-thus-a-relative-IRI"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0062-out.jsonld	Thu Feb 14 19:03:51 2013 +0100
@@ -0,0 +1,6 @@
+{
+  "@context": {
+    "term": { "@id": "http://example.org/term", "@type": "@vocab" }
+  },
+  "term": "http://json-ld.org/test-suite/tests/not-a-term-thus-a-relative-IRI"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0063-context.jsonld	Thu Feb 14 19:03:51 2013 +0100
@@ -0,0 +1,6 @@
+{
+  "@context": {
+    "term": { "@id": "http://example.org/term", "@type": "@vocab" },
+    "prefix": "http://example.com/vocab#"
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0063-in.jsonld	Thu Feb 14 19:03:51 2013 +0100
@@ -0,0 +1,7 @@
+{
+  "@context": {
+    "term": { "@id": "http://example.org/term", "@type": "@vocab" },
+    "prefix": "http://example.com/vocab#"
+  },
+  "term": "prefix:suffix"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0063-out.jsonld	Thu Feb 14 19:03:51 2013 +0100
@@ -0,0 +1,7 @@
+{
+  "@context": {
+    "term": { "@id": "http://example.org/term", "@type": "@vocab" },
+    "prefix": "http://example.com/vocab#"
+  },
+  "term": "prefix:suffix"
+}
--- a/test-suite/tests/compact-manifest.jsonld	Thu Feb 14 12:54:13 2013 -0500
+++ b/test-suite/tests/compact-manifest.jsonld	Thu Feb 14 19:03:51 2013 +0100
@@ -372,6 +372,18 @@
       "input": "compact-0061-in.jsonld",
       "context": "compact-0061-context.jsonld",
       "expect": "compact-0061-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:CompactTest"],
+      "name": "Relative IRIs don't round-trip with @type: @vocab",
+      "input": "compact-0062-in.jsonld",
+      "context": "compact-0062-context.jsonld",
+      "expect": "compact-0062-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:CompactTest"],
+      "name": "Compact IRI round-tripping with @type: @vocab",
+      "input": "compact-0063-in.jsonld",
+      "context": "compact-0063-context.jsonld",
+      "expect": "compact-0063-out.jsonld"
     }
   ]
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0057-in.jsonld	Thu Feb 14 19:03:51 2013 +0100
@@ -0,0 +1,6 @@
+{
+  "@context": {
+    "term": { "@id": "http://example.org/term", "@type": "@vocab" }
+  },
+  "term": "not-a-term-thus-a-relative-IRI"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0057-out.jsonld	Thu Feb 14 19:03:51 2013 +0100
@@ -0,0 +1,5 @@
+[
+  {
+    "http://example.org/term": [ { "@id": "http://json-ld.org/test-suite/tests/not-a-term-thus-a-relative-IRI" } ]
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0058-in.jsonld	Thu Feb 14 19:03:51 2013 +0100
@@ -0,0 +1,7 @@
+{
+  "@context": {
+    "term": { "@id": "http://example.org/term", "@type": "@vocab" },
+    "prefix": "http://example.com/vocab#"
+  },
+  "term": "prefix:suffix"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0058-out.jsonld	Thu Feb 14 19:03:51 2013 +0100
@@ -0,0 +1,5 @@
+[
+  {
+    "http://example.org/term": [ { "@id": "http://example.com/vocab#suffix" } ]
+  }
+]
--- a/test-suite/tests/expand-manifest.jsonld	Thu Feb 14 12:54:13 2013 -0500
+++ b/test-suite/tests/expand-manifest.jsonld	Thu Feb 14 19:03:51 2013 +0100
@@ -268,26 +268,36 @@
       "expect": "expand-0052-out.jsonld"
     }, {
       "@type": ["test:TestCase", "jld:ExpandTest"],
-      "name": "Use term with @type: @vocab",
+      "name": "Expand absolute IRI with @type: @vocab",
       "input": "expand-0053-in.jsonld",
       "expect": "expand-0053-out.jsonld"
     }, {
       "@type": ["test:TestCase", "jld:ExpandTest"],
-      "name": "Expand @id from term with @type: @vocab",
+      "name": "Expand term with @type: @vocab",
       "input": "expand-0054-in.jsonld",
       "context": "expand-0054-context.jsonld",
       "expect": "expand-0054-out.jsonld"
     }, {
       "@type": ["test:TestCase", "jld:ExpandTest"],
-      "name": "Resolve using @vocab when using @type: @vocab",
+      "name": "Expand @vocab-relative term with @type: @vocab",
       "input": "expand-0055-in.jsonld",
       "context": "expand-0055-context.jsonld",
       "expect": "expand-0055-out.jsonld"
-    }, {    
+    }, {
       "@type": ["test:TestCase", "jld:ExpandTest"],
       "name": "Use terms with @type: @vocab but not with @type: @id",
       "input": "expand-0056-in.jsonld",
       "expect": "expand-0056-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:ExpandTest"],
+      "name": "Expand relative IRI with @type: @vocab",
+      "input": "expand-0057-in.jsonld",
+      "expect": "expand-0057-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:ExpandTest"],
+      "name": "Expand compact IRI with @type: @vocab",
+      "input": "expand-0058-in.jsonld",
+      "expect": "expand-0058-out.jsonld"
     }
   ]
 }