Add tests for aliased @graph
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Fri, 06 Apr 2012 22:55:35 +0800
changeset 465 b039cf8abf56
parent 464 1e59804d1a2e
child 466 84ede36c082f
Add tests for aliased @graph
test-suite/tests/compact-0014-context.jsonld
test-suite/tests/compact-0014-in.jsonld
test-suite/tests/compact-0014-out.jsonld
test-suite/tests/compact-manifest.jsonld
test-suite/tests/expand-0017-in.jsonld
test-suite/tests/expand-0017-out.jsonld
test-suite/tests/expand-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0014-context.jsonld	Fri Apr 06 22:55:35 2012 +0800
@@ -0,0 +1,7 @@
+{
+  "@context": {
+    "homepage": {"@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id"},
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "data": "@graph"
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0014-in.jsonld	Fri Apr 06 22:55:35 2012 +0800
@@ -0,0 +1,9 @@
+[
+  {
+    "http://xmlns.com/foaf/0.1/homepage": {
+      "@id": "http://john.doe.org/"
+    },
+    "http://xmlns.com/foaf/0.1/name": "John Doe"
+  },
+  {}
+]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/compact-0014-out.jsonld	Fri Apr 06 22:55:35 2012 +0800
@@ -0,0 +1,18 @@
+{
+  "@context": {
+    "homepage": {
+      "@id": "http://xmlns.com/foaf/0.1/homepage",
+      "@type": "@id"
+    },
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "data": "@graph"
+  },
+  "data": [
+    {
+      "homepage": "http://john.doe.org/",
+      "name": "John Doe"
+    },
+    {
+    }
+  ]
+}
--- a/test-suite/tests/compact-manifest.jsonld	Fri Apr 06 22:21:11 2012 +0800
+++ b/test-suite/tests/compact-manifest.jsonld	Fri Apr 06 22:55:35 2012 +0800
@@ -83,5 +83,11 @@
     "input": "compact-0013-in.jsonld",
     "context": "compact-0013-context.jsonld",
     "expect": "compact-0013-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:CompactTest"],
+    "name": "array to aliased @graph",
+    "input": "compact-0014-in.jsonld",
+    "context": "compact-0014-context.jsonld",
+    "expect": "compact-0014-out.jsonld"
   }]
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0017-in.jsonld	Fri Apr 06 22:55:35 2012 +0800
@@ -0,0 +1,45 @@
+{
+  "@context": {
+    "authored": {
+      "@id": "http://example.org/vocab#authored",
+      "@type": "@id"
+    },
+    "contains": {
+      "@id": "http://example.org/vocab#contains",
+      "@type": "@id"
+    },
+    "contributor": "http://purl.org/dc/elements/1.1/contributor",
+    "description": "http://purl.org/dc/elements/1.1/description",
+    "name": "http://xmlns.com/foaf/0.1/name",
+    "title": {
+      "@id": "http://purl.org/dc/elements/1.1/title"
+    },
+    "id": "@id",
+    "data": "@graph"
+  },
+  "data": [
+    {
+      "id": "http://example.org/test#chapter",
+      "description": "Fun",
+      "title": "Chapter One"
+    },
+    {
+      "@id": "http://example.org/test#jane",
+      "authored": "http://example.org/test#chapter",
+      "name": "Jane"
+    },
+    {
+      "id": "http://example.org/test#john",
+      "name": "John"
+    },
+    {
+      "id": "http://example.org/test#library",
+      "contains": {
+        "@id": "http://example.org/test#book",
+        "contains": "http://example.org/test#chapter",
+        "contributor": "Writer",
+        "title": "My Book"
+      }
+    }
+  ]
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0017-out.jsonld	Fri Apr 06 22:55:35 2012 +0800
@@ -0,0 +1,29 @@
+[
+  {
+    "@id": "http://example.org/test#chapter",
+    "http://purl.org/dc/elements/1.1/description": ["Fun"],
+    "http://purl.org/dc/elements/1.1/title": ["Chapter One"]
+  },
+  {
+    "@id": "http://example.org/test#jane",
+    "http://example.org/vocab#authored": [{
+      "@id": "http://example.org/test#chapter"
+    }],
+    "http://xmlns.com/foaf/0.1/name": ["Jane"]
+  },
+  {
+    "@id": "http://example.org/test#john",
+    "http://xmlns.com/foaf/0.1/name": ["John"]
+  },
+  {
+    "@id": "http://example.org/test#library",
+    "http://example.org/vocab#contains": [{
+      "@id": "http://example.org/test#book",
+      "http://example.org/vocab#contains": [{
+        "@id": "http://example.org/test#chapter"
+      }],
+      "http://purl.org/dc/elements/1.1/contributor": ["Writer"],
+      "http://purl.org/dc/elements/1.1/title": ["My Book"]
+    }]
+  }
+]
\ No newline at end of file
--- a/test-suite/tests/expand-manifest.jsonld	Fri Apr 06 22:21:11 2012 +0800
+++ b/test-suite/tests/expand-manifest.jsonld	Fri Apr 06 22:55:35 2012 +0800
@@ -84,5 +84,10 @@
     "name": "context reset",
     "input": "expand-0016-in.jsonld",
     "expect": "expand-0016-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:ExpandTest"],
+    "name": "@graph and @id aliased",
+    "input": "expand-0017-in.jsonld",
+    "expect": "expand-0017-out.jsonld"
   }]
 }