Skip to content

Instantly share code, notes, and snippets.

Rik Van Bruggen rvanbruggen

Block or report user

Report or block rvanbruggen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View BeerGraph with in-graph alcoholpercentage-index
***
*** SHOW ME THE IN-GRAPH-ALCOHOLINDEX
***
start
alcperc=node:node_auto_index(type="AlcoholPercentage")
match
p=(alcperc-[:PRECEDES]->())
return p;
View Belgian Beer Graph - Cypher Query Examples
*************************************************
**** BEER DATASET - CYPHER Query Examples ****
*************************************************
**** Beers from same brewery as DUVEL ****
START duvel=node:node_auto_index(name="Duvel")
MATCH
duvel<-[:BREWS]-brewery,
View Cool ConceptNet Graph Queries
******************************************
*** Some cool ConceptNet Graph Queries ***
******************************************
*** Look up a concept in the Graph ***
START beer=node:Concepts(id="/c/en/beer")
return beer;
*** Figure out the relations of a concept to other concepts ***
@rvanbruggen
rvanbruggen / My first BeerGist
Last active Dec 19, 2015 — forked from nawroth/tutorial-graphgist
BeerGraph GraphGist
View My first BeerGist
= My simple BeerGraph Datamodel =
Let's see if I can create a graphgist for my beers
[source,cypher]
----
CREATE (brewery:brewery{name:'Brewery'}), (beerbrand:beerbrand{name:'BeerBrand'}), (alcperc:alcoholpercentage{name:'Percentage'}), (beertype:beertype{name:'BeerType'})
CREATE (alcpercbefore:alcoholpercentage{name:'PercentageBefore'}), (alcpercafter:alcoholpercentage{name:'PercentageAfter'})
CREATE brewery-[:BREWS]->beerbrand<-[:HAS_ALCHOLHOL_PERCENTAGE]-alcperc
CREATE alcpercbefore-[:PRECEDES]->alcperc-[:PRECEDES]->alcpercafter
@rvanbruggen
rvanbruggen / Business Rule Recommendation gist
Last active Dec 19, 2015
Business Rules / Recommendation gist
View Business Rule Recommendation gist
= Business Rule / Recommendation gist =
In this simple example, we want to highlight the power of graphs to describe, discover, visualise and implement powerful business rule-based recommendations.
In the example, we will create a simple graph containing
- a +person+ ("Rik")
- a +city+ ("London")
- an +age+ ("39")
- a +child+ ("Toon")
and all the required relationships from the person to the city, to his age, and his child.
@rvanbruggen
rvanbruggen / Last.fm Dataset Overview Gist
Last active May 25, 2016
Last.fm Dataset Overview Gist
View Last.fm Dataset Overview Gist
= Last.fm Dataset Gist =
Earlier this month, I published http://blog.neo4j.org/2013/07/fun-with-music-neo4j-and-talend.html[a blog post] about my fun with some self-exported http://last.fm[Last.fm] data. With this Gist, I would like to provide a bit more practical detail on the dataset and how you could use it.
Let's first create an overview graph of the model.
image::http://2.bp.blogspot.com/-uNPggNP9A3c/Ud7HDhwpkbI/AAAAAAAAAK4/AZd25Q0h-j4/s640/Screen+Shot+2013-07-11+at+16.52.59.png[]
[source,cypher]
----
@rvanbruggen
rvanbruggen / linkedin-query.py
Last active May 28, 2019 — forked from ThomasCabrol/linkedin-2-query.py
Python script to query your LinkedIn network and get all your network's connections and their interconnections.
View linkedin-query.py
#!/usr/bin/env python
# encoding: utf-8
"""
linkedin-query.py
Created by Thomas Cabrol on 2012-12-03.
Customised by Rik Van Bruggen
Copyright (c) 2012 dataiku. All rights reserved.
Building the LinkedIn Graph
@rvanbruggen
rvanbruggen / linkedin cypher.cql
Created Aug 9, 2013
Example queries to interactively query a linkedin-based neo4j database.
View linkedin cypher.cql
// Find Shortest paths between two contacts
START
n=node:node_auto_index(name='Emil Eifrem'),
m=node:node_auto_index(name='Steven Noels')
MATCH
p = AllShortestPaths(n-[*]-m)
RETURN p;
// Find all the relationships between two "first degree" contacts of RVB
@rvanbruggen
rvanbruggen / Orienteering.adoc
Last active Aug 24, 2016
Orienteering Gist
View Orienteering.adoc

Orienteering Gist

This is the Orienteering Dataset based on the blog.neo4j.org post.

XrXYFfsENq 5EpcOtyGN1UU7Z3RGhYdqfnWAjEafGjmmh0nCYdu8 LfImLcm7c3bjRIX8wJUnYaIpKFoAoMO3igUiVre3HKoYkqG5fHVkdmBfudfT7qlF7QbeA

It’s a simple, three-leg training course in an Antwerp park. The graph is really simple: it contains * the Controls of the simple course that I have here * the different route choices (in the form of a series of Waypoints) that an Orienteer could make to go from start to control point, to control point, to finish. Each of the "legs" of the course, and every route choice of that "leg", has a certain distance and runnability score (value from 0,1 to 1). We are thus dealing with a classic pathfinding problem, where we want to find the best route choice to complete the course.

@rvanbruggen
rvanbruggen / IKEA graph nodes
Last active Dec 23, 2015
Setting up & querying the IKEA graph
View IKEA graph nodes
create ({id:'1',name:'DeepPAX',type:'ShopArticle'});
create ({id:'112996',name:'Screw',type:'Component'});
create ({id:'124593',name:'Nail',type:'Component'});
create ({id:'113434',name:'ScrewLock',type:'Component'});
create ({id:'101375',name:'WoodStick',type:'Component'});
create ({id:'100402',name:'Screw',type:'Component'});
create ({id:'100644',name:'Screw',type:'Component'});
create ({id:'100347',name:'Screw',type:'Component'});
create ({id:'103693',name:'LockPlate',type:'Component'});
create ({id:'123773',name:'CornerCover',type:'Component'});
You can’t perform that action at this time.