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:
//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); |
I hereby claim:
To claim this, I am signing this object:
//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}) |
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 |
//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; |
//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); |
//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 |
//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 |
//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); |
//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); |