Test conversion of list of lists in RDF to JSON-LD
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Mon, 06 May 2013 10:57:42 +0200
changeset 1634 e41b7a61c25f
parent 1633 51f7620f28ac
child 1635 175866ffa894
Test conversion of list of lists in RDF to JSON-LD
test-suite/tests/fromRdf-0008-in.nq
test-suite/tests/fromRdf-0008-out.jsonld
test-suite/tests/fromRdf-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0008-in.nq	Mon May 06 10:57:42 2013 +0200
@@ -0,0 +1,28 @@
+<http://example.com> <http://example.com/property> _:outerlist .
+_:outerlist <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:lista .
+_:outerlist <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:listb .
+
+_:lista <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a1" .
+_:lista <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:a2 .
+_:a2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a2" .
+_:a2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:a3 .
+_:a3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a3" .
+_:a3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+_:listc <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:c1 .
+_:listc <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:c1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c1" .
+_:c1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:c2 .
+_:c2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c2" .
+_:c2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:c3 .
+_:c3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c3" .
+_:c3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+
+_:listb <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b1 .
+_:listb <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:listc .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b1" .
+_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b2 .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b2" .
+_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b3 .
+_:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b3" .
+_:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0008-out.jsonld	Mon May 06 10:57:42 2013 +0200
@@ -0,0 +1,59 @@
+[
+  {
+    "@id": "_:a2",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "a2" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "_:a3" } ]
+  },
+  {
+    "@id": "_:a3",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "a3" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" } ]
+  },
+  {
+    "@id": "_:b1",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "b1" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "_:b2" } ]
+  },
+  {
+    "@id": "_:b2",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "b2" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "_:b3" } ]
+  },
+  {
+    "@id": "_:b3",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "b3" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" } ]
+  },
+  {
+    "@id": "_:c1",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "c1" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "_:c2" } ]
+  },
+  {
+    "@id": "_:c2",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "c2" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "_:c3" } ]
+  },
+  {
+    "@id": "_:c3",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "c3" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" } ]
+  },
+  {
+    "@id": "_:lista",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "a1" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "_:a2" } ]
+  },
+  {
+    "@id": "http://example.com",
+    "http://example.com/property": [
+      {
+        "@list": [
+          { "@id": "_:lista" } ,
+          { "@id": "_:b1" } ,
+          { "@id": "_:c1" }
+        ]
+      }
+    ]
+  }
+]
--- a/test-suite/tests/fromRdf-manifest.jsonld	Mon May 06 10:39:56 2013 +0200
+++ b/test-suite/tests/fromRdf-manifest.jsonld	Mon May 06 10:57:42 2013 +0200
@@ -55,6 +55,13 @@
       "purpose": "Testing @graph recursion.",
       "input": "fromRdf-0007-in.nq",
       "expect": "fromRdf-0007-out.jsonld"
+    }, {
+      "@id": "#t0008",
+      "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"],
+      "name": "Conversion of lists of lists (the triples in the input are only partially ordered on purpose)",
+      "purpose": "Testing @graph recursion.",
+      "input": "fromRdf-0008-in.nq",
+      "expect": "fromRdf-0008-out.jsonld"
     }
   ]
 }