ncbo / goo

Graph Oriented Objects (GOO) for Ruby. A RDF/SPARQL based ORM.
http://ncbo.github.io/goo/
Other
15 stars 6 forks source link

Add the REGEX filter #115

Closed syphax-bouazzouni closed 2 years ago

syphax-bouazzouni commented 2 years ago

What is the SPARQl REGEX filter

see https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#func-regex

Why

One of the use case, is for doing a simple terms search with out using the solr indexing

How to use it

Using the Students test data

f = Goo::Filter.new(:name).regex("n") # will find all students that contains "n" in there name
st = Student.where.filter(f).all # return "John" , "Daniel"  and  "Susan"