Add more tests for not well-formed lists
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Mon, 06 May 2013 11:37:47 +0200
changeset 1637 11b0debb602d
parent 1636 9f1456144d47
child 1638 fe8c9e73fc1f
Add more tests for not well-formed lists
test-suite/tests/fromRdf-0013-in.nq
test-suite/tests/fromRdf-0013-out.jsonld
test-suite/tests/fromRdf-0014-in.nq
test-suite/tests/fromRdf-0014-out.jsonld
test-suite/tests/fromRdf-0015-in.nq
test-suite/tests/fromRdf-0015-out.jsonld
test-suite/tests/fromRdf-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0013-in.nq	Mon May 06 11:37:47 2013 +0200
@@ -0,0 +1,8 @@
+<http://example.com> <http://example.com/property> _:a .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b1" .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b2" .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:c .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:c <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-0013-out.jsonld	Mon May 06 11:37:47 2013 +0200
@@ -0,0 +1,24 @@
+[
+  {
+    "@id": "_:a",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "a" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "_:b" } ]
+  },
+  {
+    "@id": "_:b",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [
+      { "@value": "b1" },
+      { "@value": "b2" }
+    ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "_:c" } ]
+  },
+  {
+    "@id": "_:c",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "c" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" } ]
+  },
+  {
+    "@id": "http://example.com",
+    "http://example.com/property":  [ { "@id": "_:a" } ]
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0014-in.nq	Mon May 06 11:37:47 2013 +0200
@@ -0,0 +1,10 @@
+<http://example.com> <http://example.com/property> _:a .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "b" .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:c .
+_:b <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:d .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "c" .
+_:c <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
+_:d <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "d" .
+_:d <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-0014-out.jsonld	Mon May 06 11:37:47 2013 +0200
@@ -0,0 +1,29 @@
+[
+  {
+    "@id": "_:a",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "a" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "_:b" } ]
+  },
+  {
+    "@id": "_:b",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "b" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [
+      { "@id": "_:c" },
+      { "@id": "_:d" }
+    ]
+  },
+  {
+    "@id": "_:c",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "c" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" } ]
+  },
+  {
+    "@id": "_:d",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "d" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" } ]
+  },
+  {
+    "@id": "http://example.com",
+    "http://example.com/property":  [ { "@id": "_:a" } ]
+  }
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0015-in.nq	Mon May 06 11:37:47 2013 +0200
@@ -0,0 +1,3 @@
+<http://example.com> <http://example.com/property> _:a .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> "a" .
+_:a <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> "b" .
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0015-out.jsonld	Mon May 06 11:37:47 2013 +0200
@@ -0,0 +1,11 @@
+[
+  {
+    "@id": "_:a",
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "a" } ],
+    "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest":  [ { "@value": "b" } ]
+  },
+  {
+    "@id": "http://example.com",
+    "http://example.com/property":  [ { "@id": "_:a" } ]
+  }
+]
--- a/test-suite/tests/fromRdf-manifest.jsonld	Mon May 06 11:30:58 2013 +0200
+++ b/test-suite/tests/fromRdf-manifest.jsonld	Mon May 06 11:37:47 2013 +0200
@@ -90,6 +90,27 @@
       "purpose": "Testing list conversion.",
       "input": "fromRdf-0012-in.nq",
       "expect": "fromRdf-0012-out.jsonld"
+    }, {
+      "@id": "#t0013",
+      "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"],
+      "name": "Do not convert lists to @list if nodes contain more than one value for rdf:first",
+      "purpose": "Testing list conversion.",
+      "input": "fromRdf-0013-in.nq",
+      "expect": "fromRdf-0013-out.jsonld"
+    }, {
+      "@id": "#t0014",
+      "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"],
+      "name": "Do not convert lists to @list if nodes contain more than one value for rdf:rest",
+      "purpose": "Testing list conversion.",
+      "input": "fromRdf-0014-in.nq",
+      "expect": "fromRdf-0014-out.jsonld"
+    }, {
+      "@id": "#t0015",
+      "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"],
+      "name": "Do not convert lists to @list if a list node's rdf:rest is not an IRI",
+      "purpose": "Testing list conversion.",
+      "input": "fromRdf-0015-in.nq",
+      "expect": "fromRdf-0015-out.jsonld"
     }
   ]
 }