On 26/03/14 10:01, Olivier Rossel wrote:
Hello.
I have a question about matching strings in SPARQL, whatever the lang tag.
As far as I understand, the only way to do that is to let SPARQL bind a
?variable
and then FILTER for equality of its str() against my matching string value.
In SPARQL 1.1, yes.
For example:
SELECT ?person ?name
WHERE
{
?person foaf:name ?name .
FILTER (str(?name) = "Jackie Chan") .
}
Is it really the only way?
Won't it perform really bad?
Especially compared to the case where you know the lang tag:
SELECT ?person ?name
WHERE
{
?person foaf:name "Jackie Chan"@en
}
This is what a text index is good for. Get some limited possibilities
and test accurately in SPARQL:
(hurrily...)
?x text:query ('Jackie Chan') .
?x foaf:name ?name .
FILTER (str(?name) = "Jackie Chan") .
Andy