Tag Archives: software

Modeling Events in Neo4j

No. Not modeling events, I’m talking about modeling events. Things that happen at different times typically in some known sequence. If you are a long time follower of my blog you know I love promoting the date property of an event into the relationship type to make use of Neo4j’s individual Node-RelationshipType partitioning to speed up my queries, but I’m going to show you something different today.
Continue reading

Tagged , , , , , , , , , ,

Filtering Connected Dynamic Forms

Sometimes I contrast Neo4j against relational databases by saying Neo4j is more like a dynamic typed language, and relational databases are more like a static typed language. In Neo4j you don’t have Tables or table definitions, any property can be of any valid value (Java primitives, arrays of Java primitives as well as time and spatial types). Two nodes with the same Label can have completely different properties, and any key can be of any type for different nodes. So for example a User labeled node may have the “id” property be “xyz”, while the “id” property for a Location labeled node may be a spatial type… but another User labeled node may also have the “id” property be a number or an array of floats, or whatever. This kind of freedom can drive people crazy, but it can also be leveraged to make very dynamic applications easy.
Continue reading

Tagged , , , , , , , ,

Network Routing in Neo4j

People use Neo4j to manage enterprise architectures all the time. If you haven’t seen this presentation from Thomas Lawrence from Amadeus, then you owe it to yourself to watch it. But what about lower level networks? Can we use Neo4j to model routing in a physical network? Of course we can, and today I’ll show you how.

Continue reading

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

Calculating the best Rail Road paths in Neo4j

Did you know that Chicago is the most important railroad center in North America? Chicago has more lines of track radiating in more directions than from any other city. The windy city has long been the most important interchange point for freight traffic between the nation’s major railroads and it is the hub of Amtrak, the intercity rail passenger system. You may not realize it, but railroad tracks and graph theory have a history together. Back in the mid 1950s the US Military had an interest in finding out how much capacity the Soviet railway network had to move cargo from the Western Soviet Union to Eastern Europe. This lead to the Maximum Flow problem and the Ford–Fulkerson algorithm to solve it.

Continue reading

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

Neo4j Stored Procedures for Devs that don’t know Java (yet)

When I joined Neo4j, I didn’t know how to write Java. I was a SQL developer who knew some Ruby and that’s about it. Luckily I had Michael Hunger, Stefan Armbruster, David Montag and others to help me out. I realize however that you may not be so lucky. So today I’m going to share with you a set of slides to help you start you on your journey of using the full power of Neo4j.
Continue reading

Tagged , , , , , , , , , ,

Dynamic Rule Based Decision Trees in Neo4j – Part 4

So far I’ve only showed you how to traverse a decision tree in Neo4j. The assumption being that you would either create the rules yourself from expert knowledge or via an external algorithm. Today we’re going to add an algorithm to build a decision tree (well a decision stream) right into Neo4j. We will simply pass in the training data and let it build the tree for us. If you are reading this part without reading parts one, two, and three, you should because this builds on what we learned along the way.

Continue reading

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

Dynamic Rule Based Decision Trees in Neo4j – Part 3

At Graph Connect this year I did a short lightning talk on building Decision Trees using Neo4j. The slides are up and down below, the video is up. After the talk, someone asked, “What if we don’t know all the facts ahead of time?”. They wanted to be able to step through the tree and ask for the facts as needed at each step. So today we’re going to see how to do that.
Continue reading

Tagged , , , , , , , , ,

Finding your neighbors using Neo4j

In Mr. Rogers’ Neighborhood, the question “Won’t you be my neighbor?” is an invitation for somebody to be close to you. In graphs, it’s an invitation to traverse. The closest neighbors of a node are those reachable by a single relationship hop, but we can also consider nodes two, three or more hops away our neighbors as well. How can we find them in Neo4j? Using the “star”:
Continue reading

Tagged , , , , , , , , , ,

Multiple origin multiple destination 3 relationships queries for knowledge graphs using Neo4j

The multiple-origin-multiple-destination (MOMD) problem is an NP-Hard problem sometimes seen in logistics planning where paths can stretch out really far. A far simpler problem presents itself when we limit the size of the paths. Now you may be wondering, why would we do that? Well… outside logistics we have plenty of graphs where relevance drops as we get further and further away. Think about an Article on Wikipedia. It has links to many other articles that are relevant, and those have links to other articles that are relevant to them but less relevant to our starting Article, and those have links to other articles that may be relevant to them, but have very little to do with our starting Article. I think if we keep going we end up in Philosophy or something like that.
Continue reading

Tagged , , , , , , , , , ,

Building a Dating site with Neo4j – Part Twelve

It’s time to add “visions of love” to our dating site. So far our posts have been just text status updates and while it is possible to fall in love with someone’s words, it’s harder if they look like the troll that lives under the bridge. So what’s the plan here? Well… like most databases out there, it’s not a good idea to store images in Neo4j. What we are going to store instead is a link to where the image resides… but we also don’t want to deal with having images all over our file system and then having to worry about storage space and replicating them, geographically distributing them for faster access, etc. Hosting images is a problem solved by the use of Content Delivery Networks. So let’s leverage one and build our feature.
Continue reading

Tagged , , , , , , , , , ,