Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query with FILTER and BIND clauses failure #1248

Open
achort opened this issue Mar 11, 2024 · 1 comment
Open

Query with FILTER and BIND clauses failure #1248

achort opened this issue Mar 11, 2024 · 1 comment

Comments

@achort
Copy link

achort commented Mar 11, 2024

I am using Virtuoso version 07.20.3239 (d698f21) prebuilt binary.

The following query does not compile and throws:

Virtuoso VECSL Error VECSL: Internal error, ssl refd before set, please report query to support

PREFIX gn: <http://www.geonames.org/ontology#> 

SELECT ?uri ?name ?featureCode ?tX ?tP ?tC ?tM {
  
    {    SELECT ?uri ?name ?featureCode WHERE { 
             ?uri gn:name ?name . 
             ?uri gn:countryCode "ES" . 
             ?uri gn:featureClass gn:P . 
             ?uri gn:featureCode ?featureCode . 
             VALUES  ?name { "Salamanca" }
         }
         GROUP BY ?uri  ?featureCode
    }

    {    SELECT count(distinct ?uri) as ?cX WHERE {
             ?uri gn:name ?name . 
             ?uri gn:countryCode "ES" . 
             ?uri gn:featureClass gn:P . 
             ?uri gn:featureCode gn:P.PPLX . 
             VALUES  ?name { "Salamanca" }
        } 
    }

    {    SELECT count(distinct ?uri) as ?cP WHERE {
             ?uri gn:name ?name . 
             ?uri gn:countryCode "ES" . 
             ?uri gn:featureClass gn:P . 
             ?uri gn:featureCode ?fc . VALUES ?fc {  gn:P.PPLA1 gn:P.PPLA2 gn:P.PPLA3  gn:P.PPLC }
             VALUES  ?name { "Salamanca" }
        } 
    }

    BIND( if(?cX > 0, "X", "Z") AS ?tX) 
    BIND( if(?cP > 0, "P", "Z") AS ?tP) 
    BIND( str(if( if(?cX > 0, "X", "Z") = "P", "P", "Z")) AS ?tM)
    BIND( if(?featureCode  = gn:P.PPLX, "X", "P") AS ?tC) 

    FILTER(?tM = ?tC)
 }

The problem seems to be triggered by the FILTER(?tM = ?tC) clause. If it is removed, the query executes as expected.

@TallTed TallTed changed the title Query with FILTER and BIND clauses failure Query with FILTER and BIND clauses failure Mar 11, 2024
@HughWilliams
Copy link
Collaborator

We are looking into this ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants