-
Notifications
You must be signed in to change notification settings - Fork 587
Closed
Labels
bugSomething isn't workingSomething isn't workingformat: TurtleRelated to the Turtle format.Related to the Turtle format.serializationRelated to serialization.Related to serialization.
Description
Some cURIs cannot be parsed with RDFlib, even those produced by RDFlib.
For example:
If we have the following RDF/TURTLE:
@prefix ex: <https://example.org/term#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix dbr: <http://dbpedia.org/resource/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://example.org/entity> ex:anchorOf "This press"^^xsd:string ;
a <http://dbpedia.org/resource/This_(journal)> .
We load the TTL using g.parse(data=ttl) and we serialize it with g.serialize() we get:
@prefix dbr: <http://dbpedia.org/resource/> .
@prefix ex: <https://example.org/term#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://example.org/entity> a dbr:This_(journal) ;
ex:anchorOf "This press"^^xsd:string .
Then, if we load the output again with g.parse(data=ttl, format="turtle"), we get the following errorr:
rdflib.plugins.parsers.notation3.BadSyntax: at line 5 of <>:
Bad syntax (expected '.' or '}' or ']' at end of statement) at ^ in:
"...b'/2001/XMLSchema#> .\n\nhttp://example.org/entity a dbr:This_'^b'(journal) ;\n ex:anchorOf "This press"^^xsd:string .'"
The error is cause by dbr:This_(journal), more presicely by the '(' and ')'. It seems RDFlib does not like its own output.
Any ideas on what may be happing here?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingformat: TurtleRelated to the Turtle format.Related to the Turtle format.serializationRelated to serialization.Related to serialization.