bioregistry icon indicating copy to clipboard operation
bioregistry copied to clipboard

FILTER-based restriction of results not supported by Bioregistry SPARQL endpoint

Open hartig opened this issue 1 year ago • 1 comments

When executing the following query on the SPARQL endpoint (https://bioregistry.io/sparql), I get an empty result, which is incorrect (that is, there should be solutions for this query).

PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT ?s ?o WHERE {
    ?s owl:sameAs ?o
    FILTER ( ?s = <http://identifiers.org/ensembl/ENSG00000006125> )
}

The reason for the issue is the FILTER clause, which does not seem to be supported by the query service. If I replace the FILTER by a VALUES clause as follows, I get the correct (non-empty) result.

PREFIX owl: <http://www.w3.org/2002/07/owl#>

SELECT ?s ?o WHERE {
    VALUES ?s { <http://identifiers.org/ensembl/ENSG00000006125> }
    ?s owl:sameAs ?o
}

We discovered the issue when trying to use the query service as part of a federation (see https://github.com/MaastrichtU-IDS/federatedQueryKG/issues/10). Notice that using such FILTERS is a typical way how query federation engines implement the bind join algorithm in which a set of solution mappings obtained from a previous subquery (at a different endpoint) are used in a join with the next subquery (a subquery assigned to the Bioregistry endpoint in the case in which we discovered the issue).

/cc @micheldumontier

hartig avatar Apr 26 '23 08:04 hartig

@vemonet does the rdflib-endpoint look in this part of the query to bind variables?

micheldumontier avatar Apr 26 '23 08:04 micheldumontier