on Apr 10, 2014 in cypher
Sometimes you don’t see the forest for the trees. But if you do, you probably use a graph database.
Trees are one of the simple graph datastructures, directed acyclic graphs (DAGs).
For our example we use a time-tree that we want to import into the database.
A quick soulver script (thanks Mark) later, we know how many nodes and rels (nodes-1), we will have to
import to represent a full year down to the second level.
1 year = 12 months = 365 days = 8.760 hours = 525.600 minutes = 31.536.000 seconds
So we have to import about 32M nodes and 32M relationships. Sounds good enough.
on Mar 25, 2014 in cypher
After reading the interesting blog post of my colleague Rik van Bruggen on “Media, Politics and Graphs” I thought it would be really cool to render it as a GrapGist. Especially, as he already shared all the queries as a GitHub Gist.
Unfortunately the dataset was a bit large for a sensible GraphGist representation, so I [...]
on Mar 21, 2014 in cypher
We want to run some test queries on an existing graph model but have no sample data at hand and also no input files (CSV,GraphML) that would provide it.
Why not create quickly it on our own just using cypher. First I thought about using Cypher to generate CSV files and loading them back, but it [...]
With Neo4j 2.0 we got automatic schema indexes based on labels and properties for exact lookups of nodes on property values.
Fulltext and other indexes (spatial, range) are on the roadmap but not addressed yet.
For fulltext indexes you still have to use legacy indexes.
As you probably don’t want to add nodes to an index manually, the [...]
There was a question on the Neo4j Google Group about returning results in a random order in Cypher. So I thought explaining it in a blog post (this) and an interactive GraphGist is better than just to answer the email.
on Feb 28, 2014 in cypher
If you want to delete lots of data from a Neo4j database with Cypher
Just stop the server and delete the directory and start again
Fastest way with no leftovers, just delete db/data/graph.db and you’re done.
Cypher Statement before 2.1
“Unknown Error” or OutOfMemoryException is a symptom that your transaction size gets too big and consumes too much memory.
on Feb 27, 2014 in cypher
State of the Cypher UNION
Neo4j 2.0 introduced the UNION (ALL) clause which can join the results of 2 or more complete statements into a single result. Each of the statements is fully formed, it can contain result projection, pagination and
You need to have the same amount and names of columns to be joined in an [...]
on Feb 18, 2014 in code
The transactional http endpoint that was added to Neo4j 2.0 is really easy to use.
You can stream batches of cypher statements with their parameters to the server and receive the answers in a streaming fashion too.
on Feb 18, 2014 in code
Accessing your beloved Neo4j-Shell via RMI works ok on localhost or in your intranet. But over the internet you don’t really want to expose RMI ports.
So most installations of Neo4j, e.g. on EC2 use basic auth as simplest security measure.
Also the Neo4j hosting providers like GrapheneDB.com or GraphHost.com offer basic auth by default to “secure” [...]
on Feb 17, 2014 in code
Sometimes when you work with the Neo4j community you get a database handed that you don’t know anything about.
Then it is handy to get an idea what’s in there. Which kinds of node-labels are used, what relationship-types connect these nodes and which properties are floating around.
Usually all those answers are just a Cypher Statement away: