Open LorenzBuehmann opened 9 years ago
We are looking into this reported issue ...
@LorenzBuehmann: Have you resolved this issue somehow?
It seems that Virtuoso's serialization of xsd:double
to Turtle is broken. While serializing the following query to N-Triples or RDF/XML preserves the xsd:double
data type, Turtle export casts it to xsd:decimal
:
PREFIX : <http://example.com/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
CONSTRUCT {
[] :p "1.23"^^xsd:double.
}
WHERE {}
@jindrichmynarz No, I just reported this bug, but I don't know whether this has been fixed in any new versions of Virtuoso.
At least the version on which DBpedia is hosted still does return the implicit xsd:decimal
for the Turtle format.
this issue is on the agenda for development to look into ...
Eventually, I worked around this by requesting data in N-Triples instead of Turtle, since xsd:double
s are correctly preserved in this serialization.
@jindrichmynarz I know that this works for N-Triples (see my initial post). That's why I reported this issue as I've seen that there is a difference between the N-Triples and Turtle serialization. I hope that it will be fixed together with the more critical https://github.com/openlink/virtuoso-opensource/issues/569 in the next version.
Tested against officila DBpedia endpoint (http://dbpedia.org/sparql)
When retrieving triples via CONSTRUCT queries, and among those triples there are literal values that are supposed to be xsd:double, depending on the chosen return type (TURTLE vs. N-TRIPLES) the literals have a different return type.
A test query is
TURTLE result:
N-TRIPLE result:
Literals like 1.3 are supposed to be of type xsd:decimal in Turtle.
When querying for resources with the given literal, xsd:double has to be used, so I guess there is a bug in the Turtle serializer.