How to do case insensitive match efficiently

1 view
Skip to first unread message

Ajay Kamble

unread,
Feb 8, 2016, 6:38:39 AM2/8/16
to Stardog
Does Stardog have any specific solution to do case insensitive match?

We have tried following 2 options but both take about 1.5 seconds:

1. FILTER(regex(?comName, 'foo', 'i'))
2. FILTER(lcase(?nobName) = 'foo')

-Ajay

Michael Grove

unread,
Feb 8, 2016, 8:05:18 AM2/8/16
to stardog
If you want case insensitive matching you can use filter & regex as you've shown or you can use the full-text index, which would be the recommended solution.

Cheers,

Mike
 

-Ajay

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Ray Rashif

unread,
Feb 8, 2016, 12:54:42 PM2/8/16
to sta...@clarkparsia.com
On 8 February 2016 at 17:38, Ajay Kamble <ajay.ri...@gmail.com> wrote:
> Does Stardog have any specific solution to do case insensitive match?
>
> We have tried following 2 options but both take about 1.5 seconds:

Regular expression matching will always be slow as the regex has to be
applied to all potential matches (which can be the entire graph), and
regex is expensive. Like Michael said, if you want anything faster,
resort to FTS. [1]

[1] http://stackoverflow.com/questions/13572915/how-to-make-my-sparql-query-with-regex-faster


--
GPG/PGP ID: C0711BF1
Reply all
Reply to author
Forward
0 new messages