简体   繁体   中英

Virtuoso SPARQL Bug with BIND

I think I found a bug with the BIND function of SPARQL in Virtuoso. I am running this in http://dbpedia.org/snorql/

Consider the following code:

SELECT DISTINCT ?label ?companyShort
WHERE{
        ?org rdf:type dbo:Company ;
            rdfs:label ?label .        
        #BIND (UCASE(SUBSTR(?label,1,3)) as ?companyShort)
        filter langMatches( lang(?label), "EN" )
        filter(?label="About.com"@en)
}

This behaves as expected. Now remove the comment on the BIND and poof the results vanish. Why would the results vanish if I bind some string manipulation to another variable?

Others may provide the reason for this behavior, but you can fix it by changing the label filter to str(?label)="About.com" , so the query would look as follows:

SELECT DISTINCT ?label ?companyShort
WHERE{
        ?org rdf:type dbo:Company ;
            rdfs:label ?label .        
        BIND (UCASE(SUBSTR(?label,1,3)) as ?companyShort)
        filter langMatches( lang(?label), "EN" )
        filter(str(?label)="About.com")
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM