GraphAware Blog

Find out what's new in the Neo4j world

Random Graph Models (Part II)

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

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

Cypher MERGE Explained

31 Jul 2014 by Luanne Misquitta Neo4j Beginner Cypher

With MERGE set to replace CREATE UNIQUEat some time, the behavior of MERGE can sometimes be tricky to understand.MERGEHere’s a summary of what MERGE does: It ensures that a pattern exists in the graph by creating it if it does not exist already It will not use partially existing patterns- it will attempt to match the entire pattern and create the entire pattern if missing When unique constraints are defined, MERGE expects to find at most one node that matches the pattern It also allows you to define what should happen based on whether data was created or matchedThe key...

Node Degrees in Neo4j 2.1

23 Jul 2014 by Michal Bachman Neo4j GraphAware Beginner

Efficient counting of relationships in Neo4j was the cornerstone of my Master Thesisand the reason the very first GraphAware Frameworkmodule called the Relationship Count Module was born. The improvements in Neo4j 2.1around dense nodes and the addition of getDegree(…) methods on the Node interface made me eager to do some benchmarking around relationship counts again.The improvements in Neo4j 2.1, indeed, make the RelCount module slightly less useful. We’ve decided, however, not to makeit obsolete, since it is a useful reference implementation of a GraphAware Framework Transaction-Driven Runtime Module.Instead, we ported the module to Neo4j 2.1 and reused all the performance...

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 witha random graph. Such graph is characterised by certain degree distribution, which you can imagine to be a list of degreesof nodes present in the network. The most interesting distributions have certain functional dependence which allowsone to infer what processes are dominant in formation of the network. The processes consequently characterise therelationships between the nodes.Why would one care about such analysis?Imagine a group of customers that you want to target efficiently in a certain fashion. Say, for instance, that...

Neo4j Improved Transaction Event API

11 Jul 2014 by Michal Bachman Neo4j Transactions GraphAware Advanced

One of the main goals of the GraphAware Framework is to simplify andspeed up development with Neo4j. Although it is called a “framework” for reasons explained elsewhere, today we willsimply treat it as a library of useful, tested, and documented Java code. The feature we will introduce is calledImproved Transaction Event API, which is exactly what it says on the tin.MotivationNeo4j requires every mutating operation on the graph to be run in a transaction, which is great, because it keeps yourdata safe. Every operation is atomic, consistent, isolated, and durable. As a bonus, Neo4j gives you the opportunity toreact to...

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.SetupGrab 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 itAll you have to do is POST your cypher to http://your-server-address:7474/graphaware/resttest/assertSameGraph orhttp://your-server-address:7474/graphaware/resttest/assertSubgraph to verify the state of your graph.Emptying the database...

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 testThe 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).BeforePseudocode to test that my code saved a pairing correctly in Neo4j:...

Happy Birthday GraphAware

03 Jun 2014 by Michal Bachman Neo4j GraphAware

Today, it is exactly one year ago since Graph Aware Limited was incorporated. It started as a one man show, whilst I was finishing my MSc. Thesis at Imperial College London. Since then, we’ve been growing slowly but steadily and will be moving to our new London office fairly soon (announcements to come). We have happy clients in London, New York, Copenhagen, Barcelona, Prague, and Accra.I would like to take this opportunity to thank everyone who’s made it possible for us to help people discover the beauty of graphs, run a business, and have a lot of fun, all at...

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 CodeWhen writing Java code that modifies data stored in Neo4j, developers can use the ImpermanentGraphDatabase in conjunction with any of APIs provided by Neo4jto 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 code that creates two nodes...

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 aswell as domain-specific functionality, analytical capabilities, graph algorithms, and more.Features OverviewOn a high level, there are two key pieces of functionality, GraphAware Server and GraphAware Runtime. GraphAwareServer is a Neo4j server extension that allows developers to build (REST) APIs on top of Neo4j using Spring MVC, ratherthan...