openlink / virtuoso-opensource

Virtuoso is a high-performance and scalable Multi-Model RDBMS, Data Integration Middleware, Linked Data Deployment, and HTTP Application Server Platform
https://vos.openlinksw.com
Other
858 stars 210 forks source link

Faceted Browser: floating-point number format issues #682

Open drassokhin opened 7 years ago

drassokhin commented 7 years ago

When the FCT service is accessed via the "describe" verb (http://:/describe/?url=), datatype properties of the http://www.w3.org/2001/XMLSchema#double type are truncated and shown as integers. For example:

ChEMBL Activity Entity Standard Value | 13(xsd:double) GOSTAR Micromolar value | 0(xsd:double)

The actual values in the above example are 13.6 and 0.0136, respectively, which can be confirmed by running the following "sparql describe" query from the isql command line:

sparql describe https://www.gostardb.com/gostar/activity/ACT_ID1893144 ... https://www.gostardb.com/gostar/activity/ACT_ID1893144 http://rdf.ebi.ac.uk/terms/chembl#standardValue 13.6 https://www.gostardb.com/gostar/activity/ACT_ID1893144 https://www.gostardb.com/gostar/gostarOntology#microMolarValue 0.0136 ...

OpenLink Virtuoso Server Version 07.20.3217-threads for Win64 as of Apr 25 2016 Started on: 2017-09-25 14:01 GMT-4

HughWilliams commented 7 years ago

@drassokhin: Are you able to provide an example of this behaviour against one of our public FCT sparql endpoint like http://uriburner.com/fct please, as the URLs you provide above are not accessible publicly it seems ?

drassokhin commented 7 years ago

@HughWilliams : I tried to find triples with objects of the "double" type in the uriburner.com triple store by executing the following query against http://linkeddata.uriburner.com/sparql: SELECT * WHERE { ?s ?p ?o FILTER ( datatype(?o) = xsd:double) } limit 100 but it returned no records. However, the issue is easy to reproduce by inserting a triple with a double-type literal into a Virtuoso triple store, for example, `

"1.36E-2"^^ ` and then browsing **dtestsubject** via the 'describe' endpoint. The **dtestpredicate** property of **dtestsubject** will be shown as 0(xsd:double). Interestingly enough, this SPARQL query ` SELECT * WHERE { ?s a ?o FILTER ( datatype(?o) = xsd:integer) } limit 100 ` executed against http://linkeddata.uriburner.com/sparql returns a bunch of records. Not sure how the **rdf:type** property of something can be an integer literal.
HughWilliams commented 7 years ago

@drassokhin:

I inserted the following into the uriburner.com instance:

SQL> SPARQL SELECT * FROM <drassokhin> WHERE { ?s ?p ?o  BIND (DATATYPE(?o) as ?datatype) };                                                                                         s                                                                                 p                                                                                 o                                                                                 datatype
LONG VARCHAR                                                                      LONG VARCHAR                                                                      LONG VARCHAR                                                                      LONG VARCHAR
_______________________________________________________________________________

dtestsubject1                                                                     dtestpredicate                                                                    136                                                                               http://www.w3.org/2001/XMLSchema#double
dtestsubject2                                                                     dtestpredicate                                                                    13.6                                                                              http://www.w3.org/2001/XMLSchema#double
dtestsubject                                                                      dtestpredicate                                                                    0.0136                                                                            http://www.w3.org/2001/XMLSchema#double

3 Rows. -- 36 msec.
SQL>

And then used the FCT describe on the 3 triples inserted triples i.e.

http://linkeddata.uriburner.com/describe/?url=dtestsubject -> returns value of 0 (xsd:double) http://linkeddata.uriburner.com/describe/?url=dtestsubject1 -> returns value of 136(xsd:double) http://linkeddata.uriburner.com/describe/?url=dtestsubject2 -> returns value of 13 (xsd:double)

Which I presume is the problem you are reporting ?

drassokhin commented 7 years ago

@HughWilliams : Yes, you are correct, this is the issue I have reported.

HughWilliams commented 7 years ago

@drassokhin: OK, I have reported this issue to development to look into ...