Another Word For It Patrick Durusau on Topic Maps and Semantic Diversity

January 20, 2015

Modelling Data in Neo4j: Labels vs. Indexed Properties

Filed under: Graphs,Neo4j — Patrick Durusau @ 2:15 pm

Modelling Data in Neo4j: Labels vs. Indexed Properties by Christophe Willemsen.

From the post:

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 full advantage of a the graph database.

Throughout the blog post, we'll use the following example scenario:

  • We have User nodes
  • User FOLLOWS other users
  • Each user writes multiple blog posts stored as BlogPost nodes
  • Some of the blog posts are drafted, others are published (active)

This post will help you make the best use of labels in Neo4j.

Labels are semantically opaque so if your Neo4j database has “German” to label books written in German, you are SOL if you need German for nationality.

That is a weakness semantically opaque tokens. Having type properties on labels would push the semantic opaqueness to the next level.

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress