GraphAware Blog - Modelling

Find out what's new in the Neo4j world

(Un)common Use Cases for Graph Databases

18 Apr 2016 by Michal Bachman Neo4j Beginner Modelling

At GraphAware, we live and breathe Neo4j. For three years, we have been helping customers around the world embrace this amazing technology as a solution to many interesting problems. Mainstream applications of graphs, such as real-time recommendations, fraud detection, impact analysis, and graph-aided search, have been getting a lot of media attention. In the run up to GraphConnect Europe 2016, we would like to illustrate that graphs are truly for everyone by going over some of the less obvious, though equally interesting and intellectually stimulating use cases that we have come across. Rules Engines Whether you’re a startup building a...

Modelling Data in Neo4j: Labels vs. Indexed Properties

16 Jan 2015 by Christophe Willemsen Neo4j Modelling Cypher Intermediate

A common question when planning and designing your Neo4j Graph Database is how to handle “flagged” entities. This could include users that are active, blog posts that are published, news articles that have been read, etc. Introduction In the SQL world, you would typically create a a boolean|tinyint column; in Neo4j, the same can be achieved in the following two ways: A flagged indexed property A dedicated label Having faced this design dilemma a number of times, we would like to share our experience with the two presented possibilities and some Cypher query optimizations that will help you take a...

Modelling Data in Neo4j: Qualifying Relationships

24 Oct 2013 by Michal Bachman Neo4j Modelling Beginner

In the last post of our “Neo4j Modelling for Beginners” series, we looked at bidirectional relationships. In this post, we compare the implications of qualifying relationships by using different relationship types versus using relationship properties. Properties as Qualifiers Let’s say we want to model movie ratings in Neo4j. People have an option to rate a movie with 1 to 5 stars. One way of modelling this, and perhaps the first one that springs into mind, is creating a RATED relationship with a rating property that takes on 5 different values: integers 1 though 5. Writing queries using this model is...

Modelling Data in Neo4j: Bidirectional Relationships

11 Oct 2013 by Michal Bachman Neo4j Modelling Beginner

Transitioning from the relational world to the beautiful world of graphs requires a shift in thinking about data. Although graphs are often much more intuitive than tables, there are certain mistakes people tend to make when modelling their data as a graph for the first time. In this article, we look at one common source of confusion: bidirectional relationships. Directed Relationships Relationships in Neo4j must have a type, giving the relationship a semantic meaning, and a direction. Frequently, the direction becomes part of the relationship’s meaning. In other words, the relationship would be ambiguous without it. For example, the following...