SlideShare a Scribd company logo
The World Cup 2018 Graph
Jesús Barrasa
Mark Needham
The World Cup Graph 2018
• The World Cup Graph
• Querying with Cypher
• The GraphQL API
• Neo4j Bloom
Agenda
World Cup Graph
World Cup?
World Cup!
World Cup Graph Model
Host c27d992b.databases.neo4j.io
User worldcup
Password worldcup
Once you’ve logged in run :play worldcup-2018-queries
tl;dr - just let me play with the data!
What does this database contain?
All matches, squads, appearances, goals
Updated every 5 minutes during matches
updates
How did we get the data?
The World Cup Graph 2018
LOAD CSV WITH HEADERS FROM
"file:///matches.csv" AS csvLine
MERGE (match:Match {id: csvLine.id})
SET match.h_score = csvLine.h_score,
match.a_score = csvLine.a_score
...
Building the graph
Raw Data
github.com/mneedham/neo4j-worldcup/tree/master/data/2018/import
Importing the data
LOAD CSV WITH HEADERS FROM "file:///matches.csv" AS csvLine
WITH csvLine, toInt(csvLine.match_number) AS matchNumber
MERGE (match:Match {id: csvLine.id})
SET match.h_score = csvLine.h_score, match.a_score = csvLine.a_score,
match.attendance = csvLine.attendance, match.date = csvLine.date,
match.description = csvLine.home + " vs. " + csvLine.away, match.number = toInt(matchNumber)
MERGE (home:Country {name: csvLine.home})
MERGE (match)-[:HOME_TEAM]->(home)
MERGE (match)<-[:PLAYED_IN]-(home)
MERGE (away:Country {name: csvLine.away})
MERGE (match)-[:AWAY_TEAM]->(away)
MERGE (match)<-[:PLAYED_IN]-(away)
MERGE (worldCup:WorldCup {name: csvLine.world_cup}) ON CREATE SET worldCup.year = toInt(csvLine.year)
MERGE (match)<-[:CONTAINS_MATCH]-(worldCup)
Host c27d992b.databases.neo4j.io
User worldcup
Password worldcup
Once you’ve logged in run :play worldcup-2018-queries
Let's run some queries
I want to query this dataset and I
don't know Cypher
The World Cup Graph 2018
GraphQL
GraphQL is a query language for your API, and a
server-side runtime for executing queries by using a
type system you define for your data.
What is it?
GraphQL is a query language for your API, and a
server-side runtime for executing queries by using a
type system you define for your data.
What is it?
GraphQL is a query language for your API, and a
server-side runtime for executing queries by using a
type system you define for your data.
What is it?
GraphQL is a query language for your API, and a
server-side runtime for executing queries by using a
type system you define for your data.
What is it?
type Planet {
name: String
climate: String
}
type Character {
name: String
friends: [Character]
homeWorld: Planet
species: Species
}
type Species {
name: String
lifespan: Int
origin: Planet
}
Manual mapping code
The World Cup Graph 2018
The World Cup Graph 2018
bit.ly/worldcup-graphql
The World Cup Graph 2018
type Match {
id: Int!
description: String
homeScore: Int
awayScore: Int
homeTeam: Country @relation(name: "HOME_TEAM", direction: "OUT")
awayTeam: Country @relation(name: "AWAY_TEAM", direction: "OUT")
}
type WorldCup {
year: Int!,
name: String,
host: [Country] @relation(name: "HOSTED_BY", direction: "OUT")
}
type Country {
id: ID!
code: String
name: String
hostedWorldCups: [WorldCup] @relation(name: "HOSTED_BY", direction: "IN")
}
type Query {
matches(id: Int, description: String, first: Int = 10, offset: Int = 0): [Match]
}
bit.ly/worldcup-graphql-schema
bit.ly/worldcup-graphql-full-schema
NEO4J_URI=bolt://c27d992b.databases.neo4j.io
NEO4J_USER=worldcup
NEO4J_PASSWORD=worldcup
$ now
> https://worldcup-grand-stack-risnfdqvrb.now.sh [in clipboard] [5s]
> Synced 1 file (21.2KB) [5s]
> Deployment complete!
Deploying a GraphQL Server
worldcup-2018.now.sh/
I want to query this dataset and I
don't know GraphQL
Neo4j Bloom
bit.ly/neo4j-bloom-all-the-things
The World Cup Graph 2018
Let's take a look...
Thank you for listening!
Host c27d992b.databases.neo4j.io
User worldcup
Password worldcup

More Related Content

PPTX
Graph db - Pramati Technologies [Meetup]
PDF
Introduction to SparkR
PDF
Finding Insights In Connected Data: Using Graph Databases In Journalism
TXT
Writing mdb to excel
PPT
Open Source Presentation
PPTX
Presto@Netflix Presto Meetup 03-19-15
PPTX
Vertica on aws
PDF
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...
Graph db - Pramati Technologies [Meetup]
Introduction to SparkR
Finding Insights In Connected Data: Using Graph Databases In Journalism
Writing mdb to excel
Open Source Presentation
Presto@Netflix Presto Meetup 03-19-15
Vertica on aws
All About GRAND Stack: GraphQL, React, Apollo, and Neo4j (Mark Needham) - Gre...

What's hot (12)

PPTX
15 shades of fvertica
PDF
Rest fest 5in5 cURLin' for Docs
PPTX
SharePoint Search Queries Explained - SPSSthlm 2015
PDF
Make your programs Free
PPTX
Presto summit israel 2019-04
PDF
Advanced Relevancy Ranking
PDF
GraphQL Overview and Practice
PDF
Apache flink: data streaming as a basis for all analytics by Kostas Tzoumas a...
ODP
LRUG Presentation
PPTX
Programas para su PC
PDF
Nats and netlify
PPT
Guug11 mashing up-google_apps
15 shades of fvertica
Rest fest 5in5 cURLin' for Docs
SharePoint Search Queries Explained - SPSSthlm 2015
Make your programs Free
Presto summit israel 2019-04
Advanced Relevancy Ranking
GraphQL Overview and Practice
Apache flink: data streaming as a basis for all analytics by Kostas Tzoumas a...
LRUG Presentation
Programas para su PC
Nats and netlify
Guug11 mashing up-google_apps
Ad

Similar to The World Cup Graph 2018 (20)

PDF
Cypher and apache spark multiple graphs and more in open cypher
PDF
MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScript
PPTX
SETCON'18 - Ilya labacheuski - GraphQL adventures
PDF
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
PDF
Neo4j: Import and Data Modelling
PPTX
Neo4j Makes Graphs Easy
PDF
Next-generation API Development with GraphQL and Prisma
PPTX
Building a GraphQL API in PHP
PDF
Managing GraphQL servers with AWS Fargate & Prisma Cloud
PDF
Performant APIs with GraphQL and PHP (Dutch PHP 2019)
PDF
REST API に疲れたあなたへ贈る GraphQL 入門
PDF
Getting Started with GraphQL && PHP
PPTX
Big Data Processing with .NET and Spark (SQLBits 2020)
PPTX
The openCypher Project - An Open Graph Query Language
PPTX
Dive Into Azure Data Lake - PASS 2017
PDF
Graphql usage
PDF
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
PDF
Developing and Deploying Apps with the Postgres FDW
PPTX
Serverless Streaming Data Processing using Amazon Kinesis Analytics
PPTX
Apache HAWQ Architecture
Cypher and apache spark multiple graphs and more in open cypher
MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScript
SETCON'18 - Ilya labacheuski - GraphQL adventures
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
Neo4j: Import and Data Modelling
Neo4j Makes Graphs Easy
Next-generation API Development with GraphQL and Prisma
Building a GraphQL API in PHP
Managing GraphQL servers with AWS Fargate & Prisma Cloud
Performant APIs with GraphQL and PHP (Dutch PHP 2019)
REST API に疲れたあなたへ贈る GraphQL 入門
Getting Started with GraphQL && PHP
Big Data Processing with .NET and Spark (SQLBits 2020)
The openCypher Project - An Open Graph Query Language
Dive Into Azure Data Lake - PASS 2017
Graphql usage
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Developing and Deploying Apps with the Postgres FDW
Serverless Streaming Data Processing using Amazon Kinesis Analytics
Apache HAWQ Architecture
Ad

More from Neo4j (20)

PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
PDF
Jin Foo - Prospa GraphSummit Sydney Presentation.pdf
PDF
GraphSummit Singapore Master Deck - May 20, 2025
PPTX
Graphs & GraphRAG - Essential Ingredients for GenAI
PPTX
Neo4j Knowledge for Customer Experience.pptx
PPTX
GraphTalk New Zealand - The Art of The Possible.pptx
PDF
Neo4j: The Art of the Possible with Graph
PDF
Smarter Knowledge Graphs For Public Sector
PDF
GraphRAG and Knowledge Graphs Exploring AI's Future
PDF
Matinée GenAI & GraphRAG Paris - Décembre 24
PDF
ANZ Presentation: GraphSummit Melbourne 2024
PDF
Google Cloud Presentation GraphSummit Melbourne 2024: Building Generative AI ...
PDF
Telstra Presentation GraphSummit Melbourne: Optimising Business Outcomes with...
PDF
Hands-On GraphRAG Workshop: GraphSummit Melbourne 2024
PDF
Démonstration Digital Twin Building Wire Management
PDF
Swiss Life - Les graphes au service de la détection de fraude dans le domaine...
PDF
Démonstration Supply Chain - GraphTalk Paris
PDF
The Art of Possible - GraphTalk Paris Opening Session
PPTX
How Siemens bolstered supply chain resilience with graph-powered AI insights ...
PDF
Knowledge Graphs for AI-Ready Data and Enterprise Deployment - Gartner IT Sym...
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Jin Foo - Prospa GraphSummit Sydney Presentation.pdf
GraphSummit Singapore Master Deck - May 20, 2025
Graphs & GraphRAG - Essential Ingredients for GenAI
Neo4j Knowledge for Customer Experience.pptx
GraphTalk New Zealand - The Art of The Possible.pptx
Neo4j: The Art of the Possible with Graph
Smarter Knowledge Graphs For Public Sector
GraphRAG and Knowledge Graphs Exploring AI's Future
Matinée GenAI & GraphRAG Paris - Décembre 24
ANZ Presentation: GraphSummit Melbourne 2024
Google Cloud Presentation GraphSummit Melbourne 2024: Building Generative AI ...
Telstra Presentation GraphSummit Melbourne: Optimising Business Outcomes with...
Hands-On GraphRAG Workshop: GraphSummit Melbourne 2024
Démonstration Digital Twin Building Wire Management
Swiss Life - Les graphes au service de la détection de fraude dans le domaine...
Démonstration Supply Chain - GraphTalk Paris
The Art of Possible - GraphTalk Paris Opening Session
How Siemens bolstered supply chain resilience with graph-powered AI insights ...
Knowledge Graphs for AI-Ready Data and Enterprise Deployment - Gartner IT Sym...

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPT
Teaching material agriculture food technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Cloud computing and distributed systems.
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
MYSQL Presentation for SQL database connectivity
Spectral efficient network and resource selection model in 5G networks
Digital-Transformation-Roadmap-for-Companies.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Spectroscopy.pptx food analysis technology
“AI and Expert System Decision Support & Business Intelligence Systems”
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Teaching material agriculture food technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The AUB Centre for AI in Media Proposal.docx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Cloud computing and distributed systems.
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Unlocking AI with Model Context Protocol (MCP)
Advanced methodologies resolving dimensionality complications for autism neur...

The World Cup Graph 2018