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
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: https://github.com/MarkiesFredje/data-engineering-exercise/blob/master/data_engineer_exercise.ipynb
// json file download location: https://ecgplacesmw.colruytgroup.com/ecgplacesmw/v3/nl/places/filter/clp-places
//import into neo4j using apoc
//create indexes and constraint
create index on :Address(streetName);
create index on :City(name);
View keyvase.md

Keybase proof

I hereby claim:

  • I am rvanbruggen on github.
  • I am rvanbruggen (https://keybase.io/rvanbruggen) on keybase.
  • I have a public key ASDwd7urEf8nfaDTlrdqflg_wBBOd6QBBMOX-4HYFq6mZAo

To claim this, I am signing this object:

View 20160803 graphgems.cql
//GRAPHGEMS
//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})
@rvanbruggen
rvanbruggen / graphtechnologygraph_import.cypher
Last active Aug 20, 2019
Graph Technology Landscape Graph
View graphtechnologygraph_import.cypher
create index on :Node(name);
//load the data in raw form
Load csv with headers from "https://docs.google.com/spreadsheets/u/0/d/17WuC_B8RWzsSS8pw-NtY8qWeFFQGCGnCR5uXmENOFUI/export?format=csv&id=17WuC_B8RWzsSS8pw-NtY8qWeFFQGCGnCR5uXmENOFUI&gid=112267709" as csv
Merge (n:Node {name: csv.Name, type: csv.Type, tags: csv.Tags, link: csv.Link});
// move the 'type' property to a label and remove it as a property, USING APOC (not supported in Graphgist)
MATCH (n:Node)
with n, split(n.type, ",") AS futurelabels
unwind futurelabels as futurelabel
@rvanbruggen
rvanbruggen / import and clean data.cql
Last active Nov 28, 2018
ICIJ Medical Devices Dataset
View import and clean data.cql
//import the 3 csv files
USING PERIODIC COMMIT
LOAD CSV with headers from "https://docs.google.com/uc?export=download&id=1hNtMWHjrqOiMXU_xN7digO74ruzgCDeC" as line
CREATE (d:Device)
set d = line;
USING PERIODIC COMMIT
LOAD CSV with headers from "https://docs.google.com/uc?export=download&id=1lrMQNAF9k2ZeJJgfite85cvlHYpC7Ax8" as line
CREATE (e:Event)
set e = line;
@rvanbruggen
rvanbruggen / 1 - loadlineagedata.cql
Last active Oct 31, 2018
Demonstration of how to use the Neo4j Graph Database for Data Lineage
View 1 - loadlineagedata.cql
//load nodes
LOAD CSV WITH HEADERS FROM "https://docs.google.com/spreadsheets/u/0/d/1eL3IrbzgvZzkNnQUwDCZ1mwVfA6sypZYvDHBoeq48IM/export?format=csv&id=1eL3IrbzgvZzkNnQUwDCZ1mwVfA6sypZYvDHBoeq48IM&gid=0" AS csv
CALL apoc.create.nodes([csv.Label], [{id: csv.ID, name: csv.Name}]) YIELD node
RETURN count(node);
MATCH (n)
SET n:Node;
CREATE INDEX ON :Node(id);
@rvanbruggen
rvanbruggen / create_gped_db.cql
Last active Oct 19, 2018 — forked from jexp/graph_gist_template.adoc
Global Emission Power Database
View create_gped_db.cql
//create indexes
create index on :Classification(name);
create index on :SubClassification(name);
create index on :FuelType(name);
create index on :Country(name);
create index on :Plant(name);
create index on :Plant(id);
//FROM FUELTYPE TAB
@rvanbruggen
rvanbruggen / create_graphconnectgraph.cql
Last active Sep 18, 2018
GraphConnectGraph New York City 2018
View create_graphconnectgraph.cql
//import graphconnect 2018
create constraint on (s:Session)
assert s.event_key is unique;
create index on :Event_Type(name);
create index on :Session(name);
create index on :Speaker(name);
create index on :Tag(name);
create index on :Venue(name);
//import the sessions
@rvanbruggen
rvanbruggen / import_ROME.cql
Created Aug 29, 2018
Import ROME dataset into Neo4j
View import_ROME.cql
//import rome tree into Neo4j
load csv with headers from "https://docs.google.com/spreadsheets/d/1ks_hjKbO-n2We2glViM5D9RixU1ZtPi-0f7rJbfAY00/export?format=csv&id=1ks_hjKbO-n2We2glViM5D9RixU1ZtPi-0f7rJbfAY00&gid=744365839" as row
create (l:Leaf)
set l = row;
//set up the indexes
create index on :Leaf(Main);
create index on :Leaf(Category);
create index on :Leaf(Subcategory);
create index on :Leaf(Description);
View import_ESCO_csv_en.cql
//Import ESCO using CSV files
create index ON :Occupation(ISCOGroup);
create index ON :Occupation(altLabels);
create index ON :Skill(altLabels);
create index ON :ISCOGroup(code);
create index ON :Skill(conceptUri);
create index ON :ISCOGroup(conceptUri);
create index ON :Occupation(conceptUri);
create index ON :Occupation(preferredLabel);
create index ON :Skill(preferredLabel);
You can’t perform that action at this time.