Skip to content

Instantly share code, notes, and snippets.

View jexp's full-sized avatar
🐉
Watching the chamaeleon.

Michael Hunger jexp

🐉
Watching the chamaeleon.
View GitHub Profile
= Using hierarchical facets
We have a usecase with documents that are tagged with keywords in a theasaurus. This gists explains the model and is at the same time an invitation to suggest improvements. Because it would be nice to have something that performs better.
== The model
//setup
//hide
[source,cypher]
----
= Graph Initialization
I'm using Neo4j 2.0.1 with Cypher over the Batch REST API.
//hide
//setup
//output
[source,cypher]
----
CREATE (u:user {id: "u1", name: "Bill"})-[:CONTACT]->(c:contact {id: "c1"})
@jexp
jexp / gol.adoc
Last active August 29, 2015 13:58 — forked from boggle/gol.adoc

Game Of Life

Animated Glider

Game of Life is mathematic toy world that was invented by John Horton Conway in 1970. Game of Life is played on a grid of cells that are either dead or alive by simluating how the world evolves over a series of rounds. In each round cells die, survive, or are reborn depending on the number of neighbours they have. You can find out more about Game of Life by watching the video below or reading up on it in Wikipedia.

Media, Politics and Graphs

My dear friend and neo4j community member Ron recently pointed me to an amazing piece of work. Thomas Boeschoten, of the Utrecht Data School among many other things, published some amazing work of analysing the Dutch Talk Shows from different perspectives, using Gephi as one of his tools. Some of his results are nothing short of fascinating, and very cool to look at.

netwerk

…​

@jexp
jexp / gist:9607779
Last active August 29, 2015 13:57 — forked from anonymous/gist:9601556
package tests;
/**
*
* @author kb
*
*/
import org.neo4j.cypher.ExecutionEngine;
import org.neo4j.cypher.ExecutionResult;

A sales funnel

CREATE (s:Stage{name:'Suspect'})
CREATE (mql:Stage{name:'Marketing Qualified Lead'})
CREATE (ssc:Stage{name:'Self-Serve Customer'})
CREATE (ec:Stage{name:'Existing Customer'})
CREATE (ecno:Stage{name:'Existing Customer-No Opportunity'})
CREATE (sql:Stage{name:'Sales Qualified Lead'})

A complex query result projection in cypher

Table of Contents

Introduction

Sometimes it is better to request a complete object-tree from the (graph-)database at once instead sending more than one requests to the database and merging the results in program code.

= Untying the Graph Database Import Knot =
This Graphgist accompanies http://blog.bruggen.com/2013/12/untying-graph-database-import-knot.html[my blogpost of December 6th, 2013] which tries to explain the different types of questions that people should be asking themselves when thinking about importing data into http://www.neo4j.org[neo4j], and the tools that can contribute to finding the most optimal import strategy for your specific use case.
//setup
//hide
[source,cypher]
----
create (n1:Tool {id:'1',name:'Spreadsheets'}),
(n2:Tool {id:'2',name:'Cypher Statements'}),

The Game of Thrones in Neo4j

neoiscoming

The setup

 CREATE (westeros { name: "Westeros" })
= People, books and cities
== Modeling the Graph
Let's take a look at the domain model:
image::http://i.imgur.com/TJCNW0b.jpg?1[]
//setup
//hide
[source, cypher]