SlideShare a Scribd company logo
|---------+--------------------+-----------------------------------------+--------------------+------------|
| season | playerName | playerUri | playerPosition | playerAge |
|---------+--------------------+-----------------------------------------+--------------------+------------|
| 90/91 | Aldair | /aldair/profil/spieler/4151 | Centre Back | 24 |
| 90/91 | Thomas Häßler | /thomas-hassler/profil/spieler/553 | Attacking Midfield | 24 |
| 90/91 | Roberto Baggio | /roberto-baggio/profil/spieler/4153 | Secondary Striker | 23 |
| 90/91 | Karl-Heinz Riedle | /karl-heinz-riedle/profil/spieler/13806 | Centre Forward | 24 |
| 90/91 | Henrik Larsen | /henrik-larsen/profil/spieler/101330 | Attacking Midfield | 24 |
| 90/91 | Gheorghe Hagi | /gheorghe-hagi/profil/spieler/7939 | Attacking Midfield | 25 |
| 90/91 | Hristo Stoichkov | /hristo-stoichkov/profil/spieler/7938 | Left Wing | 24 |
| 90/91 | Brian Laudrup | /brian-laudrup/profil/spieler/39667 | Centre Forward | 21 |
| 90/91 | Miguel Ángel Nadal | /miguel-angel-nadal/profil/spieler/7676 | Centre Back | 23 |
|---------+--------------------+-----------------------------------------+--------------------+------------|
|-------------------+---------------------+-------------------------------------+--------------------|
| sellerClubName | sellerClubNameShort | sellerClubUri | sellerClubCountry |
|-------------------+---------------------+-------------------------------------+--------------------|
| SL Benfica | Benfica | /benfica/startseite/verein/294 | Portugal |
| 1. FC Köln | 1. FC Köln | /1-fc-koln/startseite/verein/3 | Germany |
| ACF Fiorentina | Fiorentina | /fiorentina/startseite/verein/430 | Italy |
| SV Werder Bremen | Werder Bremen | /werder-bremen/startseite/verein/86 | Germany |
| Lyngby BK | Lyngby BK | /lyngby-bk/startseite/verein/369 | Denmark |
| Steaua Bucharest | Steaua | /steaua/startseite/verein/301 | Romania |
| CSKA Sofia | CSKA Sofia | /cska-sofia/startseite/verein/208 | Bulgaria |
| KFC Uerdingen 05 | KFC Uerdingen | /kfc-uerdingen/startseite/verein/95 | Germany |
| RCD Mallorca | RCD Mallorca | /rcd-mallorca/startseite/verein/237 | Spain |
|-------------------+---------------------+-------------------------------------+--------------------|
|----------------+--------------------+-------------------------------------+-------------------|
| buyerClubName | buyerClubNameShort | buyerClubUri | buyerClubCountry |
|----------------+--------------------+-------------------------------------+-------------------|
| AS Roma | AS Roma | /as-roma/startseite/verein/12 | Italy |
| Juventus FC | Juventus | /juventus/startseite/verein/506 | Italy |
| Juventus FC | Juventus | /juventus/startseite/verein/506 | Italy |
| SS Lazio | Lazio | /lazio/startseite/verein/398 | Italy |
| AC Pisa 1909 | AC Pisa | /ac-pisa/startseite/verein/4172 | Italy |
| Real Madrid | Real Madrid | /real-madrid/startseite/verein/418 | Spain |
| FC Barcelona | FC Barcelona | /fc-barcelona/startseite/verein/131 | Spain |
| Bayern Munich | Bayern Munich | /bayern-munich/startseite/verein/27 | Germany |
| FC Barcelona | FC Barcelona | /fc-barcelona/startseite/verein/131 | Spain |
|----------------+--------------------+-------------------------------------+-------------------|
|--------------------------------------------------------+-------------+---------------|
| transferUri | transferFee | transferRank |
|--------------------------------------------------------+-------------+---------------|
| /jumplist/transfers/spieler/4151/transfer_id/6993 | £6.75m | 1 |
| /jumplist/transfers/spieler/553/transfer_id/2405 | £5.85m | 2 |
| /jumplist/transfers/spieler/4153/transfer_id/84533 | £5.81m | 3 |
| /jumplist/transfers/spieler/13806/transfer_id/19054 | £5.63m | 4 |
| /jumplist/transfers/spieler/101330/transfer_id/275067 | £5.03m | 5 |
| /jumplist/transfers/spieler/7939/transfer_id/19343 | £3.23m | 6 |
| /jumplist/transfers/spieler/7938/transfer_id/11563 | £2.25m | 7 |
| /jumplist/transfers/spieler/39667/transfer_id/90285 | £2.25m | 8 |
| /jumplist/transfers/spieler/7676/transfer_id/11828 | £2.10m | 9 |
|--------------------------------------------------------+-------------+---------------|
players
id
name
position
clubs
id
name
country
transfers
id
fee
player_age
player_id
from_club_id
to_club_id
season
Records
in tables
Nodes
"Soft"
relationships
computed at
query time
"Hard"
relationships
built into the
data store
CREATE TABLE players (
"id" character varying(100)
NOT NULL PRIMARY KEY,
"name" character varying(150) NOT NULL,
"position" character varying(20)
);
INSERT INTO players
VALUES('/aldair/profil/spieler/4151', 'Aldair', 'Centre Back');
INSERT INTO players
VALUES('/thomas-hassler/profil/spieler/553', 'Thomas Häßler',
'Attacking Midfield');
INSERT INTO players VALUES('/roberto-baggio/profil/spieler/4153',
'Roberto Baggio', 'Secondary Striker');
CREATE TABLE clubs (
"id" character varying(100)
NOT NULL PRIMARY KEY,
"name" character varying(50) NOT NULL,
"country" character varying(50)
);
INSERT INTO clubs VALUES('/hertha-bsc/startseite/verein/44',
'Hertha BSC', 'Germany');
INSERT INTO clubs VALUES('/cfr-cluj/startseite/verein/7769', 'CFR
Cluj', 'Romania');
INSERT INTO clubs VALUES('/real-sociedad/startseite/verein/681',
'Real Sociedad', 'Spain');
CREATE TABLE transfers (
"id" character varying(100) NOT NULL PRIMARY KEY,
"fee" character varying(50) NOT NULL,
"numericFee" integer NOT NULL,
"player_age" smallint NOT NULL,
"season" character varying(5) NOT NULL,
"player_id" character varying(100) NOT NULL REFERENCES players (id),
"from_club_id" character varying(100) NOT NULL REFERENCES clubs (id),
"to_club_id" character varying(100) NOT NULL REFERENCES clubs (id)
);
INSERT INTO transfers VALUES('/jumplist/transfers/spieler/4151/transfer_id/6993', '
£6.75m', 6750000, '90/91', 24, '/aldair/profil/spieler/4151',
'/benfica/startseite/verein/294', '/as-roma/startseite/verein/12');
INSERT INTO transfers VALUES('/jumplist/transfers/spieler/553/transfer_id/2405', '
£5.85m', 5850000, '90/91', 24, '/thomas-hassler/profil/spieler/553',
'/1-fc-koln/startseite/verein/3', '/juventus/startseite/verein/506');
INSERT INTO transfers VALUES('/jumplist/transfers/spieler/4153/transfer_id/84533', '
£5.81m', 5810000, '90/91', 23, '/roberto-baggio/profil/spieler/4153',
'/fiorentina/startseite/verein/430', '/juventus/startseite/verein/506');
LOAD CSV WITH HEADERS FROM "(file|http)://" AS row
MATCH (:Label {property: row.header})
CREATE (:Label {property: row.header})
MERGE (:Label {property: row.header})
LOAD CSV WITH HEADERS FROM "(file|http)://" AS row
MATCH (:Label {property: row.header})
CREATE (:Label {property: row.header})
MERGE (:Label {property: row.header})
LOAD CSV WITH HEADERS FROM "(file|http)://" AS row
MATCH (:Label {property: row.header})
CREATE (:Label {property: row.header})
MERGE (:Label {property: row.header})
LOAD CSV WITH HEADERS FROM "(file|http)://" AS row
MATCH (:Label {property: row.header})
CREATE (:Label {property: row.header})
MERGE (:Label {property: row.header})
LOAD CSV WITH HEADERS FROM "(file|http)://" AS row
MATCH (:Label {property: row.header})
CREATE (:Label {property: row.header})
MERGE (:Label {property: row.header})
LOAD CSV WITH HEADERS
FROM "file:///transfers.csv"
AS row
RETURN COUNT(*)
LOAD CSV WITH HEADERS
FROM "file:///transfers.csv"
AS row
RETURN row
LIMIT 1
LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row
CREATE (player:Player {
id: row.playerUri,
name: row.playerName,
position: row.playerPosition
})
LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row
CREATE (player:Player {
id: row.playerUri,
name: row.playerName,
position: row.playerPosition
})
CREATE CONSTRAINT ON (player:Player)
ASSERT player.id IS UNIQUE
LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row
CREATE (player:Player {
id: row.playerUri,
name: row.playerName,
position: row.playerPosition
})
Node 25 already exists with label Player and property
"id"=[/peter-lux/profil/spieler/84682]
LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row
MERGE (player:Player {id: row.playerUri})
ON CREATE SET player.name = row.playerName,
player.position = row.playerPosition
CREATE CONSTRAINT ON (club:Club)
ASSERT club.id IS UNIQUE
LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row
MERGE (club:Club {id: row.sellerClubUri})
ON CREATE SET club.name = row.sellerClubName,
club.country = row.sellerClubCountry;
LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row
MERGE (club:Club {id: row.buyerClubUri})
ON CREATE SET club.name = row.buyerClubName,
club.country = row.buyerClubCountry;
CREATE CONSTRAINT ON (transfer:Transfer)
ASSERT transfer.id IS UNIQUE
LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row
MATCH (player:Player {id: row.playerUri})
MATCH (source:Club {id: row.sellerClubUri})
MATCH (destination:Club {id: row.buyerClubUri})
MERGE (t:Transfer {id: row.transferUri})
ON CREATE SET t.season = row.season, t.rank = row.transferRank,
t.fee = row.transferFee
MERGE (t)-[:OF_PLAYER { age: row.playerAge }]->(player)
MERGE (t)-[:FROM_CLUB]->(source)
MERGE (t)-[:TO_CLUB]->(destination)
LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row
MATCH (player:Player {id: row.playerUri})
MATCH (source:Club {id: row.sellerClubUri})
MATCH (destination:Club {id: row.buyerClubUri})
MERGE (t:Transfer {id: row.transferUri})
ON CREATE SET t.season = row.season, t.rank = row.transferRank,
t.fee = row.transferFee
MERGE (t)-[:OF_PLAYER { age: row.playerAge }]->(player)
MERGE (t)-[:FROM_CLUB]->(source)
MERGE (t)-[:TO_CLUB]->(destination)
LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row
MATCH (player:Player {id: row.playerUri})
MATCH (source:Club {id: row.sellerClubUri})
MATCH (destination:Club {id: row.buyerClubUri})
MERGE (t:Transfer {id: row.transferUri})
ON CREATE SET t.season = row.season, t.rank = row.transferRank,
t.fee = row.transferFee
MERGE (t)-[:OF_PLAYER { age: row.playerAge }]->(player)
MERGE (t)-[:FROM_CLUB]->(source)
MERGE (t)-[:TO_CLUB]->(destination)
LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row
MATCH (player:Player {id: row.playerUri})
MATCH (source:Club {id: row.sellerClubUri})
MATCH (destination:Club {id: row.buyerClubUri})
MERGE (t:Transfer {id: row.transferUri})
ON CREATE SET t.season = row.season, t.rank = row.transferRank,
t.fee = row.transferFee
MERGE (t)-[:OF_PLAYER { age: row.playerAge }]->(player)
MERGE (t)-[:FROM_CLUB]->(source)
MERGE (t)-[:TO_CLUB]->(destination)
CREATE CONSTRAINT ON (club:Club)
ASSERT club.id IS UNIQUE
CREATE CONSTRAINT ON (club:Club)
ASSERT exists(club.name)
CREATE CONSTRAINT ON ()-[player:OF_PLAYER]-()
ASSERT exists(player.age)
SELECT *
FROM players
WHERE players.name = 'Cristiano Ronaldo'
SELECT *
FROM players
WHERE players.name = 'Cristiano Ronaldo'
MATCH (player:Player { name: "Cristiano Ronaldo" })
RETURN player
SELECT *
FROM players
WHERE players.name = 'Cristiano Ronaldo'
MATCH (player:Player { name: "Cristiano Ronaldo" })
RETURN player
SELECT *
FROM players
WHERE players.name = 'Cristiano Ronaldo'
MATCH (player:Player { name: "Cristiano Ronaldo" })
RETURN player
SELECT players.name, t."numericFee", t.season
FROM transfers AS t
JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id
JOIN clubs AS clubTo ON t.to_club_id = clubTo.id
JOIN players ON t.player_id = players.id
WHERE clubFrom.name = 'Tottenham Hotspur' AND clubTo.name = 'Manchester United'
SELECT players.name, t."numericFee", t.season
FROM transfers AS t
JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id
JOIN clubs AS clubTo ON t.to_club_id = clubTo.id
JOIN players ON t.player_id = players.id
WHERE clubFrom.name = 'Tottenham Hotspur' AND clubTo.name = 'Manchester United'
MATCH (from:Club)<-[:FROM_CLUB]-(transfer:Transfer)-[:TO_CLUB]->(to:Club),
(transfer)-[:OF_PLAYER]->(player)
WHERE from.name = "Tottenham Hotspur" AND to.name = "Manchester United"
RETURN player.name, transfer.numericFee, transfer.season
SELECT players.name, t."numericFee", t.season
FROM transfers AS t
JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id
JOIN clubs AS clubTo ON t.to_club_id = clubTo.id
JOIN players ON t.player_id = players.id
WHERE clubFrom.name = 'Tottenham Hotspur' AND clubTo.name = 'Manchester United'
MATCH (from:Club)<-[:FROM_CLUB]-(transfer:Transfer)-[:TO_CLUB]->(to:Club),
(transfer)-[:OF_PLAYER]->(player)
WHERE from.name = "Tottenham Hotspur" AND to.name = "Manchester United"
RETURN player.name, transfer.numericFee, transfer.season
MATCH (from:Club)<-[:FROM_CLUB]-(transfer:Transfer)-[:TO_CLUB]->(to:Club),
(transfer)-[:OF_PLAYER]->(player)
WHERE from.name = "Tottenham Hotspur" AND to.name = "Manchester United"
RETURN player.name, transfer.numericFee, transfer.season
|------------------------------------------+--------------------+--------------------|
| playerUri | playerName | playerNationality |
|------------------------------------------+--------------------+--------------------|
| /aldair/profil/spieler/4151 | Aldair | Brazil |
| /thomas-hassler/profil/spieler/553 | Thomas Häßler | Germany |
| /roberto-baggio/profil/spieler/4153 | Roberto Baggio | Italy |
| /karl-heinz-riedle/profil/spieler/13806 | Karl-Heinz Riedle | Germany |
| /henrik-larsen/profil/spieler/101330 | Henrik Larsen | Denmark |
| /gheorghe-hagi/profil/spieler/7939 | Gheorghe Hagi | Romania |
| /hristo-stoichkov/profil/spieler/7938 | Hristo Stoichkov | Bulgaria |
| /brian-laudrup/profil/spieler/39667 | Brian Laudrup | Denmark |
| /miguel-angel-nadal/profil/spieler/7676 | Miguel Ángel Nadal | Spain |
|------------------------------------------+--------------------+--------------------|
players
id
name
position
nationality
clubs
id
name
country
transfers
id
fee
player_age
player_id
from_club_id
to_club_id
season
ALTER TABLE players
ADD COLUMN nationality varying(30);
UPDATE players
SET nationality = 'Brazil'
WHERE players.id = '/aldair/profil/spieler/4151';
UPDATE players
SET nationality = 'Germany'
WHERE players.id ='/ulf-kirsten/profil/spieler/74';
UPDATE players
SET nationality = 'England'
WHERE players.id ='/john-lukic/profil/spieler/28241';
LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row
MATCH (player:Player {id: row.playerUri})
SET player.nationality = row.playerNationality
SELECT players.name, clubFrom.name, clubTo.name, t."numericFee", t.season
FROM transfers AS t
JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id
JOIN clubs AS clubTo ON t.to_club_id = clubTo.id
JOIN players ON t.player_id = players.id
WHERE clubFrom.country = 'England' AND clubTo.country = 'England'
AND players.nationality = 'England'
ORDER BY t."numericFee" DESC
LIMIT 10
SELECT players.name, clubFrom.name, clubTo.name, t."numericFee", t.season
FROM transfers AS t
JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id
JOIN clubs AS clubTo ON t.to_club_id = clubTo.id
JOIN players ON t.player_id = players.id
WHERE clubFrom.country = 'England' AND clubTo.country = 'England'
AND players.nationality = 'England'
ORDER BY t."numericFee" DESC
LIMIT 10
MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player)
WHERE to.country = "England" AND from.country = "England" AND player.nationality = "England"
RETURN player.name, from.name, to.name, t.numericFee, t.season
ORDER BY t.numericFee DESC
LIMIT 10
SELECT players.name, clubFrom.name, clubTo.name, t."numericFee", t.season
FROM transfers AS t
JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id
JOIN clubs AS clubTo ON t.to_club_id = clubTo.id
JOIN players ON t.player_id = players.id
WHERE clubFrom.country = 'England' AND clubTo.country = 'England'
AND players.nationality = 'England'
ORDER BY t."numericFee" DESC
LIMIT 10
MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player)
WHERE to.country = "England" AND from.country = "England" AND player.nationality = "England"
RETURN player.name, from.name, to.name, t.numericFee, t.season
ORDER BY t.numericFee DESC
LIMIT 10
|----------------------+----------------|
| country | confederation |
|----------------------+----------------|
| Afghanistan | afc |
| Albania | uefa |
| Algeria | caf |
| American Samoa | ofc |
| Andorra | uefa |
| Angola | caf |
| Anguilla | concacaf |
| Antigua and Barbuda | concacaf |
| Argentina | conmebol |
|----------------------+----------------|
|-----------+-----------+-------------------------------------------------|
| urlName | shortName | region |
|-----------+-----------+-------------------------------------------------|
| afc | AFC | Asia |
| uefa | UEFA | Europe |
| ofc | OFC | Oceania |
| conmebol | CONMEBOL | South America |
| concacaf | CONCACAF | North American, Central American and Caribbean |
| caf | CAF | Africa |
|-----------+-----------+-------------------------------------------------|
players
id
name
position
country_id
clubs
id
name
country_id
transfers
id
fee
player_age
player_id
from_club_id
to_club_id
season
countries
id
name
confederation_id
confederations
id
shortName
name
region
CREATE TABLE confederations (
"id" character varying(10)
NOT NULL PRIMARY KEY,
"shortName" character varying(50) NOT NULL,
"name" character varying(100) NOT NULL,
"region" character varying(100) NOT NULL
);
INSERT INTO confederations VALUES('afc', 'AFC', 'Asian Football
Confederation', 'Asia');
INSERT INTO confederations VALUES('uefa', 'UEFA', 'Union of
European Football Associations', 'Europe');
INSERT INTO confederations VALUES('ofc', 'OFC', 'Oceania Football
Confederation', 'Oceania');
CREATE TABLE countries (
"code" character varying(3)
NOT NULL PRIMARY KEY,
"name" character varying(50)
NOT NULL,
"federation" character varying(10) NOT NULL
REFERENCES confederations (id)
);
INSERT INTO countries VALUES('MNE', 'Montenegro', 'uefa');
INSERT INTO countries VALUES('LTU', 'Lithuania', 'uefa');
INSERT INTO countries VALUES('CAM', 'Cambodia', 'afc');
INSERT INTO countries VALUES('SUI', 'Switzerland', 'uefa');
INSERT INTO countries VALUES('ETH', 'Ethiopia', 'caf');
INSERT INTO countries VALUES('ARU', 'Aruba', 'concacaf');
INSERT INTO countries VALUES('SWZ', 'Swaziland', 'caf');
INSERT INTO countries VALUES('PLE', 'Palestine', 'afc');
ALTER TABLE clubs
ADD COLUMN country_id character varying(3)
REFERENCES countries(code);
UPDATE clubs AS cl
SET country_id = c.code
FROM clubs
INNER JOIN countries AS c
ON c.name = clubs.country
WHERE cl.id = clubs.id;
# select * from clubs limit 5;
id | name | country | country_id
----------------------------------------+-----------------------------+---------------+------------
/san-jose-clash/startseite/verein/4942 | San Jose Clash | United States | USA
/chicago/startseite/verein/432 | Chicago Fire | United States | USA
/gz-evergrande/startseite/verein/10948 | Guangzhou Evergrande Taobao | China | CHN
/as-vita-club/startseite/verein/2225 | AS Vita Club Kinshasa | Congo DR | CGO
/vicenza/startseite/verein/2655 | Vicenza Calcio | Italy | ITA
(6 rows)
ALTER TABLE clubs
DROP COLUMN country;
ALTER TABLE players
ADD COLUMN country_id character varying(3)
REFERENCES countries(code);
UPDATE players AS p
SET country_id = c.code
FROM players
INNER JOIN countries AS c
ON c.name = players.nationality
WHERE p.id = players.id;
# select * from players limit 5;
id | name | position | nationality | country_id
-----------------------------------------+-------------------+--------------------+-------------+------------
/dalian-atkinson/profil/spieler/200738 | Dalian Atkinson | Attacking Midfield | England | ENG
/steve-redmond/profil/spieler/177056 | Steve Redmond | Centre Back | England | ENG
/bert-konterman/profil/spieler/6252 | Bert Konterman | Centre Back | Netherlands | NED
/lee-philpott/profil/spieler/228030 | Lee Philpott | Midfield | England | ENG
/tomasz-frankowski/profil/spieler/14911 | Tomasz Frankowski | Centre Forward | Poland | POL
(5 rows)
ALTER TABLE players
DROP COLUMN nationality;
LOAD CSV WITH HEADERS FROM "file:///confederations.csv" AS row
MERGE (c:Confederation {id: row.urlName})
ON CREATE SET c.shortName = row.shortName,
c.region = row.region,
c.name = row.name
LOAD CSV WITH HEADERS FROM "file:///countries.csv" AS row
MATCH (conf:Confederation {id: row.confederation })
MERGE (country:Country {id: row.countryCode})
ON CREATE SET country.name = row.country
MERGE (country)-[:PART_OF]->(conf)
MATCH (club:Club)
MATCH (country:Country {name: club.country})
MERGE (club)-[:PART_OF]->(country)
REMOVE club.country
MATCH (player:Player)
MATCH (country:Country {name: player.nationality})
MERGE (player)-[:PLAYS_FOR]->(country)
REMOVE player.nationality
SELECT players.name, clubFrom.name, clubTo.name, t."numericFee", t.season
FROM transfers AS t
JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id
JOIN clubs AS clubTo ON t.to_club_id = clubTo.id
JOIN players ON t.player_id = players.id
WHERE clubFrom.country = 'England' AND clubTo.country = 'England'
AND players.nationality = 'England'
ORDER BY t."numericFee" DESC
LIMIT 10
MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player)
WHERE to.country = "England" AND from.country = "England" AND player.nationality = "England"
RETURN player.name, from.name, to.name, t.numericFee, t.season
ORDER BY t.numericFee DESC
LIMIT 10
SELECT players.name, clubFrom.name, clubTo.name, t."numericFee", t.season
FROM transfers AS t
JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id
JOIN clubs AS clubTo ON t.to_club_id = clubTo.id
JOIN players ON t.player_id = players.id
JOIN countries AS fromCount ON clubFrom.country_id = fromCount.code
JOIN countries AS toCount ON clubTo.country_id = toCount.code
JOIN countries AS playerCount ON players.country_id = playerCount.code
WHERE fromCount.name = 'England' AND toCount.name = 'England' AND playerCount.name = 'England'
ORDER BY t."numericFee" DESC
LIMIT 10
MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player),
(player)-[:PLAYS_FOR]->(country:Country), (to)-[:PART_OF]->(country)<-[:PART_OF]-(from)
WHERE country.name = "England"
RETURN player.name, from.name, to.name, t.numericFee, t.season
ORDER BY t.numericFee DESC
LIMIT 10
SELECT players.name, clubFrom.name, clubTo.name, t."numericFee", t.season
FROM transfers AS t
JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id
JOIN clubs AS clubTo ON t.to_club_id = clubTo.id
JOIN players ON t.player_id = players.id
JOIN countries AS fromCount ON clubFrom.country_id = fromCount.code
JOIN countries AS toCount ON clubTo.country_id = toCount.code
JOIN countries AS playerCount ON players.country_id = playerCount.code
WHERE fromCount.name = 'England' AND toCount.name = 'England' AND playerCount.name = 'England'
ORDER BY t."numericFee" DESC
LIMIT 10
MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player),
(player)-[:PLAYS_FOR]->(country:Country), (to)-[:PART_OF]->(country)<-[:PART_OF]-(from)
WHERE country.name = "England"
RETURN player.name, from.name, to.name, t.numericFee, t.season
ORDER BY t.numericFee DESC
LIMIT 10
SELECT players.name, clubFrom.name, clubTo.name, t."numericFee", t.season
FROM transfers AS t
JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id
JOIN clubs AS clubTo ON t.to_club_id = clubTo.id
JOIN players ON t.player_id = players.id
JOIN countries AS fromCount ON clubFrom.country_id = fromCount.code
JOIN countries AS toCount ON clubTo.country_id = toCount.code
JOIN countries AS playerCount ON players.country_id = playerCount.code
WHERE fromCount.name = 'England' AND toCount.name = 'England' AND playerCount.name = 'England'
ORDER BY t."numericFee" DESC
LIMIT 10
MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player),
(player)-[:PLAYS_FOR]->(country:Country), (to)-[:PART_OF]->(country)<-[:PART_OF]-(from)
WHERE country.name = "England"
RETURN player.name, from.name, to.name, t.numericFee, t.season
ORDER BY t.numericFee DESC
LIMIT 10
SELECT * FROM transfers AS t
JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id
JOIN clubs AS clubTo ON t.to_club_id = clubTo.id
JOIN players ON t.player_id = players.id
JOIN countries AS fromCountry ON clubFrom.country_id = fromCountry.code
JOIN countries AS toCountry ON clubTo.country_id = toCountry.code
JOIN confederations AS fromConfederation ON fromCountry.federation = fromConfederation.id
JOIN confederations AS toConfederation ON toCountry.federation = toConfederation.id
WHERE fromConfederation.id = 'afc' AND toConfederation.id = 'uefa'
ORDER BY t."numericFee" DESC
LIMIT 10
MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player),
(from)-[:PART_OF*2]->(:Confederation {id: "afc"}),
(to)-[:PART_OF*2]->(:Confederation {id: "uefa"})
RETURN player.name, from.name, to.name, t.numericFee, t.season
ORDER BY t.numericFee DESC
LIMIT 10
SELECT * FROM transfers AS t
JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id
JOIN clubs AS clubTo ON t.to_club_id = clubTo.id
JOIN players ON t.player_id = players.id
JOIN countries AS fromCountry ON clubFrom.country_id = fromCountry.code
JOIN countries AS toCountry ON clubTo.country_id = toCountry.code
JOIN confederations AS fromConfederation ON fromCountry.federation = fromConfederation.id
JOIN confederations AS toConfederation ON toCountry.federation = toConfederation.id
WHERE fromConfederation.id = 'afc' AND toConfederation.id = 'uefa'
ORDER BY t."numericFee" DESC
LIMIT 10
MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player),
(from)-[:PART_OF*2]->(:Confederation {id: "afc"}),
(to)-[:PART_OF*2]->(:Confederation {id: "uefa"})
RETURN player.name, from.name, to.name, t.numericFee, t.season
ORDER BY t.numericFee DESC
LIMIT 10
# dt
List of relations
Schema | Name | Type | Owner
--------+----------------+-------+-------------
public | clubs | table | markneedham
public | confederations | table | markneedham
public | countries | table | markneedham
public | players | table | markneedham
public | transfers | table | markneedham
(5 rows)
CALL db.labels()
+=============+
|label |
+=============+
|Player |
+-------------+
|Club |
+-------------+
|Transfer |
+-------------+
|Loan |
+-------------+
|Confederation|
+-------------+
|Country |
+-------------+
# d+ countries
Table "public.countries"
Column | Type | Modifiers | Storage | Stats target | Description
------------+-----------------------+-----------+----------+--------------+-------------
code | character varying(3) | not null | extended | |
name | character varying(50) | not null | extended | |
federation | character varying(10) | not null | extended | |
Indexes:
"pk_countries" PRIMARY KEY, btree (code)
Foreign-key constraints:
"countries_federation_fkey" FOREIGN KEY (federation) REFERENCES confederations(id)
Referenced by:
TABLE "players" CONSTRAINT "playersfk" FOREIGN KEY (country_id) REFERENCES countries(code)
MATCH FULL
CALL db.indexes()
╒════════════════════════╤════════╤══════════════════════╕
│"description" │"state" │"type" │
╞════════════════════════╪════════╪══════════════════════╡
│"INDEX ON :Club(id)" │"ONLINE"│"node_unique_property"│
├────────────────────────┼────────┼──────────────────────┤
│"INDEX ON :Club(name)" │"ONLINE"│"node_label_property" │
├────────────────────────┼────────┼──────────────────────┤
│"INDEX ON :Player(id)" │"ONLINE"│"node_unique_property"│
├────────────────────────┼────────┼──────────────────────┤
│"INDEX ON :Player(name)"│"ONLINE"│"node_label_property" │
└────────────────────────┴────────┴──────────────────────┘
CALL db.constraints()
╒══════════════════════════════════════════════════════════════════════════╕
│"description" │
╞══════════════════════════════════════════════════════════════════════════╡
│"CONSTRAINT ON ( club:Club ) ASSERT club.id IS UNIQUE" │
├──────────────────────────────────────────────────────────────────────────┤
│"CONSTRAINT ON ( club:Club ) ASSERT exists(club.name)" │
├──────────────────────────────────────────────────────────────────────────┤
│"CONSTRAINT ON ( player:Player ) ASSERT player.id IS UNIQUE" │
├──────────────────────────────────────────────────────────────────────────┤
│"CONSTRAINT ON ()-[ of_player:OF_PLAYER ]-() ASSERT exists(of_player.age)"│
└──────────────────────────────────────────────────────────────────────────┘
MATCH (country:Country)
RETURN keys(country), COUNT(*) AS times
+-----------------------+
| keys(country) | times |
+-----------------------+
| ["id","name"] | 198 |
+-----------------------+
MATCH (club:Club)
RETURN keys(club), COUNT(*) AS times
+---------------------------------+
| keys(club) | times |
+---------------------------------+
| ["id","name"] | 806 |
| ["name","country","id"] | 1 |
+---------------------------------+
CALL db.schema()
# SELECT * FROM clubs where country_id is null;
id | name | country | country_id
---------------------------------------+-------------------------+---------------+------------
/unknown/startseite/verein/75 | Unknown | |
/pohang/startseite/verein/311 | Pohang Steelers | Korea, South |
/bluewings/startseite/verein/3301 | Suwon Samsung Bluewings | Korea, South |
/ulsan/startseite/verein/3535 | Ulsan Hyundai | Korea, South |
/africa-sports/startseite/verein/2936 | Africa Sports | Cote d'Ivoire |
/monaco/startseite/verein/162 | AS Monaco | Monaco |
/jeonbuk/startseite/verein/6502 | Jeonbuk Hyundai Motors | Korea, South |
/busan/startseite/verein/2582 | Busan IPark | Korea, South |
(8 rows)
MATCH (club:Club)
WHERE NOT (club)-[:PART_OF]->()
RETURN club
+=====================================================================+
|club |
+=====================================================================+
|{name: Unknown, id: /unknown/startseite/verein/75} |
+---------------------------------------------------------------------+
|{country: Monaco, name: AS Monaco, id: /monaco/startseite/verein/162}|
+---------------------------------------------------------------------+
# drop table countries;
ERROR: cannot drop table countries because other objects depend
on it
DETAIL: constraint playersfk on table players depends on table
countries
HINT: Use DROP ... CASCADE to drop the dependent objects too.
MATCH (country:Country)
DELETE country
org.neo4j.kernel.api.exceptions.TransactionFailureException:
Node record Node[11306,used=false,....] still has relationships
MATCH (country:Country)
DETACH DELETE country
Deleted 198 nodes, deleted 5071 relationships,
statement executed in 498 ms.
github.com/neo4j-meetups/cypher-for-sql-developers

More Related Content

Viewers also liked

GraphTalks Rome - Introducing Neo4j
GraphTalks Rome - Introducing Neo4jGraphTalks Rome - Introducing Neo4j
GraphTalks Rome - Introducing Neo4jNeo4j
 
GraphTalks Rome - Identity and Access Management
GraphTalks Rome - Identity and Access ManagementGraphTalks Rome - Identity and Access Management
GraphTalks Rome - Identity and Access ManagementNeo4j
 
GraphDay Stockholm - Graphs in Action
GraphDay Stockholm - Graphs in ActionGraphDay Stockholm - Graphs in Action
GraphDay Stockholm - Graphs in ActionNeo4j
 
The Five Graphs of Government: How Federal Agencies can Utilize Graph Technology
The Five Graphs of Government: How Federal Agencies can Utilize Graph TechnologyThe Five Graphs of Government: How Federal Agencies can Utilize Graph Technology
The Five Graphs of Government: How Federal Agencies can Utilize Graph TechnologyNeo4j
 
Knowledge Architecture: Graphing Your Knowledge
Knowledge Architecture: Graphing Your KnowledgeKnowledge Architecture: Graphing Your Knowledge
Knowledge Architecture: Graphing Your KnowledgeNeo4j
 
GraphDay Stockholm - Levaraging Graph-Technology to fight Financial Fraud
GraphDay Stockholm - Levaraging Graph-Technology to fight Financial FraudGraphDay Stockholm - Levaraging Graph-Technology to fight Financial Fraud
GraphDay Stockholm - Levaraging Graph-Technology to fight Financial FraudNeo4j
 
GraphDay Stockholm - iKnow Solutions - The Value Add of Graphs to Analytics a...
GraphDay Stockholm - iKnow Solutions - The Value Add of Graphs to Analytics a...GraphDay Stockholm - iKnow Solutions - The Value Add of Graphs to Analytics a...
GraphDay Stockholm - iKnow Solutions - The Value Add of Graphs to Analytics a...Neo4j
 
GraphDay Stockholm - Telia Zone
GraphDay Stockholm - Telia Zone GraphDay Stockholm - Telia Zone
GraphDay Stockholm - Telia Zone Neo4j
 
Neo4j GraphTalks - Einführung in Graphdatenbanken
Neo4j GraphTalks - Einführung in GraphdatenbankenNeo4j GraphTalks - Einführung in Graphdatenbanken
Neo4j GraphTalks - Einführung in GraphdatenbankenNeo4j
 
GraphTalks Rome - The Italian Business Graph
GraphTalks Rome - The Italian Business GraphGraphTalks Rome - The Italian Business Graph
GraphTalks Rome - The Italian Business GraphNeo4j
 
Webinar: RDBMS to Graphs
Webinar: RDBMS to GraphsWebinar: RDBMS to Graphs
Webinar: RDBMS to GraphsNeo4j
 
Identity and Access Management
Identity and Access ManagementIdentity and Access Management
Identity and Access ManagementNeo4j
 
Intro to Neo4j presentation
Intro to Neo4j presentationIntro to Neo4j presentation
Intro to Neo4j presentationjexp
 
How to Design Retail Recommendation Engines with Neo4j
How to Design Retail Recommendation Engines with Neo4jHow to Design Retail Recommendation Engines with Neo4j
How to Design Retail Recommendation Engines with Neo4jNeo4j
 
Neo4j GraphTalks Panama Papers
Neo4j GraphTalks Panama PapersNeo4j GraphTalks Panama Papers
Neo4j GraphTalks Panama PapersNeo4j
 
Intro to Neo4j and Graph Databases
Intro to Neo4j and Graph DatabasesIntro to Neo4j and Graph Databases
Intro to Neo4j and Graph DatabasesNeo4j
 
Neo4j PartnerDay Amsterdam 2017
Neo4j PartnerDay Amsterdam 2017Neo4j PartnerDay Amsterdam 2017
Neo4j PartnerDay Amsterdam 2017Neo4j
 
Journey of The Connected Enterprise - Knowledge Graphs - Smart Data
Journey of The Connected Enterprise - Knowledge Graphs - Smart DataJourney of The Connected Enterprise - Knowledge Graphs - Smart Data
Journey of The Connected Enterprise - Knowledge Graphs - Smart DataBenjamin Nussbaum
 
Hadoop and Graph Databases (Neo4j): Winning Combination for Bioanalytics - Jo...
Hadoop and Graph Databases (Neo4j): Winning Combination for Bioanalytics - Jo...Hadoop and Graph Databases (Neo4j): Winning Combination for Bioanalytics - Jo...
Hadoop and Graph Databases (Neo4j): Winning Combination for Bioanalytics - Jo...Neo4j
 
Data Modeling with Neo4j
Data Modeling with Neo4jData Modeling with Neo4j
Data Modeling with Neo4jNeo4j
 

Viewers also liked (20)

GraphTalks Rome - Introducing Neo4j
GraphTalks Rome - Introducing Neo4jGraphTalks Rome - Introducing Neo4j
GraphTalks Rome - Introducing Neo4j
 
GraphTalks Rome - Identity and Access Management
GraphTalks Rome - Identity and Access ManagementGraphTalks Rome - Identity and Access Management
GraphTalks Rome - Identity and Access Management
 
GraphDay Stockholm - Graphs in Action
GraphDay Stockholm - Graphs in ActionGraphDay Stockholm - Graphs in Action
GraphDay Stockholm - Graphs in Action
 
The Five Graphs of Government: How Federal Agencies can Utilize Graph Technology
The Five Graphs of Government: How Federal Agencies can Utilize Graph TechnologyThe Five Graphs of Government: How Federal Agencies can Utilize Graph Technology
The Five Graphs of Government: How Federal Agencies can Utilize Graph Technology
 
Knowledge Architecture: Graphing Your Knowledge
Knowledge Architecture: Graphing Your KnowledgeKnowledge Architecture: Graphing Your Knowledge
Knowledge Architecture: Graphing Your Knowledge
 
GraphDay Stockholm - Levaraging Graph-Technology to fight Financial Fraud
GraphDay Stockholm - Levaraging Graph-Technology to fight Financial FraudGraphDay Stockholm - Levaraging Graph-Technology to fight Financial Fraud
GraphDay Stockholm - Levaraging Graph-Technology to fight Financial Fraud
 
GraphDay Stockholm - iKnow Solutions - The Value Add of Graphs to Analytics a...
GraphDay Stockholm - iKnow Solutions - The Value Add of Graphs to Analytics a...GraphDay Stockholm - iKnow Solutions - The Value Add of Graphs to Analytics a...
GraphDay Stockholm - iKnow Solutions - The Value Add of Graphs to Analytics a...
 
GraphDay Stockholm - Telia Zone
GraphDay Stockholm - Telia Zone GraphDay Stockholm - Telia Zone
GraphDay Stockholm - Telia Zone
 
Neo4j GraphTalks - Einführung in Graphdatenbanken
Neo4j GraphTalks - Einführung in GraphdatenbankenNeo4j GraphTalks - Einführung in Graphdatenbanken
Neo4j GraphTalks - Einführung in Graphdatenbanken
 
GraphTalks Rome - The Italian Business Graph
GraphTalks Rome - The Italian Business GraphGraphTalks Rome - The Italian Business Graph
GraphTalks Rome - The Italian Business Graph
 
Webinar: RDBMS to Graphs
Webinar: RDBMS to GraphsWebinar: RDBMS to Graphs
Webinar: RDBMS to Graphs
 
Identity and Access Management
Identity and Access ManagementIdentity and Access Management
Identity and Access Management
 
Intro to Neo4j presentation
Intro to Neo4j presentationIntro to Neo4j presentation
Intro to Neo4j presentation
 
How to Design Retail Recommendation Engines with Neo4j
How to Design Retail Recommendation Engines with Neo4jHow to Design Retail Recommendation Engines with Neo4j
How to Design Retail Recommendation Engines with Neo4j
 
Neo4j GraphTalks Panama Papers
Neo4j GraphTalks Panama PapersNeo4j GraphTalks Panama Papers
Neo4j GraphTalks Panama Papers
 
Intro to Neo4j and Graph Databases
Intro to Neo4j and Graph DatabasesIntro to Neo4j and Graph Databases
Intro to Neo4j and Graph Databases
 
Neo4j PartnerDay Amsterdam 2017
Neo4j PartnerDay Amsterdam 2017Neo4j PartnerDay Amsterdam 2017
Neo4j PartnerDay Amsterdam 2017
 
Journey of The Connected Enterprise - Knowledge Graphs - Smart Data
Journey of The Connected Enterprise - Knowledge Graphs - Smart DataJourney of The Connected Enterprise - Knowledge Graphs - Smart Data
Journey of The Connected Enterprise - Knowledge Graphs - Smart Data
 
Hadoop and Graph Databases (Neo4j): Winning Combination for Bioanalytics - Jo...
Hadoop and Graph Databases (Neo4j): Winning Combination for Bioanalytics - Jo...Hadoop and Graph Databases (Neo4j): Winning Combination for Bioanalytics - Jo...
Hadoop and Graph Databases (Neo4j): Winning Combination for Bioanalytics - Jo...
 
Data Modeling with Neo4j
Data Modeling with Neo4jData Modeling with Neo4j
Data Modeling with Neo4j
 

Similar to Webinar: Intro to Cypher

Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...
Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...
Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...Redis Labs
 
How to write SQL queries | pgDay Paris 2019 | Dimitri Fontaine
How to write SQL queries | pgDay Paris 2019 | Dimitri FontaineHow to write SQL queries | pgDay Paris 2019 | Dimitri Fontaine
How to write SQL queries | pgDay Paris 2019 | Dimitri FontaineCitus Data
 
Modelling for Strategic Design - IxDA Berlin 09/2013
Modelling for Strategic Design - IxDA Berlin 09/2013Modelling for Strategic Design - IxDA Berlin 09/2013
Modelling for Strategic Design - IxDA Berlin 09/2013Milan Guenther (eda.c)
 
1Hippeus - zerocopy messaging по законам Спарты, Леонид Юрьев (ПЕТЕР-СЕРВИС)
1Hippeus -  zerocopy messaging по законам Спарты, Леонид Юрьев (ПЕТЕР-СЕРВИС)1Hippeus -  zerocopy messaging по законам Спарты, Леонид Юрьев (ПЕТЕР-СЕРВИС)
1Hippeus - zerocopy messaging по законам Спарты, Леонид Юрьев (ПЕТЕР-СЕРВИС)Ontico
 
- Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
 - Php myadmin sql dump-- version 4.0.10.7-- httpwww.php - Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
- Php myadmin sql dump-- version 4.0.10.7-- httpwww.phpssuserfa5723
 
QRCodes are Fun, Easy, and Useful for Links, Payments and Identity Verification
QRCodes are Fun, Easy, and Useful for Links, Payments and Identity VerificationQRCodes are Fun, Easy, and Useful for Links, Payments and Identity Verification
QRCodes are Fun, Easy, and Useful for Links, Payments and Identity VerificationArcBlock
 

Similar to Webinar: Intro to Cypher (6)

Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...
Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...
Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...
 
How to write SQL queries | pgDay Paris 2019 | Dimitri Fontaine
How to write SQL queries | pgDay Paris 2019 | Dimitri FontaineHow to write SQL queries | pgDay Paris 2019 | Dimitri Fontaine
How to write SQL queries | pgDay Paris 2019 | Dimitri Fontaine
 
Modelling for Strategic Design - IxDA Berlin 09/2013
Modelling for Strategic Design - IxDA Berlin 09/2013Modelling for Strategic Design - IxDA Berlin 09/2013
Modelling for Strategic Design - IxDA Berlin 09/2013
 
1Hippeus - zerocopy messaging по законам Спарты, Леонид Юрьев (ПЕТЕР-СЕРВИС)
1Hippeus -  zerocopy messaging по законам Спарты, Леонид Юрьев (ПЕТЕР-СЕРВИС)1Hippeus -  zerocopy messaging по законам Спарты, Леонид Юрьев (ПЕТЕР-СЕРВИС)
1Hippeus - zerocopy messaging по законам Спарты, Леонид Юрьев (ПЕТЕР-СЕРВИС)
 
- Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
 - Php myadmin sql dump-- version 4.0.10.7-- httpwww.php - Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
- Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
 
QRCodes are Fun, Easy, and Useful for Links, Payments and Identity Verification
QRCodes are Fun, Easy, and Useful for Links, Payments and Identity VerificationQRCodes are Fun, Easy, and Useful for Links, Payments and Identity Verification
QRCodes are Fun, Easy, and Useful for Links, Payments and Identity Verification
 

More from Neo4j

GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisNeo4j
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesNeo4j
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems ApproachNeo4j
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignNeo4j
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jNeo4j
 
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptxBT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptxNeo4j
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanNeo4j
 
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
Workshop -  Architecting Innovative Graph Applications- GraphSummit MilanWorkshop -  Architecting Innovative Graph Applications- GraphSummit Milan
Workshop - Architecting Innovative Graph Applications- GraphSummit MilanNeo4j
 
LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...
LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...
LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...Neo4j
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jNeo4j
 
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with Graph
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with GraphGraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with Graph
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with GraphNeo4j
 
LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...
LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...
LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...Neo4j
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaNeo4j
 
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...Neo4j
 
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxFrom Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxNeo4j
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNeo4j
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansQIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansNeo4j
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 

More from Neo4j (20)

GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysis
 
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
INGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by DesignINGKA DIGITAL: Linked Metadata by Design
INGKA DIGITAL: Linked Metadata by Design
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptxBT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
BT & Neo4j _ How Knowledge Graphs help BT deliver Digital Transformation.pptx
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
Workshop -  Architecting Innovative Graph Applications- GraphSummit MilanWorkshop -  Architecting Innovative Graph Applications- GraphSummit Milan
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
 
LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...
LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...
LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
 
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with Graph
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with GraphGraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with Graph
GraphSummit Milan & Stockholm - Neo4j: The Art of the Possible with Graph
 
LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...
LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...
LARUS - Galileo.XAI e Gen-AI: la nuova prospettiva di LARUS per il futuro del...
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
 
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
 
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxFrom Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMs
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansQIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
QIAGEN: Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 

Recently uploaded

Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfChristopherTHyatt
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...Product School
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaRTTS
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...Product School
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupCatarinaPereira64715
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Product School
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Thierry Lestable
 

Recently uploaded (20)

Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 

Webinar: Intro to Cypher

  • 1.
  • 2.
  • 3.
  • 4.
  • 5. |---------+--------------------+-----------------------------------------+--------------------+------------| | season | playerName | playerUri | playerPosition | playerAge | |---------+--------------------+-----------------------------------------+--------------------+------------| | 90/91 | Aldair | /aldair/profil/spieler/4151 | Centre Back | 24 | | 90/91 | Thomas Häßler | /thomas-hassler/profil/spieler/553 | Attacking Midfield | 24 | | 90/91 | Roberto Baggio | /roberto-baggio/profil/spieler/4153 | Secondary Striker | 23 | | 90/91 | Karl-Heinz Riedle | /karl-heinz-riedle/profil/spieler/13806 | Centre Forward | 24 | | 90/91 | Henrik Larsen | /henrik-larsen/profil/spieler/101330 | Attacking Midfield | 24 | | 90/91 | Gheorghe Hagi | /gheorghe-hagi/profil/spieler/7939 | Attacking Midfield | 25 | | 90/91 | Hristo Stoichkov | /hristo-stoichkov/profil/spieler/7938 | Left Wing | 24 | | 90/91 | Brian Laudrup | /brian-laudrup/profil/spieler/39667 | Centre Forward | 21 | | 90/91 | Miguel Ángel Nadal | /miguel-angel-nadal/profil/spieler/7676 | Centre Back | 23 | |---------+--------------------+-----------------------------------------+--------------------+------------|
  • 6. |-------------------+---------------------+-------------------------------------+--------------------| | sellerClubName | sellerClubNameShort | sellerClubUri | sellerClubCountry | |-------------------+---------------------+-------------------------------------+--------------------| | SL Benfica | Benfica | /benfica/startseite/verein/294 | Portugal | | 1. FC Köln | 1. FC Köln | /1-fc-koln/startseite/verein/3 | Germany | | ACF Fiorentina | Fiorentina | /fiorentina/startseite/verein/430 | Italy | | SV Werder Bremen | Werder Bremen | /werder-bremen/startseite/verein/86 | Germany | | Lyngby BK | Lyngby BK | /lyngby-bk/startseite/verein/369 | Denmark | | Steaua Bucharest | Steaua | /steaua/startseite/verein/301 | Romania | | CSKA Sofia | CSKA Sofia | /cska-sofia/startseite/verein/208 | Bulgaria | | KFC Uerdingen 05 | KFC Uerdingen | /kfc-uerdingen/startseite/verein/95 | Germany | | RCD Mallorca | RCD Mallorca | /rcd-mallorca/startseite/verein/237 | Spain | |-------------------+---------------------+-------------------------------------+--------------------|
  • 7. |----------------+--------------------+-------------------------------------+-------------------| | buyerClubName | buyerClubNameShort | buyerClubUri | buyerClubCountry | |----------------+--------------------+-------------------------------------+-------------------| | AS Roma | AS Roma | /as-roma/startseite/verein/12 | Italy | | Juventus FC | Juventus | /juventus/startseite/verein/506 | Italy | | Juventus FC | Juventus | /juventus/startseite/verein/506 | Italy | | SS Lazio | Lazio | /lazio/startseite/verein/398 | Italy | | AC Pisa 1909 | AC Pisa | /ac-pisa/startseite/verein/4172 | Italy | | Real Madrid | Real Madrid | /real-madrid/startseite/verein/418 | Spain | | FC Barcelona | FC Barcelona | /fc-barcelona/startseite/verein/131 | Spain | | Bayern Munich | Bayern Munich | /bayern-munich/startseite/verein/27 | Germany | | FC Barcelona | FC Barcelona | /fc-barcelona/startseite/verein/131 | Spain | |----------------+--------------------+-------------------------------------+-------------------|
  • 8. |--------------------------------------------------------+-------------+---------------| | transferUri | transferFee | transferRank | |--------------------------------------------------------+-------------+---------------| | /jumplist/transfers/spieler/4151/transfer_id/6993 | £6.75m | 1 | | /jumplist/transfers/spieler/553/transfer_id/2405 | £5.85m | 2 | | /jumplist/transfers/spieler/4153/transfer_id/84533 | £5.81m | 3 | | /jumplist/transfers/spieler/13806/transfer_id/19054 | £5.63m | 4 | | /jumplist/transfers/spieler/101330/transfer_id/275067 | £5.03m | 5 | | /jumplist/transfers/spieler/7939/transfer_id/19343 | £3.23m | 6 | | /jumplist/transfers/spieler/7938/transfer_id/11563 | £2.25m | 7 | | /jumplist/transfers/spieler/39667/transfer_id/90285 | £2.25m | 8 | | /jumplist/transfers/spieler/7676/transfer_id/11828 | £2.10m | 9 | |--------------------------------------------------------+-------------+---------------|
  • 9.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. Records in tables Nodes "Soft" relationships computed at query time "Hard" relationships built into the data store
  • 17.
  • 18. CREATE TABLE players ( "id" character varying(100) NOT NULL PRIMARY KEY, "name" character varying(150) NOT NULL, "position" character varying(20) );
  • 19. INSERT INTO players VALUES('/aldair/profil/spieler/4151', 'Aldair', 'Centre Back'); INSERT INTO players VALUES('/thomas-hassler/profil/spieler/553', 'Thomas Häßler', 'Attacking Midfield'); INSERT INTO players VALUES('/roberto-baggio/profil/spieler/4153', 'Roberto Baggio', 'Secondary Striker');
  • 20. CREATE TABLE clubs ( "id" character varying(100) NOT NULL PRIMARY KEY, "name" character varying(50) NOT NULL, "country" character varying(50) );
  • 21. INSERT INTO clubs VALUES('/hertha-bsc/startseite/verein/44', 'Hertha BSC', 'Germany'); INSERT INTO clubs VALUES('/cfr-cluj/startseite/verein/7769', 'CFR Cluj', 'Romania'); INSERT INTO clubs VALUES('/real-sociedad/startseite/verein/681', 'Real Sociedad', 'Spain');
  • 22. CREATE TABLE transfers ( "id" character varying(100) NOT NULL PRIMARY KEY, "fee" character varying(50) NOT NULL, "numericFee" integer NOT NULL, "player_age" smallint NOT NULL, "season" character varying(5) NOT NULL, "player_id" character varying(100) NOT NULL REFERENCES players (id), "from_club_id" character varying(100) NOT NULL REFERENCES clubs (id), "to_club_id" character varying(100) NOT NULL REFERENCES clubs (id) );
  • 23. INSERT INTO transfers VALUES('/jumplist/transfers/spieler/4151/transfer_id/6993', ' £6.75m', 6750000, '90/91', 24, '/aldair/profil/spieler/4151', '/benfica/startseite/verein/294', '/as-roma/startseite/verein/12'); INSERT INTO transfers VALUES('/jumplist/transfers/spieler/553/transfer_id/2405', ' £5.85m', 5850000, '90/91', 24, '/thomas-hassler/profil/spieler/553', '/1-fc-koln/startseite/verein/3', '/juventus/startseite/verein/506'); INSERT INTO transfers VALUES('/jumplist/transfers/spieler/4153/transfer_id/84533', ' £5.81m', 5810000, '90/91', 23, '/roberto-baggio/profil/spieler/4153', '/fiorentina/startseite/verein/430', '/juventus/startseite/verein/506');
  • 24.
  • 25.
  • 26. LOAD CSV WITH HEADERS FROM "(file|http)://" AS row MATCH (:Label {property: row.header}) CREATE (:Label {property: row.header}) MERGE (:Label {property: row.header})
  • 27. LOAD CSV WITH HEADERS FROM "(file|http)://" AS row MATCH (:Label {property: row.header}) CREATE (:Label {property: row.header}) MERGE (:Label {property: row.header})
  • 28. LOAD CSV WITH HEADERS FROM "(file|http)://" AS row MATCH (:Label {property: row.header}) CREATE (:Label {property: row.header}) MERGE (:Label {property: row.header})
  • 29. LOAD CSV WITH HEADERS FROM "(file|http)://" AS row MATCH (:Label {property: row.header}) CREATE (:Label {property: row.header}) MERGE (:Label {property: row.header})
  • 30. LOAD CSV WITH HEADERS FROM "(file|http)://" AS row MATCH (:Label {property: row.header}) CREATE (:Label {property: row.header}) MERGE (:Label {property: row.header})
  • 31. LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row RETURN COUNT(*)
  • 32. LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row RETURN row LIMIT 1
  • 33. LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row CREATE (player:Player { id: row.playerUri, name: row.playerName, position: row.playerPosition })
  • 34. LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row CREATE (player:Player { id: row.playerUri, name: row.playerName, position: row.playerPosition })
  • 35. CREATE CONSTRAINT ON (player:Player) ASSERT player.id IS UNIQUE
  • 36. LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row CREATE (player:Player { id: row.playerUri, name: row.playerName, position: row.playerPosition }) Node 25 already exists with label Player and property "id"=[/peter-lux/profil/spieler/84682]
  • 37. LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row MERGE (player:Player {id: row.playerUri}) ON CREATE SET player.name = row.playerName, player.position = row.playerPosition
  • 38. CREATE CONSTRAINT ON (club:Club) ASSERT club.id IS UNIQUE
  • 39. LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row MERGE (club:Club {id: row.sellerClubUri}) ON CREATE SET club.name = row.sellerClubName, club.country = row.sellerClubCountry; LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row MERGE (club:Club {id: row.buyerClubUri}) ON CREATE SET club.name = row.buyerClubName, club.country = row.buyerClubCountry;
  • 40. CREATE CONSTRAINT ON (transfer:Transfer) ASSERT transfer.id IS UNIQUE
  • 41. LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row MATCH (player:Player {id: row.playerUri}) MATCH (source:Club {id: row.sellerClubUri}) MATCH (destination:Club {id: row.buyerClubUri}) MERGE (t:Transfer {id: row.transferUri}) ON CREATE SET t.season = row.season, t.rank = row.transferRank, t.fee = row.transferFee MERGE (t)-[:OF_PLAYER { age: row.playerAge }]->(player) MERGE (t)-[:FROM_CLUB]->(source) MERGE (t)-[:TO_CLUB]->(destination)
  • 42. LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row MATCH (player:Player {id: row.playerUri}) MATCH (source:Club {id: row.sellerClubUri}) MATCH (destination:Club {id: row.buyerClubUri}) MERGE (t:Transfer {id: row.transferUri}) ON CREATE SET t.season = row.season, t.rank = row.transferRank, t.fee = row.transferFee MERGE (t)-[:OF_PLAYER { age: row.playerAge }]->(player) MERGE (t)-[:FROM_CLUB]->(source) MERGE (t)-[:TO_CLUB]->(destination)
  • 43. LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row MATCH (player:Player {id: row.playerUri}) MATCH (source:Club {id: row.sellerClubUri}) MATCH (destination:Club {id: row.buyerClubUri}) MERGE (t:Transfer {id: row.transferUri}) ON CREATE SET t.season = row.season, t.rank = row.transferRank, t.fee = row.transferFee MERGE (t)-[:OF_PLAYER { age: row.playerAge }]->(player) MERGE (t)-[:FROM_CLUB]->(source) MERGE (t)-[:TO_CLUB]->(destination)
  • 44. LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row MATCH (player:Player {id: row.playerUri}) MATCH (source:Club {id: row.sellerClubUri}) MATCH (destination:Club {id: row.buyerClubUri}) MERGE (t:Transfer {id: row.transferUri}) ON CREATE SET t.season = row.season, t.rank = row.transferRank, t.fee = row.transferFee MERGE (t)-[:OF_PLAYER { age: row.playerAge }]->(player) MERGE (t)-[:FROM_CLUB]->(source) MERGE (t)-[:TO_CLUB]->(destination)
  • 45.
  • 46.
  • 47. CREATE CONSTRAINT ON (club:Club) ASSERT club.id IS UNIQUE
  • 48. CREATE CONSTRAINT ON (club:Club) ASSERT exists(club.name)
  • 49. CREATE CONSTRAINT ON ()-[player:OF_PLAYER]-() ASSERT exists(player.age)
  • 50.
  • 51.
  • 52. SELECT * FROM players WHERE players.name = 'Cristiano Ronaldo'
  • 53. SELECT * FROM players WHERE players.name = 'Cristiano Ronaldo' MATCH (player:Player { name: "Cristiano Ronaldo" }) RETURN player
  • 54. SELECT * FROM players WHERE players.name = 'Cristiano Ronaldo' MATCH (player:Player { name: "Cristiano Ronaldo" }) RETURN player
  • 55. SELECT * FROM players WHERE players.name = 'Cristiano Ronaldo' MATCH (player:Player { name: "Cristiano Ronaldo" }) RETURN player
  • 56.
  • 57.
  • 58. SELECT players.name, t."numericFee", t.season FROM transfers AS t JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id JOIN clubs AS clubTo ON t.to_club_id = clubTo.id JOIN players ON t.player_id = players.id WHERE clubFrom.name = 'Tottenham Hotspur' AND clubTo.name = 'Manchester United'
  • 59. SELECT players.name, t."numericFee", t.season FROM transfers AS t JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id JOIN clubs AS clubTo ON t.to_club_id = clubTo.id JOIN players ON t.player_id = players.id WHERE clubFrom.name = 'Tottenham Hotspur' AND clubTo.name = 'Manchester United' MATCH (from:Club)<-[:FROM_CLUB]-(transfer:Transfer)-[:TO_CLUB]->(to:Club), (transfer)-[:OF_PLAYER]->(player) WHERE from.name = "Tottenham Hotspur" AND to.name = "Manchester United" RETURN player.name, transfer.numericFee, transfer.season
  • 60. SELECT players.name, t."numericFee", t.season FROM transfers AS t JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id JOIN clubs AS clubTo ON t.to_club_id = clubTo.id JOIN players ON t.player_id = players.id WHERE clubFrom.name = 'Tottenham Hotspur' AND clubTo.name = 'Manchester United' MATCH (from:Club)<-[:FROM_CLUB]-(transfer:Transfer)-[:TO_CLUB]->(to:Club), (transfer)-[:OF_PLAYER]->(player) WHERE from.name = "Tottenham Hotspur" AND to.name = "Manchester United" RETURN player.name, transfer.numericFee, transfer.season
  • 61.
  • 62.
  • 63. MATCH (from:Club)<-[:FROM_CLUB]-(transfer:Transfer)-[:TO_CLUB]->(to:Club), (transfer)-[:OF_PLAYER]->(player) WHERE from.name = "Tottenham Hotspur" AND to.name = "Manchester United" RETURN player.name, transfer.numericFee, transfer.season
  • 64.
  • 65. |------------------------------------------+--------------------+--------------------| | playerUri | playerName | playerNationality | |------------------------------------------+--------------------+--------------------| | /aldair/profil/spieler/4151 | Aldair | Brazil | | /thomas-hassler/profil/spieler/553 | Thomas Häßler | Germany | | /roberto-baggio/profil/spieler/4153 | Roberto Baggio | Italy | | /karl-heinz-riedle/profil/spieler/13806 | Karl-Heinz Riedle | Germany | | /henrik-larsen/profil/spieler/101330 | Henrik Larsen | Denmark | | /gheorghe-hagi/profil/spieler/7939 | Gheorghe Hagi | Romania | | /hristo-stoichkov/profil/spieler/7938 | Hristo Stoichkov | Bulgaria | | /brian-laudrup/profil/spieler/39667 | Brian Laudrup | Denmark | | /miguel-angel-nadal/profil/spieler/7676 | Miguel Ángel Nadal | Spain | |------------------------------------------+--------------------+--------------------|
  • 66.
  • 68. ALTER TABLE players ADD COLUMN nationality varying(30);
  • 69. UPDATE players SET nationality = 'Brazil' WHERE players.id = '/aldair/profil/spieler/4151'; UPDATE players SET nationality = 'Germany' WHERE players.id ='/ulf-kirsten/profil/spieler/74'; UPDATE players SET nationality = 'England' WHERE players.id ='/john-lukic/profil/spieler/28241';
  • 70.
  • 71.
  • 72. LOAD CSV WITH HEADERS FROM "file:///transfers.csv" AS row MATCH (player:Player {id: row.playerUri}) SET player.nationality = row.playerNationality
  • 73.
  • 74. SELECT players.name, clubFrom.name, clubTo.name, t."numericFee", t.season FROM transfers AS t JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id JOIN clubs AS clubTo ON t.to_club_id = clubTo.id JOIN players ON t.player_id = players.id WHERE clubFrom.country = 'England' AND clubTo.country = 'England' AND players.nationality = 'England' ORDER BY t."numericFee" DESC LIMIT 10
  • 75. SELECT players.name, clubFrom.name, clubTo.name, t."numericFee", t.season FROM transfers AS t JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id JOIN clubs AS clubTo ON t.to_club_id = clubTo.id JOIN players ON t.player_id = players.id WHERE clubFrom.country = 'England' AND clubTo.country = 'England' AND players.nationality = 'England' ORDER BY t."numericFee" DESC LIMIT 10 MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player) WHERE to.country = "England" AND from.country = "England" AND player.nationality = "England" RETURN player.name, from.name, to.name, t.numericFee, t.season ORDER BY t.numericFee DESC LIMIT 10
  • 76. SELECT players.name, clubFrom.name, clubTo.name, t."numericFee", t.season FROM transfers AS t JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id JOIN clubs AS clubTo ON t.to_club_id = clubTo.id JOIN players ON t.player_id = players.id WHERE clubFrom.country = 'England' AND clubTo.country = 'England' AND players.nationality = 'England' ORDER BY t."numericFee" DESC LIMIT 10 MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player) WHERE to.country = "England" AND from.country = "England" AND player.nationality = "England" RETURN player.name, from.name, to.name, t.numericFee, t.season ORDER BY t.numericFee DESC LIMIT 10
  • 77.
  • 78. |----------------------+----------------| | country | confederation | |----------------------+----------------| | Afghanistan | afc | | Albania | uefa | | Algeria | caf | | American Samoa | ofc | | Andorra | uefa | | Angola | caf | | Anguilla | concacaf | | Antigua and Barbuda | concacaf | | Argentina | conmebol | |----------------------+----------------| |-----------+-----------+-------------------------------------------------| | urlName | shortName | region | |-----------+-----------+-------------------------------------------------| | afc | AFC | Asia | | uefa | UEFA | Europe | | ofc | OFC | Oceania | | conmebol | CONMEBOL | South America | | concacaf | CONCACAF | North American, Central American and Caribbean | | caf | CAF | Africa | |-----------+-----------+-------------------------------------------------|
  • 79.
  • 81. CREATE TABLE confederations ( "id" character varying(10) NOT NULL PRIMARY KEY, "shortName" character varying(50) NOT NULL, "name" character varying(100) NOT NULL, "region" character varying(100) NOT NULL );
  • 82. INSERT INTO confederations VALUES('afc', 'AFC', 'Asian Football Confederation', 'Asia'); INSERT INTO confederations VALUES('uefa', 'UEFA', 'Union of European Football Associations', 'Europe'); INSERT INTO confederations VALUES('ofc', 'OFC', 'Oceania Football Confederation', 'Oceania');
  • 83. CREATE TABLE countries ( "code" character varying(3) NOT NULL PRIMARY KEY, "name" character varying(50) NOT NULL, "federation" character varying(10) NOT NULL REFERENCES confederations (id) );
  • 84. INSERT INTO countries VALUES('MNE', 'Montenegro', 'uefa'); INSERT INTO countries VALUES('LTU', 'Lithuania', 'uefa'); INSERT INTO countries VALUES('CAM', 'Cambodia', 'afc'); INSERT INTO countries VALUES('SUI', 'Switzerland', 'uefa'); INSERT INTO countries VALUES('ETH', 'Ethiopia', 'caf'); INSERT INTO countries VALUES('ARU', 'Aruba', 'concacaf'); INSERT INTO countries VALUES('SWZ', 'Swaziland', 'caf'); INSERT INTO countries VALUES('PLE', 'Palestine', 'afc');
  • 85. ALTER TABLE clubs ADD COLUMN country_id character varying(3) REFERENCES countries(code);
  • 86. UPDATE clubs AS cl SET country_id = c.code FROM clubs INNER JOIN countries AS c ON c.name = clubs.country WHERE cl.id = clubs.id;
  • 87. # select * from clubs limit 5; id | name | country | country_id ----------------------------------------+-----------------------------+---------------+------------ /san-jose-clash/startseite/verein/4942 | San Jose Clash | United States | USA /chicago/startseite/verein/432 | Chicago Fire | United States | USA /gz-evergrande/startseite/verein/10948 | Guangzhou Evergrande Taobao | China | CHN /as-vita-club/startseite/verein/2225 | AS Vita Club Kinshasa | Congo DR | CGO /vicenza/startseite/verein/2655 | Vicenza Calcio | Italy | ITA (6 rows)
  • 88. ALTER TABLE clubs DROP COLUMN country;
  • 89. ALTER TABLE players ADD COLUMN country_id character varying(3) REFERENCES countries(code);
  • 90. UPDATE players AS p SET country_id = c.code FROM players INNER JOIN countries AS c ON c.name = players.nationality WHERE p.id = players.id;
  • 91. # select * from players limit 5; id | name | position | nationality | country_id -----------------------------------------+-------------------+--------------------+-------------+------------ /dalian-atkinson/profil/spieler/200738 | Dalian Atkinson | Attacking Midfield | England | ENG /steve-redmond/profil/spieler/177056 | Steve Redmond | Centre Back | England | ENG /bert-konterman/profil/spieler/6252 | Bert Konterman | Centre Back | Netherlands | NED /lee-philpott/profil/spieler/228030 | Lee Philpott | Midfield | England | ENG /tomasz-frankowski/profil/spieler/14911 | Tomasz Frankowski | Centre Forward | Poland | POL (5 rows)
  • 92. ALTER TABLE players DROP COLUMN nationality;
  • 93.
  • 94.
  • 95. LOAD CSV WITH HEADERS FROM "file:///confederations.csv" AS row MERGE (c:Confederation {id: row.urlName}) ON CREATE SET c.shortName = row.shortName, c.region = row.region, c.name = row.name
  • 96. LOAD CSV WITH HEADERS FROM "file:///countries.csv" AS row MATCH (conf:Confederation {id: row.confederation }) MERGE (country:Country {id: row.countryCode}) ON CREATE SET country.name = row.country MERGE (country)-[:PART_OF]->(conf)
  • 97. MATCH (club:Club) MATCH (country:Country {name: club.country}) MERGE (club)-[:PART_OF]->(country) REMOVE club.country
  • 98. MATCH (player:Player) MATCH (country:Country {name: player.nationality}) MERGE (player)-[:PLAYS_FOR]->(country) REMOVE player.nationality
  • 99.
  • 100. SELECT players.name, clubFrom.name, clubTo.name, t."numericFee", t.season FROM transfers AS t JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id JOIN clubs AS clubTo ON t.to_club_id = clubTo.id JOIN players ON t.player_id = players.id WHERE clubFrom.country = 'England' AND clubTo.country = 'England' AND players.nationality = 'England' ORDER BY t."numericFee" DESC LIMIT 10 MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player) WHERE to.country = "England" AND from.country = "England" AND player.nationality = "England" RETURN player.name, from.name, to.name, t.numericFee, t.season ORDER BY t.numericFee DESC LIMIT 10
  • 101. SELECT players.name, clubFrom.name, clubTo.name, t."numericFee", t.season FROM transfers AS t JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id JOIN clubs AS clubTo ON t.to_club_id = clubTo.id JOIN players ON t.player_id = players.id JOIN countries AS fromCount ON clubFrom.country_id = fromCount.code JOIN countries AS toCount ON clubTo.country_id = toCount.code JOIN countries AS playerCount ON players.country_id = playerCount.code WHERE fromCount.name = 'England' AND toCount.name = 'England' AND playerCount.name = 'England' ORDER BY t."numericFee" DESC LIMIT 10 MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player), (player)-[:PLAYS_FOR]->(country:Country), (to)-[:PART_OF]->(country)<-[:PART_OF]-(from) WHERE country.name = "England" RETURN player.name, from.name, to.name, t.numericFee, t.season ORDER BY t.numericFee DESC LIMIT 10
  • 102. SELECT players.name, clubFrom.name, clubTo.name, t."numericFee", t.season FROM transfers AS t JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id JOIN clubs AS clubTo ON t.to_club_id = clubTo.id JOIN players ON t.player_id = players.id JOIN countries AS fromCount ON clubFrom.country_id = fromCount.code JOIN countries AS toCount ON clubTo.country_id = toCount.code JOIN countries AS playerCount ON players.country_id = playerCount.code WHERE fromCount.name = 'England' AND toCount.name = 'England' AND playerCount.name = 'England' ORDER BY t."numericFee" DESC LIMIT 10 MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player), (player)-[:PLAYS_FOR]->(country:Country), (to)-[:PART_OF]->(country)<-[:PART_OF]-(from) WHERE country.name = "England" RETURN player.name, from.name, to.name, t.numericFee, t.season ORDER BY t.numericFee DESC LIMIT 10
  • 103. SELECT players.name, clubFrom.name, clubTo.name, t."numericFee", t.season FROM transfers AS t JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id JOIN clubs AS clubTo ON t.to_club_id = clubTo.id JOIN players ON t.player_id = players.id JOIN countries AS fromCount ON clubFrom.country_id = fromCount.code JOIN countries AS toCount ON clubTo.country_id = toCount.code JOIN countries AS playerCount ON players.country_id = playerCount.code WHERE fromCount.name = 'England' AND toCount.name = 'England' AND playerCount.name = 'England' ORDER BY t."numericFee" DESC LIMIT 10 MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player), (player)-[:PLAYS_FOR]->(country:Country), (to)-[:PART_OF]->(country)<-[:PART_OF]-(from) WHERE country.name = "England" RETURN player.name, from.name, to.name, t.numericFee, t.season ORDER BY t.numericFee DESC LIMIT 10
  • 104.
  • 105. SELECT * FROM transfers AS t JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id JOIN clubs AS clubTo ON t.to_club_id = clubTo.id JOIN players ON t.player_id = players.id JOIN countries AS fromCountry ON clubFrom.country_id = fromCountry.code JOIN countries AS toCountry ON clubTo.country_id = toCountry.code JOIN confederations AS fromConfederation ON fromCountry.federation = fromConfederation.id JOIN confederations AS toConfederation ON toCountry.federation = toConfederation.id WHERE fromConfederation.id = 'afc' AND toConfederation.id = 'uefa' ORDER BY t."numericFee" DESC LIMIT 10 MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player), (from)-[:PART_OF*2]->(:Confederation {id: "afc"}), (to)-[:PART_OF*2]->(:Confederation {id: "uefa"}) RETURN player.name, from.name, to.name, t.numericFee, t.season ORDER BY t.numericFee DESC LIMIT 10
  • 106. SELECT * FROM transfers AS t JOIN clubs AS clubFrom ON t.from_club_id = clubFrom.id JOIN clubs AS clubTo ON t.to_club_id = clubTo.id JOIN players ON t.player_id = players.id JOIN countries AS fromCountry ON clubFrom.country_id = fromCountry.code JOIN countries AS toCountry ON clubTo.country_id = toCountry.code JOIN confederations AS fromConfederation ON fromCountry.federation = fromConfederation.id JOIN confederations AS toConfederation ON toCountry.federation = toConfederation.id WHERE fromConfederation.id = 'afc' AND toConfederation.id = 'uefa' ORDER BY t."numericFee" DESC LIMIT 10 MATCH (to:Club)<-[:TO_CLUB]-(t:Transfer)-[:FROM_CLUB]-(from:Club), (t)-[:OF_PLAYER]->(player:Player), (from)-[:PART_OF*2]->(:Confederation {id: "afc"}), (to)-[:PART_OF*2]->(:Confederation {id: "uefa"}) RETURN player.name, from.name, to.name, t.numericFee, t.season ORDER BY t.numericFee DESC LIMIT 10
  • 107.
  • 108.
  • 109. # dt List of relations Schema | Name | Type | Owner --------+----------------+-------+------------- public | clubs | table | markneedham public | confederations | table | markneedham public | countries | table | markneedham public | players | table | markneedham public | transfers | table | markneedham (5 rows)
  • 110.
  • 111. CALL db.labels() +=============+ |label | +=============+ |Player | +-------------+ |Club | +-------------+ |Transfer | +-------------+ |Loan | +-------------+ |Confederation| +-------------+ |Country | +-------------+
  • 112. # d+ countries Table "public.countries" Column | Type | Modifiers | Storage | Stats target | Description ------------+-----------------------+-----------+----------+--------------+------------- code | character varying(3) | not null | extended | | name | character varying(50) | not null | extended | | federation | character varying(10) | not null | extended | | Indexes: "pk_countries" PRIMARY KEY, btree (code) Foreign-key constraints: "countries_federation_fkey" FOREIGN KEY (federation) REFERENCES confederations(id) Referenced by: TABLE "players" CONSTRAINT "playersfk" FOREIGN KEY (country_id) REFERENCES countries(code) MATCH FULL
  • 113. CALL db.indexes() ╒════════════════════════╤════════╤══════════════════════╕ │"description" │"state" │"type" │ ╞════════════════════════╪════════╪══════════════════════╡ │"INDEX ON :Club(id)" │"ONLINE"│"node_unique_property"│ ├────────────────────────┼────────┼──────────────────────┤ │"INDEX ON :Club(name)" │"ONLINE"│"node_label_property" │ ├────────────────────────┼────────┼──────────────────────┤ │"INDEX ON :Player(id)" │"ONLINE"│"node_unique_property"│ ├────────────────────────┼────────┼──────────────────────┤ │"INDEX ON :Player(name)"│"ONLINE"│"node_label_property" │ └────────────────────────┴────────┴──────────────────────┘
  • 114. CALL db.constraints() ╒══════════════════════════════════════════════════════════════════════════╕ │"description" │ ╞══════════════════════════════════════════════════════════════════════════╡ │"CONSTRAINT ON ( club:Club ) ASSERT club.id IS UNIQUE" │ ├──────────────────────────────────────────────────────────────────────────┤ │"CONSTRAINT ON ( club:Club ) ASSERT exists(club.name)" │ ├──────────────────────────────────────────────────────────────────────────┤ │"CONSTRAINT ON ( player:Player ) ASSERT player.id IS UNIQUE" │ ├──────────────────────────────────────────────────────────────────────────┤ │"CONSTRAINT ON ()-[ of_player:OF_PLAYER ]-() ASSERT exists(of_player.age)"│ └──────────────────────────────────────────────────────────────────────────┘
  • 115. MATCH (country:Country) RETURN keys(country), COUNT(*) AS times +-----------------------+ | keys(country) | times | +-----------------------+ | ["id","name"] | 198 | +-----------------------+
  • 116. MATCH (club:Club) RETURN keys(club), COUNT(*) AS times +---------------------------------+ | keys(club) | times | +---------------------------------+ | ["id","name"] | 806 | | ["name","country","id"] | 1 | +---------------------------------+
  • 117.
  • 119.
  • 120. # SELECT * FROM clubs where country_id is null; id | name | country | country_id ---------------------------------------+-------------------------+---------------+------------ /unknown/startseite/verein/75 | Unknown | | /pohang/startseite/verein/311 | Pohang Steelers | Korea, South | /bluewings/startseite/verein/3301 | Suwon Samsung Bluewings | Korea, South | /ulsan/startseite/verein/3535 | Ulsan Hyundai | Korea, South | /africa-sports/startseite/verein/2936 | Africa Sports | Cote d'Ivoire | /monaco/startseite/verein/162 | AS Monaco | Monaco | /jeonbuk/startseite/verein/6502 | Jeonbuk Hyundai Motors | Korea, South | /busan/startseite/verein/2582 | Busan IPark | Korea, South | (8 rows)
  • 121. MATCH (club:Club) WHERE NOT (club)-[:PART_OF]->() RETURN club +=====================================================================+ |club | +=====================================================================+ |{name: Unknown, id: /unknown/startseite/verein/75} | +---------------------------------------------------------------------+ |{country: Monaco, name: AS Monaco, id: /monaco/startseite/verein/162}| +---------------------------------------------------------------------+
  • 122. # drop table countries; ERROR: cannot drop table countries because other objects depend on it DETAIL: constraint playersfk on table players depends on table countries HINT: Use DROP ... CASCADE to drop the dependent objects too.
  • 124. MATCH (country:Country) DETACH DELETE country Deleted 198 nodes, deleted 5071 relationships, statement executed in 498 ms.