Make case insensitive in SPARQL

66 views Asked by At

I am creating a knowledge graph in SPARQL. I am importing data from a csv file. Now I want to filter a data corresponding to a country. In the csv I don't want to make data in column to all lower or upper case.

Now I want to filter a data, such that I want a SPARQL query that can get me data which is case insensitive (to give data either when typed lower or upper case).

I used the FILTER statement as below: FILTER(?country, "Japan"). How to make Japan case insensitive

FILTER(?country, "Japan").

Expecting a filter or any other statement that makes it case insensitive

1

There are 1 answers

3
Kelvin Lawrence On

One way is to convert ?country to lower case and test against the lower case version as in:

  FILTER (lcase(?country) = "japan")

Likewise you could test it after converting to upper case

  FILTER (ucase(?country) = "JAPAN")