This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Load the companies | |
create index on :Company(CodeSiren); | |
import-cypher -d";" -i file:c:/infogreffe2014.csv -b 10000 -q create (e:Company {CodeSiren: {Siren}, Denomination: {Denomination}, Geolocalisation: {Geolocalisation}, DateImmatriculation: {DateImmatriculation}, Greffe: {Greffe}, FicheEntreprise: {FicheEntreprise}}); | |
//Load the codes | |
create index on :FormeJuridique(name); | |
import-cypher -d";" -i file:c:/infogreffe2014.csv -b 10000 -q with distinct {FormeJuridique} as FormeJuridique merge (:FormeJuridique {name: FormeJuridique}); | |
create index on :CodeAPE(name); | |
import-cypher -d";" -i file:c:/infogreffe2014.csv -b 10000 -q with distinct {CodeAPE} as CodeAPE, {Secteur} as Secteur merge (:CodeAPE {name: Secteur, code: CodeAPE}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Clean up the db | |
MATCH (n) | |
OPTIONAL MATCH (n)-[r]-() | |
DELETE n,r; | |
//----------------------- | |
//Import players | |
//----------------------- | |
CREATE CONSTRAINT ON (a:PLAYER) | |
ASSERT a.id IS UNIQUE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Clean up the db | |
MATCH (n) | |
OPTIONAL MATCH (n)-[r]-() | |
DELETE n,r; | |
//----------------------- | |
//Import people | |
//----------------------- | |
CREATE CONSTRAINT ON (a:EMPLOYEE) | |
ASSERT a.Employee_ID IS UNIQUE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Clean up the db | |
MATCH (n) | |
OPTIONAL MATCH (n)-[r]-() | |
DELETE n,r; | |
//----------------------- | |
//Import lobbies | |
//----------------------- | |
CREATE CONSTRAINT ON (a:Lobby) | |
ASSERT a.Identification_number IS UNIQUE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//The biggest tenders and the authorities behind it | |
Match (a:AUTHORITY)-[IS_AUTHORITY_OF]->(b:CONTRACT) | |
WHERE b.contract_contract_value_cost <> 'null' | |
RETURN b,a | |
ORDER BY b.contract_contract_value_cost DESC | |
LIMIT 10 | |
//The biggest spenders | |
Match (a:AUTHORITY) | |
WHERE a.total_value_cost_eur <> 'null' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Top Sellers | |
MATCH (t:Transfer)-[:FROM_CLUB]->(c) | |
WHERE t.transfer_season = '12/13' | |
RETURN c.club_name_short, sum(t.transfer_fee) | |
ORDER BY sum(t.transfer_fee) DESC | |
LIMIT 25 | |
// Top Buyers | |
MATCH (t:Transfer)-[:TO_CLUB]->(c) | |
WHERE t.transfer_season = '12/13' |
We can't make this file beautiful and searchable because it's too large.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"90/91","Aldair","/aldair/profil/spieler/4151","SL Benfica","Benfica","Portugal","AS Roma","AS Roma","Italy","Centre Back","24","6,30 Mill. £","6,30",1 | |
"90/91","Thomas Häßler","/thomas-hassler/profil/spieler/553","1. FC Köln","1. FC Köln","Germany","Juventus FC","Juventus","Italy","Attacking Midfield","24","5,46 Mill. £","5,46",2 | |
"90/91","Roberto Baggio","/roberto-baggio/profil/spieler/4153","AC Fiorentina","Fiorentina","Italy","Juventus FC","Juventus","Italy","Secondary Striker","23","5,43 Mill. £","5,43",3 | |
"90/91","Karl-Heinz Riedle","/karl-heinz-riedle/profil/spieler/13806","SV Werder Bremen","Werder Bremen","Germany","SS Lazio","Lazio","Italy","Centre Forward","24","5,25 Mill. £","5,25",4 | |
"90/91","Henrik Larsen","/henrik-larsen/profil/spieler/101330","Lyngby BK","Lyngby BK","Denmark","AC Pisa 1909","AC Pisa","Italy","Attacking Midfield","24","4,69 Mill. £","4,69",5 | |
"90/91","Gheorghe Hagi","/gheorghe-hagi/profil/spieler/7939","Steaua Bucharest","Steaua","Romania","Real Madrid","Real Madrid","Spain","Attack |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Clean up the db | |
MATCH (n) | |
OPTIONAL MATCH (n)-[r]-() | |
DELETE n,r; | |
//Load Players | |
USING PERIODIC COMMIT | |
LOAD CSV FROM "file:c:/all_transfers.csv" AS row | |
MERGE (:Player {player_name: row[1], player_url: row[2], player_position: row[9]}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----------------------- | |
//Clean everything | |
//----------------------- | |
MATCH (n) | |
OPTIONAL MATCH (n)-[r]-() | |
DELETE n,r; | |
//----------------------- | |
//Import authorities | |
//----------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----------------------- | |
//Import authorities | |
//----------------------- | |
CREATE CONSTRAINT ON (a:AUTHORITY) ASSERT a.contract_authority_official_name IS UNIQUE; | |
USING PERIODIC COMMIT 2000 | |
LOAD CSV WITH HEADERS FROM "file:c:/ted-contracts.csv" AS line | |
FIELDTERMINATOR ',' | |
WITH line |