Case-insensitive matching with "contains" or regex, or anything



Is there any way I can inquire attribute with case-insensitive matching?

I am accessing Grakn REST API over Node SDK.

I thought I could do it with regex, but
match $illness isa illness has name $name; $name val /.*Total.*/; get $name;
It seems that I cannot find a way to specify case-insensitive matching option…

Thank you.


I have tested it. Queries with regex are case sensitive even through the nodejs driver. That makes sense as the driver is only forwarding your request to the DB. It behave in exactly the same manner as it would from the visualiser.

In my data I know to have an email that has the value:

if I query for:

match $e isa email, has value $val; $val val /.*member.*/;get;

It is returned, but if I query for /.*Member.*/ it is not. this is the expected behaviour.


Thank you, Samuel.

So, is it not possible to run case insensitive queries on attributes of type string in any way? (Rest API, Java, console, etc.)

Just want to clarify this.


you could use the i flag for your regex that would make it case insensitive:



Are you sure? Because it didn’t work on REPL console or web visualizer, though.

Or it works with REST API or Java?
It would be great if it works somehow.


I am sure for the regex :wink: but yeah, GRAKN.AI seems not to accept flags after the / maybe that would do a nice issue on github for an upcoming release.



Thank you, Sam. :slight_smile:

For the case I am working on, I will just have another attribute for text matching strings in lower case for matching purposes. It would be very cumbersome to have a matching searchable pair for every string attribute, so it would be great if it works in future.

I will report it on GitHub.