
|
If you were logged in you would be able to see more operations.
|
|
The SeRQL 'DISTINCT' filter sometimes fails for queries incorporating an optional clause.
Sample data:
@prefix x: <URN:com:example#>.
@prefix skos: <http://www.w3.org/2004/02/skos/core#>.
x:abc rdf:type x:MyType ;
skos:prefLabel "aaa" ;
skos:altLabel "bbb" ;
skos:altLabel "ccc" .
x:def rdf:type x:MyType ;
skos:prefLabel "bbb" ;
skos:altLabel "aaa" .
sample query:
select distinct uri, l1
from {uri} rdf:type {x:MyType};
skos:prefLabel {l1};
[skos:altLabel {l2}]
where l1 = "aaa" or l2 = "aaa"
using namespace skos = <http://www.w3.org/2004/02/skos/core#>,
x = <URN:com:example#>
obtained result:
URN:com:example#abc "aaa"
URN:com:example#abc "aaa"
URN:com:example#def "bbb"
expected result:
URN:com:example#abc "aaa"
URN:com:example#def "bbb"
The problem is likely related to the query optimizer in the MySQL SAIL that (wrongly) assumes the database can handle uniqueness issues on this type of query.
|
|
It was indeed the MySQL query optimizer. I have checked in a fix in CVS where queries with optional patterns are still explicitly filtered for duplicates (instead of having the database handling duplicate filtering).
|
|