Tag Archives: network

Writing a Cypher Stored Procedure


I’ve been so busy these last 6 months I just finally got around to watching Luke Cage on Netflix. The season 1 episode 5 intro is Jidenna performing “Long live the Chief” and it made me pause the series while I figured out who that was. I’m mostly a hard rock and heavy metal guy, but I do appreciate great pieces of lyrical work and this song made me take notice. Coincidently on the Neo4j Users Slack (get an invite) @sleo asked…
Continue reading

Tagged , , , , , , , , , ,

Our own Multi-Model Database – Part 5


In part 4 I promised metrics and a shell, so that’s what we’ll tackle today. We are lucky that the Metrics library can be plugged into Jooby without much effort… and double lucky that the Crash library can also be plugged into Jooby without much effort. This is what we are all about here because we’re a bunch of lazy, impatient developers who are ignorant of the limits of our capabilities and who would rather reuse open source code instead of falling victim to the “Not Invented Here” syndrome and do everything from scratch.
Continue reading

Tagged , , , , , , , ,

Our own Multi-Model Database – Part 4


Please read parts 1, 2 and 3 before continuing or you’ll be lost.

We started adding an HTTP server to our database last time and created just a couple of end points. Today we’ll finish out the rest of the end points. We’ll also be good open source developers by hooking in Continuous Integration , Test Coverage and Continuous Deployment.

Continue reading

Tagged , , , , , , , ,

Multi-Threading a Traversal


What would you think if I ran out of time,
Would you stand up and walk out on me?
Lend me your eyes and I’ll write you a post
And I’ll try not to run out of memory.

Oh, I get by with a little help from my threads
Mm, I get high with a little help from my threads
Mm, gonna try with a little help from my threads

Today we are going to take a look at how to take a Neo4j traversal and split it up into lots of smaller traversals. I promise it will be electrifying.
Continue reading

Tagged , , , , , , ,

News Feeds

Ron Burgundy Gets Hungry

Ron Burgundy (in Anchorman) gets Hungry

The “News Feed” is a core feature of social networks like Twitter, Facebook, or Vine (RIP). Let’s take a look at how we could model and implement this in Neo4j. Our social network needs Users (otherwise it would be kinda empty) that FOLLOW each other (otherwise it would not be very social). Those users need to POST some Messages (otherwise it would be boring). Here is our first attempt at a model (using Arrows):
Continue reading

Tagged , , , , , , ,

Delivering a Graph Based Search solution to slightly wrong data


When it comes to databases, having good clean data is always important. More so with Graphs which deal with concepts as nodes and their relationships between them. Inevitably, you will run into messy data and have to deal with it. In a lot of the projects our customers work on they are dealing with connecting multiple data sources to get to a “golden record” or single source of truth. A lofty goal, sometimes impossible to achieve, but we can use the relationships of the data to help us come close.

One option is to extract the features (or tags) of a composite object and see if any other object shares most of these features. If that is the case then they are possibly the same object and should be merged instead of creating a new record. A partial subgraph match is something akin to a recommendation engine in Neo4j and pretty trivial to write. Take a look back at a few old blog posts for ideas.
Continue reading

Tagged , , , , , , , , , ,

Bidirectional Traversals in Space


If you have never watched Firefly, then stop whatever you are doing and get to it, you can come back and read this post later. Ok good, now where were we. Firefly. The series is set a few hundred years from now, after people begin to terraform a new star system and it follows the adventures of the renegade crew of Serenity, a “Firefly-class” spaceship whose work consists of cargo runs or smuggling while failing to stay out of trouble. There is no faster than light travel in this series, so ships can’t just “warp” where ever they want. Instead they travel about from planets and moons, exchanging cargo, refueling and trying to make a living. We are going to model “The Verse” of Firefly in Neo4j, and see how we can find routes to move our illicit cargo from one place to another.
Continue reading

Tagged , , , , , , , , ,

Flight Search with the Neo4j Traversal API

Screen Shot 2015-08-30 at 2.21.07 AM

Before Cypher came along, if you wanted to describe a graph traversal in Neo4j you would use the Traversal Framework Java API. The Traversal API is one of the many hidden gems of Neo4j and today we are going to take a closer look at it. Traversing a graph is about going on a journey. All journeys have a starting point (or points) so that’s the first thing we have to do, figure out where in the graph we begin. It can be a single node, or multiple ones, but they will go on the journey following the same rules, so its easier if it’s just one node or nodes of the same “type”.
Continue reading

Tagged , , , , , , , , ,

Importing the Hacker News Interest Graph


Graphs are everywhere. Think about the computer networks that allow you to read this sentence, the road or train networks that get you to work, the social network that surrounds you and the interest graph that holds your attention. Everywhere you look, graphs. If you manage to look somewhere and you don’t see a graph, then you may be looking at an opportunity to build one. Today we are going to do just that. We are going to make use of the new Neo4j Import tool to build a graph of the things that interest Hacker News.
Continue reading

Tagged , , , , , , , , , , , ,

Triggers in Neo4j


One of the often overlooked features in Neo4j is the “TransactionEventHandler” capabilities… better known in the database world as “Triggers“. When a transaction occurs, we can analyze that event and decide to take some action. To accomplish this, we’ll write a “Kernel Extension” ( a little different from the Unmanaged Extensions we’ve seen on this blog ) to tie in our trigger.

Continue reading

Tagged , , , , , ,