bnodes relabeled by nodeMapGeneration are not relabeled again by toRDF
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Fri, 07 Jun 2013 12:13:38 +0200
changeset 1695 d873c867681f
parent 1694 f22c505d8e67
child 1696 2f264db7ec31
bnodes relabeled by nodeMapGeneration are not relabeled again by toRDF

See discussion starting at https://github.com/json-ld/json-ld.org/commit/177b5041c9fc145d84ddb307b8f11c86c805fca2#commitcomment-3373786
test-suite/tests/toRdf-0036-in.jsonld
test-suite/tests/toRdf-0036-out.nq
test-suite/tests/toRdf-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0036-in.jsonld	Fri Jun 07 12:13:38 2013 +0200
@@ -0,0 +1,7 @@
+{
+  "@id": "http://example.com/",
+  "ex:prop1": {
+    "@list": [ { "@id": "_:x1" }, { "@id": "_:x2" } ]
+  },
+  "ex:prop2": { "@id": "_:x3" }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/toRdf-0036-out.nq	Fri Jun 07 12:13:38 2013 +0200
@@ -0,0 +1,6 @@
+<http://example.com/> <ex:prop1> _:b3 .
+<http://example.com/> <ex:prop2> _:b2 .
+_:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b0 .
+_:b3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:b4 .
+_:b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> _:b1 .
+_:b4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> <http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
--- a/test-suite/tests/toRdf-manifest.jsonld	Thu Jun 06 21:59:07 2013 -0400
+++ b/test-suite/tests/toRdf-manifest.jsonld	Fri Jun 07 12:13:38 2013 +0200
@@ -244,6 +244,12 @@
       "input": "toRdf-0035-in.jsonld",
       "expect": "toRdf-0035-out.nq"
     }, {
+      "@id": "#t0036",
+      "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
+      "name": "The toRDF algorithm does not relabel blank nodes; it reuses the counter from the nodeMapGeneration to generate new ones",
+      "input": "toRdf-0036-in.jsonld",
+      "expect": "toRdf-0036-out.nq"
+    }, {
       "@id": "#t0041",
       "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"],
       "name": "drop free-floating nodes",