Test that terms with @type: @vocab are preferred in reverse maps
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Mon, 11 Mar 2013 19:56:46 +0100
changeset 1409 4ba6404e371a
parent 1408 77d22cdb6495
child 1410 3ed6f0410983
Test that terms with @type: @vocab are preferred in reverse maps

This addresses #221
test-suite/tests/compact-0044-context.jsonld
test-suite/tests/compact-0044-in.jsonld
test-suite/tests/compact-0044-out.jsonld
test-suite/tests/compact-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0044-context.jsonld	Mon Mar 11 19:56:46 2013 +0100
@@ -0,0 +1,8 @@
+{
+  "@context": {
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "knows": { "@id": "http://xmlns.com/foaf/0.1/knows", "@type": "@id" },
+    "knowsVocab": { "@id": "http://xmlns.com/foaf/0.1/knows", "@type": "@vocab" },
+    "DefinedTerm": "http://example.com/people/DefinedTerm"
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0044-in.jsonld	Mon Mar 11 19:56:46 2013 +0100
@@ -0,0 +1,16 @@
+[
+  {
+    "@id": "http://example.com/people/markus",
+    "@reverse": {
+      "http://xmlns.com/foaf/0.1/knows": [
+        {
+          "@id": "http://example.com/people/dave"
+        },
+        {
+          "@id": "http://example.com/people/DefinedTerm"
+        }
+      ]
+    },
+    "http://xmlns.com/foaf/0.1/name": [ { "@value": "Markus Lanthaler" } ]
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0044-out.jsonld	Mon Mar 11 19:56:46 2013 +0100
@@ -0,0 +1,14 @@
+{
+  "@context": {
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "knows": { "@id": "http://xmlns.com/foaf/0.1/knows", "@type": "@id" },
+    "knowsVocab": { "@id": "http://xmlns.com/foaf/0.1/knows", "@type": "@vocab" },
+    "DefinedTerm": "http://example.com/people/DefinedTerm"
+  },
+  "@id": "http://example.com/people/markus",
+  "name": "Markus Lanthaler",
+  "@reverse": {
+    "knows": "http://example.com/people/dave",
+    "knowsVocab": "DefinedTerm"
+  }
+}
--- a/test-suite/tests/compact-manifest.jsonld	Mon Mar 11 19:33:31 2013 +0100
+++ b/test-suite/tests/compact-manifest.jsonld	Mon Mar 11 19:56:46 2013 +0100
@@ -266,6 +266,12 @@
       "expect": "compact-0043-out.jsonld"
     }, {
       "@type": ["test:TestCase", "jld:CompactTest"],
+      "name": "Prefer properties with @type: @vocab in reverse-maps if the value can be compacted to a term",
+      "input": "compact-0044-in.jsonld",
+      "context": "compact-0044-context.jsonld",
+      "expect": "compact-0044-out.jsonld"
+    }, {
+      "@type": ["test:TestCase", "jld:CompactTest"],
       "name": "Values of @id are transformed to relative IRIs, terms are ignored",
       "input": "compact-0045-in.jsonld",
       "context": "compact-0045-context.jsonld",