You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [1]: importrdflibINFO:rdflib:RDFLibVersion: 4.2.1-devIn [2]: rdflib.util.from_n3('"42"^^<http://www.w3.org/2001/XMLSchema#integer>')
WARNING:rdflib.term:<http://www.w3.org/2001/XMLSchema#integer> does not look like a valid URI, trying to serialize this will break.Out[2]: rdflib.term.Literal(u'42', datatype=rdflib.term.URIRef(u'<http://www.w3.org/2001/XMLSchema#integer>'))
problem here is that the < is passed into URIRef() as part of the URI.
In [3]: rdflib.util.from_n3('"42"^^xsd:integer')
Out[3]: rdflib.term.Literal(u'42', datatype=rdflib.term.URIRef(u'xsd:integer'))
problem is that standard xsd datatypes aren't resolved correctly but instead passed into URIRef() as is.
In [4]: rdflib.util.from_n3('"42"^^http://www.w3.org/2001/XMLSchema#integer')
Out[4]: rdflib.term.Literal(u'42', datatype=rdflib.term.URIRef(u'http://www.w3.org/2001/XMLSchema#integer'))
In [5]: rdflib.Literal(42) ==rdflib.util.from_n3('"42"^^http://www.w3.org/2001/XMLSchema#integer')
Out[5]: True
this is actually invalid n3 but the only thing that returns the expected Literal
More fun (round-tripping):
In [6]: rdflib.util.from_n3(rdflib.Literal(42).n3()).n3()
WARNING:rdflib.term:<http://www.w3.org/2001/XMLSchema#integer> does not look like a valid URI, trying to serialize this will break.Out[6]: u'"42"^^<<http://www.w3.org/2001/XMLSchema#integer>>'
The text was updated successfully, but these errors were encountered:
problem here is that the
<
is passed intoURIRef()
as part of the URI.problem is that standard xsd datatypes aren't resolved correctly but instead passed into
URIRef()
as is.this is actually invalid n3 but the only thing that returns the expected
Literal
More fun (round-tripping):
The text was updated successfully, but these errors were encountered: