openlink / virtuoso-opensource

Virtuoso is a high-performance and scalable Multi-Model RDBMS, Data Integration Middleware, Linked Data Deployment, and HTTP Application Server Platform
http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/
Other
849 stars 214 forks source link

SPARQL: ORDER BY returning results in incorrect rows #86

Open cbdavis opened 10 years ago

cbdavis commented 10 years ago

For background, I'm using stable/7 from github: Driver: 07.00.3203 OpenLink Virtuoso ODBC Driver OpenLink Interactive SQL (Virtuoso), version 0.9849b.

I'm running into an issue where if I sort the results of a query, I'm seeing the values for rdfs:label appear with the wrong URIs. When I don't sort, the correct values are returned. The URIs have the same values for some of their properties, which may be causing this issue.

A minimal example that can duplicate the bug is a named graph containing only this data:

@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix a:  <http://enipedia.tudelft.nl/wiki/> .
@prefix rdfs:   <http://www.w3.org/2000/01/rdf-schema#> .
@prefix prop:   <http://enipedia.tudelft.nl/wiki/Property:> .
@prefix cat:    <http://enipedia.tudelft.nl/wiki/Category:> .
a:Ahmedabad_Ashima_Powerplant   rdf:type    cat:Powerplant ;
    rdfs:label  "Ahmedabad Ashima Powerplant" ;
    prop:Latitude   23.0333 ;
    prop:Longitude  72.6167 .
a:Ahmedabad_Electro_Melt_Powerplant rdf:type    cat:Powerplant ;
    rdfs:label  "Ahmedabad Electro Melt Powerplant" ;
    prop:Latitude   23.0333 ;
    prop:Longitude  72.6167 .
a:Arvind_Intex_Powerplant   rdf:type    cat:Powerplant ;
    rdfs:label  "Arvind Intex Powerplant" ;
    prop:Latitude   23.0333 ;
    prop:Longitude  72.6167 .

The error can be seen by running this query:

PREFIX cat: <http://enipedia.tudelft.nl/wiki/Category:>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select * where {
  ?ppl rdf:type cat:Powerplant .
  ?ppl rdfs:label ?name .
} order by ?ppl
indeyets commented 10 years ago

@cbdavis please edit the issue, so that the query is wrapped in triple-backtics. see markdown docs

abarton commented 10 years ago

I'm experiencing the same issue. I'm running Version: 07.00.3203, Build: Aug 3 2013. The problem exists through the SPARQL endpoint or ODBC driver.

This is a high impact bug over any result set needing partitioning without ambiguous ordering.

cbdavis commented 10 years ago

I've just installed the latest version from the stable/7 branch on github (Virtuoso version 07.10.3207 on Linux (x86_64-unknown-linux-gnu), Single Server Edition), and this issue seems to be fixed now.

abarton commented 10 years ago

I'm unable to reproduce with Version: 07.10.3207.