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
rvanbruggen / 1-contacttracing-import.cql
Last active May 22, 2020
Contact tracing example #cypher #neo4j
View 1-contacttracing-import.cql
//environment: Neo4j Desktop 1.2.7, Neo4j Enteprise 3.5.17, apoc, gds 1.1.0
//or: Neo4j Enterprise 4.0.3, apoc (NOT later! a bug in apoc.coll.max/apoc.coll.min needs to be resolved)
//contact tracing data import
//full spreadsheet with synthetic data
// person sheet˝
rvanbruggen / 1-scm-background.txt
Last active Apr 7, 2020
Supply Chain Management Example in Neo4j
View 1-scm-background.txt
// Found article on
//Article by Sean P. Willems:
Table 2 Classifications Used to Label Every Stage in the Chains
Classifications label Activity
Dist_ A stage that distributes an item
Manuf_ A stage that manufactures or assembles an item
Part_ A stage that procures an item
View conflicting privileges in a fraudgraph.cql
// Fraud database available FROM
//work with a separate user and a role to experiment with conflicting roles
CREATE ROLE conflicted_role AS COPY OF reader;
GRANT ROLE conflicted_role TO conflicted_user;
//create conflicting privileges
View securing a fraudgraph.cql
// Fraud database available FROM
//what is related and how
match (n1)-[r]->(n2)
return distinct labels(n1) as `1st Label`, type(r) as `RelType`, labels(n2) as `2nd Label`
order by `1st Label`;
"1st Label""RelType""2nd Label"
rvanbruggen / securing the beergraph.cql
Created Jan 29, 2020
Securing the beergraph with Neo4j 4.0
View securing the beergraph.cql
//create database
create database beergraph;
create index on :BeerBrand(name);
create index on :BeerType(name);
create index on :Brewery(name);
create index on :AlcoholPercentage(value);
//Automated import in one query
load csv with headers from
rvanbruggen / 1-HRC email corpus import.cql
Last active Dec 12, 2019
HRC email corpus as a graph - with NLP
View 1-HRC email corpus import.cql
//setting up the indexes
create constraint on (p:Person)
assert p.alias is unique;
create constraint on (e:Email)
assert is unique;
create index on :Email(subject);
// Creating the graph
rvanbruggen / 0-carrefour dataset.txt
Last active Nov 27, 2019
Carrefour data challenge in Neo4j
View 0-carrefour dataset.txt
I have put the dataset on a google drive for download:
* the cleaned up JSON file:
* the ZIP of the cleaned up JSON file:
rvanbruggen / colruyt datascience homework assignment.cql
Created Nov 7, 2019
colruyt datascience homework assignment.cql
View colruyt datascience homework assignment.cql
//colruyt datascience homework assignment in Neo4j
// from:
// json file download location:
//import into neo4j using apoc
//create indexes and constraint
create index on :Address(streetName);
create index on :City(name);

Keybase proof

I hereby claim:

  • I am rvanbruggen on github.
  • I am rvanbruggen ( on keybase.
  • I have a public key ASDwd7urEf8nfaDTlrdqflg_wBBOd6QBBMOX-4HYFq6mZAo

To claim this, I am signing this object:

View 20160803 graphgems.cql
//10 (?) cypher queries that will blow your mind
//1. The meta-graph
MATCH (a)-[r]->(b)
WITH labels(a) AS a_labels,type(r) AS rel_type,labels(b) AS b_labels
UNWIND a_labels as l
UNWIND b_labels as l2
MERGE (a:Meta_Node {name:l})
MERGE (b:Meta_Node {name:l2})
You can’t perform that action at this time.