DEX 3.0 features: Regular Expressions

In the second delivery of this series we are going to see how DEX extends the capability to query the graph database using regular expressions. As in every database you can also query the entities in your graph database with DEX. DEX 3.0 has enriched those queries by using regular expressions. Not only you can use operators:

  • == (equal)
  • != (not equal)
  • > (greater than)
  • >= (greater or equal than)
  • <= (lesser or equal than)
  • LIKE
  • ILIKE (Like without being case-sensitive)

But also enrich your queries using regular expressions. Regular expressions provide flexibility to match strings with text, using a formal language with alphabet characters and new operations, such as:

Regular expressions widen the possibilities to find the string you are precisely looking for and conform most of the POSIX Extended Regular Expressions. Let’s see how it can change a query, taking for instance the following example:

You are trying to search for “John Lee” among people stored in the database with the attribute “fullname”, but you are not sure whether the name is really “Lee” or ”Lea”, also you might be even more wrong and the “John” you are looking for is really “Light” or ”Lane”. Method  graph.select(fullname, LIKE, “John”) will not retrieve anything because there’s not any single person registered only by its name; the last name is also required, then if you try graph.select(fullname, LIKE “John Lee”) you will discover that you are misspelling his last name. Your search will normally end here, but with DEX 3.0 you can use regular expressions by selecting all “Johns” that have a last name that begins with an “L”: graph.select(fullname, ERE, "^John L.*") and you will obtain a graph with all the people that match that query. Then it’s your turn to decide which”John L” is the one. In just one single search you retrieve what you exactly were looking for.

Stay tuned for more features to come. Do not forget to check the first episode: graph algorithms

This entry was posted in DEX, Documentation and tagged , , , , , , . Bookmark the permalink.

2 Responses to DEX 3.0 features: Regular Expressions

  1. Pingback: DEX 3.0 features: Neighbors materialized | Sparsity-Technologies: News and Events

  2. Pingback: DEX 3.0 features: large char objects | Sparsity-Technologies: News and Events

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>