GraphAware Blog - Intermediate

Find out what's new in the Neo4j world

Neo4j OGM Events - Part 1

13 Apr 2016 by Vince Bickers Neo4j OGM SDN Intermediate

As of version 2.1, Neo4j OGM will support persistence events. Although a date for the release of 2.1 isn’t known at the time of writing, we think this is an important and exciting new feature and so we’ll be writing a series of posts about it over the next few weeks to whet your appetites. In this first post we’ll take a quick tour of the new Events mechanism in the OGM, and provide some examples of how we might use it in our own applications. But first, some background… OGM persistence strategy By design, the OGM has a deep...

Securing Neo4j with GraphAware Enterprise

29 Mar 2016 by Michal Bachman Neo4j GraphAware Intermediate Security Enterprise

For most organisations, data security is extremely important. The topic comes up every single time we are training, consulting, or otherwise engaging in the world of graphs and Neo4j. At the same time, security is very difficult and time-consuming to get right and the implications of getting it wrong can be serious. In this blog post, we introduce the integration of Spring Security into Neo4j which provides important security controls and mechanisms for enterprises and governments that make use of the world’s most popular graph database. Security in Neo4j Neo4j comes with certain security mechanisms out of the box. These...

Expiring Data in Neo4j

15 Mar 2016 by Michal Bachman Neo4j GraphAware Intermediate

At GraphAware, we help organisations in a wide range of verticals solve problems with graphs. Once we come across a requirement or use case two or three different times, we typically create an open-source Neo4j extension that addresses it. The latest addition to our product portfolio, introduced in this post, is a simple library that automatically expires data from the Neo4j graph database. GraphAware Framework Open-sourcing useful extensions helps us deliver solutions faster, lets people who prefer a DIY approach be more productive, and gives us valuable community feedback. That’s how our most popular products, such as the GraphAware Recommendation...

GraphConnect 2015 Talk

20 Nov 2015 by Michal Bachman Neo4j Conference Intermediate Search Elasticsearch

Last month, I had the pleasure of speaking at GraphConnect in San Francisco, introducing the Graph-Aided Search to a large audience of Neo4j users and graph enthusiasts. For those who missed the conference, the recording and slides have now been made available. Enjoy and get in touch with feedback / questions! Video Slides Real-Time Recommendations and the Future of Search from GraphAware

MATCHing Paths with Very Dense Nodes in Neo4j 2.2

19 Mar 2015 by Christophe Willemsen Neo4j Cypher Intermediate

Last weekend, I came across a tweet announcing that Wikimedia released the dataset of the page clickstreams for February 2015. I found it interesting to download this dataset and see how people arrive on the Neo4j’s Wikipedia page. The data is quite simple; we have page entities that relate to other pages. A page can either be a Wikipedia page, or a non-Wikipedia page such as Google. Relationships can represent a user click from a Wikipedia page to another page, or a user searching on Google or Wikipedia. The number of times an event occurs is also provided in the...

Using the Neo4j Shell with Embedded Neo4j

10 Feb 2015 by Luanne Misquitta Neo4j Intermediate

Our earlier blog post talked about using the Neo4j web browser along with embedded Neo4j. The WrappingNeoServerBootstrapper which was employed to do this has been deprecated for a while and it raises questions about the alternative. Testing server extensions is now possible (see Testing your extension) but there is still another use case for wanting to connect to an embedded graph - troubleshooting. Perhaps you have a web application running in production with Neo4j in embedded mode and you’ve got to troubleshoot an issue which requires access to the graph - how do you do this against a live graph?...

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...

Using the Neo4j Browser with Embedded Neo4j

21 Nov 2014 by Luanne Misquitta Neo4j Intermediate

There are times when you have an application using Neo4j in embedded mode but also need to play around with the graph using the Neo4j web browser. Since the database can be accessed from at most one process at a time, trying to start up the Neo4j server when your embedded Neo4j application is running won’t work. The WrappingNeoServerBootstrapper, although deprecated, comes to the rescue. Here’s how to set it up. Maven Dependencies <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j</artifactId> <version>2.1.5</version> </dependency> <dependency> <groupId>org.neo4j.app</groupId> <artifactId>neo4j-server</artifactId> <version>2.1.5</version> </dependency> <dependency> <groupId>org.neo4j.app</groupId> <artifactId>neo4j-server</artifactId> <version>2.1.5</version> <classifier>static-web</classifier> </dependency> Start the WrappingNeoServerBootstrapper public static void connectAndStartBootstrapper() { WrappingNeoServerBootstrapper neoServerBootstrapper; GraphDatabaseService...

GraphConnect 2014 Talk

20 Nov 2014 by Michal Bachman Neo4j Conference Intermediate

Last month, I had the pleasure of speaking at GraphConnect in San Francisco, introducing the GraphAware Framework to a large audience of Neo4j users and graph enthusiasts. For those who missed the conference, the recording and slides have now been made available. Enjoy and get in touch with feedback / questions! Video Slides GraphAware Framework Intro from Michal Bachman

GraphAware Neo4j TimeTree

20 Aug 2014 by Luanne Misquitta, Michal Bachman Neo4j GraphAware Intermediate

Modelling and querying time-based events in a graph is a fairly common discussion topic and a frequently asked question on Q/A sites. In this blog post, we evaluate some of the common approaches and introduce GraphAware TimeTree, a GraphAware Framework Module that simplifies modelling time and events in Neo4j. Naive Approach Neo4j has no notion of a Date/Time data type, so you have to decide to store the timestamp either as a long, or as a human-readable String, for instance formatted as ‘YYYY-MM-DD HH:mm:ss’. Unless the time is only for human eyes, though, we recommend opting for the machine readable...

Random Graph Models (Part II)

06 Aug 2014 by Vojtěch Havlíček Neo4j GraphAware Intermediate

In the first part of this short series about random graph models, we talked about why they are useful and had a brief look at two of them: Erdos-Renyi graphs and Barabasi-Albert model. In this post, we take a look at the “small world” phenomenon and another network model, namely the Watts-Strogatz model. Small World There is an important property of random networks which we did not write about in the last blog post: the way the node separation scales with network size. Both Erdos-Renyi and Barabasi-Albert networks are “small world” models, meaning that the characteristic node separation scales logarithmically...

Random Graph Models (Part I)

16 Jul 2014 by Vojtěch Havlíček Neo4j GraphAware Intermediate

When one obtains a graph data from a measurement on a real world network, it is sometimes useful to make comparison with a random graph. Such graph is characterised by certain degree distribution, which you can imagine to be a list of degrees of nodes present in the network. The most interesting distributions have certain functional dependence which allows one to infer what processes are dominant in formation of the network. The processes consequently characterise the relationships between the nodes. Why would one care about such analysis? Imagine a group of customers that you want to target efficiently in a...

Neo4j Server Unit Testing with RestTest

19 Jun 2014 by Luanne Misquitta Neo4j GraphAware Intermediate GraphUnit Testing

A couple of days ago, I wrote about unit testing with GraphUnit. GraphUnit tested the state of an embedded Neo4j database. What if you run Neo4j in standalone server mode? Fortunately, you can still test it and match subgraphs using the GraphAware Neo4j RestTest library. Setup Grab the GraphAware Neo4j Framework and GraphAware Neo4j RestTest jars from the Downloads page. Drop them into the plugins directory of your Neo4j installation and restart the server to be able to use the API’s. How to use it All you have to do is POST your cypher to http://your-server-address:7474/graphaware/resttest/assertSameGraph or http://your-server-address:7474/graphaware/resttest/assertSubgraph to verify...

Neo4j Unit Testing with GraphUnit

16 Jun 2014 by Luanne Misquitta Neo4j GraphAware Intermediate GraphUnit Testing

Testing the state of an Embedded Neo4j database is now much easier if you use GraphUnit, a component of the GraphAware Neo4j Framework. I tried replacing an existing Flavorwocky unit test with GraphUnit to check out the benefits. Let’s walk through a before-after case study. The test The unit test in question is the one to test that a Pairing is saved correctly. A pairing must have exactly two ingredients. Each Ingredient node has a name; a Pairing has an affinity and an array of allAffinities (all affinities ever assigned to the pairing). Before Pseudocode to test that my code...

GraphUnit: Testing Neo4j Code

29 May 2014 by Michal Bachman Neo4j GraphAware Intermediate GraphUnit Testing

Recently, we announced the GraphAware Framework. Today, I would like to introduce its first feature called GraphUnit. GraphUnit is a component that helps Java developers unit test their code that talks to Neo4j and mutates data. Unit Testing Neo4j Code When writing Java code that modifies data stored in Neo4j, developers can use the ImpermanentGraphDatabase in conjunction with any of APIs provided by Neo4j to test that code. This includes the native Java API, the traversal framework, and Cypher. (I’ve excluded the REST API because using that to unit test Java code wouldn’t make much sense.) Let’s say we’re testing...

Introducing GraphAware Neo4j Framework

28 May 2014 by Michal Bachman Neo4j GraphAware Intermediate

In this short blog post, I would like to introduce the GraphAware Neo4j Framework. Its goal is very ambitious: we’d like to make it as useful for Neo4j developers, as the Spring Framework is for Java developers. The Framework aims at speeding up development with Neo4j by providing a platform for building useful generic as well as domain-specific functionality, analytical capabilities, graph algorithms, and more. Features Overview On a high level, there are two key pieces of functionality, GraphAware Server and GraphAware Runtime. GraphAware Server is a Neo4j server extension that allows developers to build (REST) APIs on top of...