Skip to content

rdfpipe adds a graph name to triples in the default graph, consequently breaking round tripping #1804

@aucampia

Description

@aucampia

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 .
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingconcept: RDF datasetRelates to the RDF datasets concept.coreRelates to core functionality of RDFLib, i.e. `rdflib.{graph,store,term}`critical

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions