Add test for @value objects within a @set using keyword aliases
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Sat, 31 Mar 2012 17:16:48 +0800
changeset 442 398e23d00902
parent 441 2e7621ef011f
child 443 1b367646edd9
Add test for @value objects within a @set using keyword aliases
test-suite/tests/expand-0014-in.jsonld
test-suite/tests/expand-0014-out.jsonld
test-suite/tests/expand-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0014-in.jsonld	Sat Mar 31 17:16:48 2012 +0800
@@ -0,0 +1,50 @@
+{
+  "@context": {
+    "ex": "http://example.org/test#",
+    "property1": {
+      "@id": "http://example.org/test#property1",
+      "@type": "@id"
+    },
+    "property2": {
+      "@id": "ex:property2",
+      "@type": "@id"
+    },
+    "uri": "@id",
+    "set": "@set",
+    "value": "@value",
+    "type": "@type",
+    "xsd": { "@id": "http://www.w3.org/2001/XMLSchema#" }
+  },
+  "property1": {
+    "uri": "ex:example2",
+    "http://example.org/test#property4": "foo"
+  },
+  "property2": "http://example.org/test#example3",
+  "http://example.org/test#property3": {
+    "uri": "http://example.org/test#example4"
+  },
+  "ex:property4": {
+    "uri": "ex:example4",
+    "ex:property5": [
+      {
+        "set": [
+          {
+          "value": "2012-03-31",
+          "type": "xsd:date"
+          }
+        ]
+      }
+    ]
+  },
+  "ex:property6": [
+    {
+      "set": [
+        {
+        "value": null,
+        "type": "xsd:date"
+        }
+      ]
+    }
+  ],
+  "uri": "http://example.org/test#example1"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0014-out.jsonld	Sat Mar 31 17:16:48 2012 +0800
@@ -0,0 +1,31 @@
+[
+  {
+    "http://example.org/test#property1": [
+      {
+        "@id": "http://example.org/test#example2",
+        "http://example.org/test#property4": [
+          "foo"
+        ]
+      }
+    ],
+    "http://example.org/test#property2": [
+      { "@id": "http://example.org/test#example3" }
+    ],
+    "http://example.org/test#property3": [
+      { "@id": "http://example.org/test#example4" }
+    ],
+    "http://example.org/test#property4": [
+      {
+        "@id": "http://example.org/test#example4",
+        "http://example.org/test#property5": [
+          {
+            "@value": "2012-03-31",
+            "@type": "http://www.w3.org/2001/XMLSchema#date"
+          }
+        ]
+      }
+    ],
+    "http://example.org/test#property6": [],
+    "@id": "http://example.org/test#example1"
+  }
+]
--- a/test-suite/tests/expand-manifest.jsonld	Sat Mar 31 16:26:10 2012 +0800
+++ b/test-suite/tests/expand-manifest.jsonld	Sat Mar 31 17:16:48 2012 +0800
@@ -69,5 +69,10 @@
     "name": "expand already expanded",
     "input": "expand-0013-in.jsonld",
     "expect": "expand-0013-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:ExpandTest"],
+    "name": "@set of @value objects with keyword aliases",
+    "input": "expand-0014-in.jsonld",
+    "expect": "expand-0014-out.jsonld"
   }]
 }