I'm looking for a way to match claims values in a case insensitive way.
For instance, Wikidata has the following statement:
wd:Q1524522 wdt:P2002 'bouletcorp'
but, following the case used in twitter, let's say that I would use the value Bouletcorp
instead, which would give the following query, and fail to find any matching entity:
SELECT ?item WHERE {
?item wdt:P2002 "Bouletcorp" .
}
(try it)
A solution could be to use a Regex with an insensitive case flag as follow:
SELECT ?item WHERE {
?item wdt:P2002 ?twittername .
FILTER (regex(?twittername, "Bouletcorp", "i"))
}
(try it)
but how much less efficient would this query be? Isn't there a better way? As I understand it, this query would make the SPARQL engine pass all triples having a value for the requested property through a regex, which does sound inefficient. It's not that slow yet for P2002, but I guess some properties having more than a million matching claims could be problematic, no?