rdfpipe adds a graph name to triples in the default graph, consequently breaking round tripping · Issue #1804 · RDFLib/rdflib (original) (raw)

I would expect to be able to round-trip quads with rdfpipe, but this does not work because rdfpipe labels quads in the default graph with a graph name and then serializes them with the injected graph name.

~/sw/d/github.com/iafork/rdflib.cleanish $ cat ./test/w3c/trig/trig-turtle-03.trig

Turtle is TriG

prefix : http://example/

[ :p 123 ; :q 456 ] :r 1 .

~/sw/d/github.com/iafork/rdflib.cleanish $ pipx run --spec git+https://github.com/RDFLib/rdflib.git@master#egg=rdflib rdfpipe -i trig -o nquads ./test/w3c/trig/trig-turtle-03.trig _:n33872095eabf41d58f85dc3a7c672883b1 http://example/p "123"^^http://www.w3.org/2001/XMLSchema#integer file:///home/iwana/sw/d/github.com/iafork/rdflib.cleanish/test/w3c/trig/trig-turtle-03.trig . _:n33872095eabf41d58f85dc3a7c672883b1 http://example/q "456"^^http://www.w3.org/2001/XMLSchema#integer file:///home/iwana/sw/d/github.com/iafork/rdflib.cleanish/test/w3c/trig/trig-turtle-03.trig . _:n33872095eabf41d58f85dc3a7c672883b1 http://example/r "1"^^http://www.w3.org/2001/XMLSchema#integer file:///home/iwana/sw/d/github.com/iafork/rdflib.cleanish/test/w3c/trig/trig-turtle-03.trig .

~/sw/d/github.com/iafork/rdflib.cleanish $ pipx run --spec git+https://github.com/RDFLib/rdflib.git@master#egg=rdflib rdfpipe -i trig -o nquads ./test/w3c/trig/trig-turtle-03.trig | pipx run --spec git+https://github.com/RDFLib/rdflib.git@master#egg=rdflib rdfpipe -i nquads -o trig -

@prefix ns1: file:///home/iwana/sw/d/github.com/iafork/rdflib.cleanish/test/w3c/trig/ . @prefix ns2: http://example/ . @prefix xsd: http://www.w3.org/2001/XMLSchema# .

ns1:trig-turtle-03.trig { [] ns2:p 123 ; ns2:q 456 ; ns2:r 1 . }