I am using Virtuoso Opensource 7.2.4 and have a dataset which consists of some data, for example:
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix ap: <http://vocab.linkeddata.es/datosabiertos/def/urbanismo-infraestructuras/alumbrado-publico#> .
<http://linkeddata.es/resource/farolas/lapalma/0> a ap:PuntoDeAlumbrado ;
geo:long "-17.774237421604201614"^^xsd:double ;
geo:lat "28.60580329136699973"^^xsd:double .
and if I do the following simple SPARQL query
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX ap: <http://vocab.linkeddata.es/datosabiertos/def/urbanismo-infraestructuras/alumbrado-publico#>
select ?farola ?lat ?long where {
?farola a ap:PuntoDeAlumbrado; geo:lat ?lat; geo:long ?long .
}
I get the following results. Note that the values of latitude and longitude are rounded to a less precise value.
+-------------------------------------------------+----------+----------+
| farola | lat | long |
+-------------------------------------------------+----------+----------+
| http://linkeddata.es/resource/farolas/lapalma/0 | 28.6058 | -17.7742 |
+-------------------------------------------------+----------+----------+
This happens when I set the result format to HTML, XML, JSON, etc. If I ask for results in Turtle, I can the results with the correct precision.
@prefix res: <http://www.w3.org/2005/sparql-results#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
_:_ a res:ResultSet .
_:_ res:resultVariable "farola" , "lat" , "long" .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
_:_ res:solution [
res:binding [ res:variable "farola" ; res:value <http://linkeddata.es/resource/farolas/lapalma/0> ] ;
res:binding [ res:variable "lat" ; res:value 28.60580329136699973 ] ;
res:binding [ res:variable "long" ; res:value -17.774237421604201614 ] ] .
The problem is when I query using Apache Jena [v3.1.0], I get the rounded results. I guess, it asks for application/sparql-results+json as the first preference. What is the best way to make Virtuoso return the non-truncated values in the result (configuring either Virtuoso or Jena)?
This behavior is the same in the DBpedia SPARQL endpoint as it can be seen in the HTML Result vs the Turtle Result for the query
prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
select ?lat ?long where {
<http://dbpedia.org/resource/Liberty_Tower_(Manhattan)> geo:long ?long; geo:lat ?lat .
}