Add simpler @type: @vocab tests before complex cases.
--- a/test-suite/tests/compact-0053-context.jsonld Wed Feb 13 13:57:00 2013 +0100
+++ b/test-suite/tests/compact-0053-context.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -1,11 +1,5 @@
{
"@context": {
- "name": "http://xmlns.com/foaf/0.1/name",
- "homepageID": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id" },
- "homepageV": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@vocab" },
- "linkID": { "@id": "http://example.com/link", "@type": "@id" },
- "linkV": { "@id": "http://example.com/link", "@type": "@vocab" },
- "MarkusHomepage": "http://www.markus-lanthaler.com/",
- "relative-iri": "http://example.com/error-if-this-is-used-for-link"
+ "term": {"@id": "http://example.org/term", "@type": "@vocab"}
}
}
--- a/test-suite/tests/compact-0053-in.jsonld Wed Feb 13 13:57:00 2013 +0100
+++ b/test-suite/tests/compact-0053-in.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -1,15 +1,3 @@
-{
- "@context": {
- "name": "http://xmlns.com/foaf/0.1/name",
- "homepageID": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id" },
- "homepageV": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@vocab" },
- "linkID": { "@id": "http://example.com/link", "@type": "@id" },
- "linkV": { "@id": "http://example.com/link", "@type": "@vocab" },
- "MarkusHomepage": "http://www.markus-lanthaler.com/",
- "relative-iri": "http://example.com/error-if-this-is-used-for-link"
- },
- "@id": "http://me.markus-lanthaler.com/",
- "name": "Markus Lanthaler",
- "homepageV": "MarkusHomepage",
- "linkID": "relative-iri"
-}
+[{
+ "http://example.org/term": [{"@id": "http://example.org/enum"}]
+}]
--- a/test-suite/tests/compact-0053-out.jsonld Wed Feb 13 13:57:00 2013 +0100
+++ b/test-suite/tests/compact-0053-out.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -1,15 +1,6 @@
{
"@context": {
- "name": "http://xmlns.com/foaf/0.1/name",
- "homepageID": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id" },
- "homepageV": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@vocab" },
- "linkID": { "@id": "http://example.com/link", "@type": "@id" },
- "linkV": { "@id": "http://example.com/link", "@type": "@vocab" },
- "MarkusHomepage": "http://www.markus-lanthaler.com/",
- "relative-iri": "http://example.com/error-if-this-is-used-for-link"
+ "term": {"@id": "http://example.org/term", "@type": "@vocab"}
},
- "@id": "http://me.markus-lanthaler.com/",
- "name": "Markus Lanthaler",
- "homepageV": "MarkusHomepage",
- "linkID": "relative-iri"
+ "term": "http://example.org/enum"
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0054-context.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,6 @@
+{
+ "@context": {
+ "term": {"@id": "http://example.org/term", "@type": "@vocab"},
+ "enum": {"@id": "http://example.org/enum"}
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0054-in.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,3 @@
+[{
+ "http://example.org/term": [{"@id": "http://example.org/enum"}]
+}]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0054-out.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,7 @@
+{
+ "@context": {
+ "term": {"@id": "http://example.org/term", "@type": "@vocab"},
+ "enum": {"@id": "http://example.org/enum"}
+ },
+ "term": "enum"
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0055-context.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,6 @@
+{
+ "@context": {
+ "term": {"@id": "http://example.org/term", "@type": "@vocab"},
+ "enum": {"@id": "http://example.org/enum"}
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0055-in.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,7 @@
+{
+ "@context": {
+ "term": {"@id": "http://example.org/term", "@type": "@vocab"},
+ "enum": {"@id": "http://example.org/enum"}
+ },
+ "term": "enum"
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0055-out.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,7 @@
+{
+ "@context": {
+ "term": {"@id": "http://example.org/term", "@type": "@vocab"},
+ "enum": {"@id": "http://example.org/enum"}
+ },
+ "term": "enum"
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0056-context.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,7 @@
+{
+ "@context": {
+ "term": {"@id": "http://example.org/term", "@type": "@vocab"},
+ "doNotSelect": {"@id": "http://example.org/term"},
+ "enum": {"@id": "http://example.org/enum"}
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0056-in.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,3 @@
+[{
+ "http://example.org/term": [{"@id": "http://example.org/enum"}]
+}]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0056-out.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,8 @@
+{
+ "@context": {
+ "term": {"@id": "http://example.org/term", "@type": "@vocab"},
+ "doNotSelect": {"@id": "http://example.org/term"},
+ "enum": {"@id": "http://example.org/enum"}
+ },
+ "term": "enum"
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0057-context.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,11 @@
+{
+ "@context": {
+ "name": "http://xmlns.com/foaf/0.1/name",
+ "homepageID": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id" },
+ "homepageV": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@vocab" },
+ "linkID": { "@id": "http://example.com/link", "@type": "@id" },
+ "linkV": { "@id": "http://example.com/link", "@type": "@vocab" },
+ "MarkusHomepage": "http://www.markus-lanthaler.com/",
+ "relative-iri": "http://example.com/error-if-this-is-used-for-link"
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0057-in.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,15 @@
+{
+ "@context": {
+ "name": "http://xmlns.com/foaf/0.1/name",
+ "homepageID": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id" },
+ "homepageV": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@vocab" },
+ "linkID": { "@id": "http://example.com/link", "@type": "@id" },
+ "linkV": { "@id": "http://example.com/link", "@type": "@vocab" },
+ "MarkusHomepage": "http://www.markus-lanthaler.com/",
+ "relative-iri": "http://example.com/error-if-this-is-used-for-link"
+ },
+ "@id": "http://me.markus-lanthaler.com/",
+ "name": "Markus Lanthaler",
+ "homepageV": "MarkusHomepage",
+ "linkID": "relative-iri"
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0057-out.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,15 @@
+{
+ "@context": {
+ "name": "http://xmlns.com/foaf/0.1/name",
+ "homepageID": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id" },
+ "homepageV": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@vocab" },
+ "linkID": { "@id": "http://example.com/link", "@type": "@id" },
+ "linkV": { "@id": "http://example.com/link", "@type": "@vocab" },
+ "MarkusHomepage": "http://www.markus-lanthaler.com/",
+ "relative-iri": "http://example.com/error-if-this-is-used-for-link"
+ },
+ "@id": "http://me.markus-lanthaler.com/",
+ "name": "Markus Lanthaler",
+ "homepageV": "MarkusHomepage",
+ "linkID": "relative-iri"
+}
--- a/test-suite/tests/compact-manifest.jsonld Wed Feb 13 13:57:00 2013 +0100
+++ b/test-suite/tests/compact-manifest.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -320,10 +320,34 @@
"expect": "compact-0052-out.jsonld"
}, {
"@type": ["test:TestCase", "jld:CompactTest"],
- "name": "Round tripping @type: @vocab and @type: @id",
+ "name": "Compact to term with @type: @vocab",
"input": "compact-0053-in.jsonld",
"context": "compact-0053-context.jsonld",
"expect": "compact-0053-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:CompactTest"],
+ "name": "Compact @id to term with @type: @vocab",
+ "input": "compact-0054-in.jsonld",
+ "context": "compact-0054-context.jsonld",
+ "expect": "compact-0054-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:CompactTest"],
+ "name": "Round tripping @type: @vocab",
+ "input": "compact-0055-in.jsonld",
+ "context": "compact-0055-context.jsonld",
+ "expect": "compact-0055-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:CompactTest"],
+ "name": "Prefer term with @type: @vocab",
+ "input": "compact-0056-in.jsonld",
+ "context": "compact-0056-context.jsonld",
+ "expect": "compact-0056-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:CompactTest"],
+ "name": "Complex round tripping @type: @vocab and @type: @id",
+ "input": "compact-0057-in.jsonld",
+ "context": "compact-0057-context.jsonld",
+ "expect": "compact-0057-out.jsonld"
}
]
}
--- a/test-suite/tests/expand-0053-in.jsonld Wed Feb 13 13:57:00 2013 +0100
+++ b/test-suite/tests/expand-0053-in.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -1,13 +1,6 @@
{
"@context": {
- "name": "http://xmlns.com/foaf/0.1/name",
- "homepage": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@vocab" },
- "link": { "@id": "http://example.com/link", "@type": "@id" },
- "MarkusHomepage": "http://www.markus-lanthaler.com/",
- "relative-iri": "http://example.com/error-if-this-is-used-for-link"
+ "term": {"@id": "http://example.org/term", "@type": "@vocab"}
},
- "@id": "http://me.markus-lanthaler.com/",
- "name": "Markus Lanthaler",
- "homepage": "MarkusHomepage",
- "link": "relative-iri"
+ "term": "http://example.org/enum"
}
--- a/test-suite/tests/expand-0053-out.jsonld Wed Feb 13 13:57:00 2013 +0100
+++ b/test-suite/tests/expand-0053-out.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -1,8 +1,3 @@
-[
- {
- "@id": "http://me.markus-lanthaler.com/",
- "http://xmlns.com/foaf/0.1/homepage": [ { "@id": "http://www.markus-lanthaler.com/" } ],
- "http://example.com/link": [ { "@id": "http://json-ld.org/test-suite/tests/relative-iri" } ],
- "http://xmlns.com/foaf/0.1/name": [ { "@value": "Markus Lanthaler" } ]
- }
-]
+[{
+ "http://example.org/term": [{"@id": "http://example.org/enum"}]
+}]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0054-in.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,7 @@
+{
+ "@context": {
+ "term": {"@id": "http://example.org/term", "@type": "@vocab"},
+ "enum": {"@id": "http://example.org/enum"}
+ },
+ "term": "enum"
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0054-out.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,3 @@
+[{
+ "http://example.org/term": [{"@id": "http://example.org/enum"}]
+}]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0055-in.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,7 @@
+{
+ "@context": {
+ "@vocab": "http://example.org/",
+ "term": {"@id": "http://example.org/term", "@type": "@vocab"}
+ },
+ "term": "enum"
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0055-out.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,3 @@
+[{
+ "http://example.org/term": [{"@id": "http://example.org/enum"}]
+}]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0056-in.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,13 @@
+{
+ "@context": {
+ "name": "http://xmlns.com/foaf/0.1/name",
+ "homepage": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@vocab" },
+ "link": { "@id": "http://example.com/link", "@type": "@id" },
+ "MarkusHomepage": "http://www.markus-lanthaler.com/",
+ "relative-iri": "http://example.com/error-if-this-is-used-for-link"
+ },
+ "@id": "http://me.markus-lanthaler.com/",
+ "name": "Markus Lanthaler",
+ "homepage": "MarkusHomepage",
+ "link": "relative-iri"
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0056-out.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -0,0 +1,8 @@
+[
+ {
+ "@id": "http://me.markus-lanthaler.com/",
+ "http://xmlns.com/foaf/0.1/homepage": [ { "@id": "http://www.markus-lanthaler.com/" } ],
+ "http://example.com/link": [ { "@id": "http://json-ld.org/test-suite/tests/relative-iri" } ],
+ "http://xmlns.com/foaf/0.1/name": [ { "@value": "Markus Lanthaler" } ]
+ }
+]
--- a/test-suite/tests/expand-manifest.jsonld Wed Feb 13 13:57:00 2013 +0100
+++ b/test-suite/tests/expand-manifest.jsonld Wed Feb 13 15:40:28 2013 -0500
@@ -268,9 +268,26 @@
"expect": "expand-0052-out.jsonld"
}, {
"@type": ["test:TestCase", "jld:ExpandTest"],
- "name": "Use terms with @type: @vocab but not with @type: @id",
+ "name": "Use term 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",
+ "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",
+ "input": "expand-0055-in.jsonld",
+ "context": "expand-0055-context.jsonld",
+ "expect": "expand-0055-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:ExpandTest"],
+ "name": "Complex use terms with @type: @vocab but not with @type: @id",
+ "input": "expand-0056-in.jsonld",
+ "expect": "expand-0056-out.jsonld"
}
]
}