Database Reference
In-Depth Information
Chapter 3. Pattern Matching in Neo4j
Data is not simple, it is complicated and evolving.
It is imperative to have an efficient structure to store complicated and evolving data and
predominantly it should focus on "What to retrieve?", instead of "How to retrieve?". Hav-
ing such an efficient structure will also help developers to focus on the domain model in-
stead of getting lost in learning procedures/functions for accessing the database.
We could have used object-oriented principles and designed some fixed set of functions for
accessing the data, but remember data in itself is evolving and not fixed, so it is cumber-
some to add methods every time you add some new dimensions to your data; to make it
even more complicated, sometimes you may not even know about this new data added to
your system.
So, "How do we do that?" The answer is patterns and pattern matching.
Neo4j provides powerful, declarative and yet relatively simple graph query language, based
on the principles of patterns and pattern matching, known as Cypher .
Cypher is a declarative graph query language, which not only provides an efficient mech-
anism for querying and updating graphs but also helps developers to focus on "What to
query?" and hides all the complexity of "How to query?".
In this chapter, you will learn about data modeling in Neo4j and retrieving data using pat-
tern matching in Cypher.
This chapter will cover the following topics:
• Agile data modeling with Neo4j
• Patterns and pattern matching
• Read-only Cypher queries
• Schema and legacy indexing queries
• Movie demo with GraphGists
Search WWH ::




Custom Search