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
@jexp
jexp / premier_league.adoc
Created March 20, 2014 13:25
Football Premier League UK example by @markhneedham

Premier Football League

GraphGist for Mark Needhams Football Domain Examples

premier league

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

…​

/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
@jexp
jexp / load-csv.txt
Created March 27, 2014 07:44
Import Webinar Files
//Loading CSV with Nodes
load csv with headers from
“file:/Users/rvanbruggen/Cloud/Neo Technology/Demo/DEMO-2.1.0-M01/IMPORT/INPUT/nodes.csv”
as nodes
create (n {id: nodes.Node, name: nodes.Name, type: nodes.Label})
//Loading CSV with Rels
load csv with headers from
“file:/Users/rvanbruggen/Cloud/Neo Technology/Demo/DEMO-2.1.0-M01/IMPORT/INPUT/rels.csv”
as rels
@jexp
jexp / SortedPagingTest.java
Created April 3, 2014 13:37
Top-Pipe Performance (Paging)
package org.neo4j;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.SortField;
import org.junit.*;
import org.neo4j.cypher.javacompat.ExecutionEngine;
import org.neo4j.cypher.javacompat.ExecutionResult;
import org.neo4j.graphdb.*;
import org.neo4j.graphdb.index.IndexHits;
import org.neo4j.graphdb.index.ReadableRelationshipIndex;
@jexp
jexp / one-row.csv
Last active August 29, 2015 13:58
A single row file
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
0
@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.

@jexp
jexp / queries.adoc
Created April 28, 2014 17:12
Query with Cypher

Query with Cypher

Easy to read, powerfully expressive.

Create a record for yourself

CREATE (you:Person {name:"You"})-[like:LIKE]->(us:Database:NoSql:Graph {name:"Neo4j" })
= 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"})
= 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]
----