SlideShare a Scribd company logo
1 of 11
Download to read offline
3 Myths about graph query languages
Busted by Pixy
Sridhar Ramachandran
Founder, LambdaZen LLC
Background
● Graph databases are a category of NoSQL
databases that model graphs consisting of
vertices and edges.
○ The property-graph model from Tinkerpop is a graph
database standard.
○ It offers a common abstraction for over a dozen
graph databases using the Blueprints API.
● There are two querying paradigms for graph
DBs, viz. graph query languages (GQL) and
graph traversal languages (GTL).
○ GQLs are declarative and constraint-driven.
○ GTLs are imperative and step-driven.
Background
● The Tinkerpop software stack includes
Gremlin, a graph traversal language (GTL)
that is a monadic Groovy DSL.
● All other GQLs to date are proprietary and
can not be ported across graph databases.
● Pixy is a new declarative graph query
language (GQL) that works on any
Blueprints-compatible graph database.
○ Project page: https://github.com/lambdazen/pixy/
○ Available under the Apache 2.0 license
Myth #1: GQLs and GTLs can’t mix
● Myth #1: Graph Query Languages and
Graph Traversal Languages are totally
different ways to look at the graph query
problem.
● Common wisdom dictates that:
○ A graph “access” language must either be a GTL or
a GQL.
○ The programmer must choose one paradigm or the
other for a specific query.
Pixy co-exists with Gremlin
● Pixy queries are run from Gremlin
expressions using the ‘pixy’ step.
● The input and output to the query can be
operated on by Gremlin.
● The programmer can use both paradigms in
the same query using Pixy + Gremlin.
Gremlin (GTL) GremlinPixy (GQL)
Myth #2: GQLs are slower
● Myth #2: Graph Query Languages are much
slower than Graph Traversal Languages
because of their declarative nature.
● Common wisdom dictates that:
○ the performance penalty is the price paid for
declarative expressiveness.
○ you can’t be sure about the execution plan of a
query written in a GQL, as it is with SQL.
Pixy compiles to Gremlin
● Pixy compiles
PROLOG-style
rules to Gremlin
expressions.
● The execution plan
is a Gremlin
pipeline and can
be tweaked by
reordering the
clauses.
● Performance
should be the
same in most
cases.
Myth #3: GQLs can’t be relational
● Myth #3: A graph query language can not
be based on N-ary predicate-calculus or
relational algebra, since graphs can only
express binary relations/predicates.
● Common wisdom dictates that:
○ Graph-based models unlike relational models can
only capture binary relationships in edges.
○ Therefore, GQLs can only operate on vertices and
edges, not N-ary relations.
○ HypergraphDB is designed to support “hyper” edges
across N vertices to address this perceived
weakness with graph-based associative models.
Pixy derives N-ary relations
● The property graph model can only capture
binary relations between vertices in a
graph, aka edges.
● But Pixy can derive N-ary relations across
vertices, edges and properties.
● These relations can be used to derive other
N-ary relations.
○ These relations form what is called the “domain
model” for the graph.
○ When any relation is queried, Pixy compiles the
query into a sequence of Gremlin steps.
An example
gremlin> pt = new PixyTheory( 
'''father(Child, Father) 
:- out(Child, 'father', Father).''')
The above rule means that:
- father(A, B), father(B, C), father(D, B) are all true.
- father(A, C), father(D, E), etc. are false.
gremlin> pt = pt.extend(
'''grandfather(X, Y, Z) 
:- father(X, Y), father(Y, Z).''')
The above rule means that:
- grandfather(A, B, C) and grandfather(D, B, C) are true
- All other combinations are false
Sample query from the Pixy Tutorial
Wrap-up
● Pixy is a declarative graph query language
that dispels 3 myths about GQLs.
● Myth #1: GQLs and GTLs can’t mix.
○ Pixy’s querying capability is integrated into Gremlin,
bringing the capabilities of both querying paradigms
in one combined language.
● Myth #2: GQLs are slower than GTLs.
○ Pixy compiles PROLOG-based queries and rules to
Gremlin expressions.
● Myth #3: GQLs can’t be relational.
○ Pixy can derive N-ary relations from graphs.
○ New relations can be derived from existing ones.

More Related Content

What's hot

What's hot (19)

Object Oriented Programming (Question Paper) [April – 2017 | 75:25 Pattern]
Object Oriented Programming (Question Paper) [April – 2017 | 75:25 Pattern]Object Oriented Programming (Question Paper) [April – 2017 | 75:25 Pattern]
Object Oriented Programming (Question Paper) [April – 2017 | 75:25 Pattern]
 
Machine learning Vs Deep learning Vs Reinforcement learning | Pydata Mumbai
Machine learning Vs Deep learning Vs Reinforcement learning | Pydata Mumbai Machine learning Vs Deep learning Vs Reinforcement learning | Pydata Mumbai
Machine learning Vs Deep learning Vs Reinforcement learning | Pydata Mumbai
 
Internet Technologies (October – 2016) [Question Paper | CBSGS: 75:25 Pattern]
Internet Technologies (October – 2016) [Question Paper | CBSGS: 75:25 Pattern]Internet Technologies (October – 2016) [Question Paper | CBSGS: 75:25 Pattern]
Internet Technologies (October – 2016) [Question Paper | CBSGS: 75:25 Pattern]
 
Grid _cluster_computing
Grid  _cluster_computingGrid  _cluster_computing
Grid _cluster_computing
 
ASP.NET With C# (Revised Syllabus) [QP / May - 2016]
ASP.NET With C# (Revised Syllabus) [QP / May - 2016]ASP.NET With C# (Revised Syllabus) [QP / May - 2016]
ASP.NET With C# (Revised Syllabus) [QP / May - 2016]
 
Looking for Invariant Operators in Argumentation
Looking for Invariant Operators in ArgumentationLooking for Invariant Operators in Argumentation
Looking for Invariant Operators in Argumentation
 
Pda to cfg h2
Pda to cfg h2Pda to cfg h2
Pda to cfg h2
 
SIGIR-2015-Poster
SIGIR-2015-PosterSIGIR-2015-Poster
SIGIR-2015-Poster
 
Korean Text mining
Korean Text miningKorean Text mining
Korean Text mining
 
Internet Technologies (May – 2016) [Question Paper | IDOL: Revised Course]
Internet Technologies (May – 2016) [Question Paper | IDOL: Revised Course]Internet Technologies (May – 2016) [Question Paper | IDOL: Revised Course]
Internet Technologies (May – 2016) [Question Paper | IDOL: Revised Course]
 
A small debate of power of randomness
A small debate of power of randomnessA small debate of power of randomness
A small debate of power of randomness
 
B.Sc.IT: Semester - VI (October - 2013) [IDOL - Revised Course | Question Paper]
B.Sc.IT: Semester - VI (October - 2013) [IDOL - Revised Course | Question Paper]B.Sc.IT: Semester - VI (October - 2013) [IDOL - Revised Course | Question Paper]
B.Sc.IT: Semester - VI (October - 2013) [IDOL - Revised Course | Question Paper]
 
F# Ignite - DNAD2010
F# Ignite - DNAD2010F# Ignite - DNAD2010
F# Ignite - DNAD2010
 
Looking for Invariant Operators in Argumentation
Looking for Invariant Operators in ArgumentationLooking for Invariant Operators in Argumentation
Looking for Invariant Operators in Argumentation
 
ASP.NET With C# (Revised Syllabus) [QP / May - 2017]
ASP.NET With C# (Revised Syllabus) [QP / May - 2017]ASP.NET With C# (Revised Syllabus) [QP / May - 2017]
ASP.NET With C# (Revised Syllabus) [QP / May - 2017]
 
Timed Concurrent Language for Argumentation: an Interleaving Approach
Timed Concurrent Language for Argumentation: an Interleaving ApproachTimed Concurrent Language for Argumentation: an Interleaving Approach
Timed Concurrent Language for Argumentation: an Interleaving Approach
 
3.5 equivalence of pushdown automata and cfl
3.5 equivalence of pushdown automata and cfl3.5 equivalence of pushdown automata and cfl
3.5 equivalence of pushdown automata and cfl
 
Introducing a Tool for Concurrent Argumentation
Introducing a Tool for Concurrent ArgumentationIntroducing a Tool for Concurrent Argumentation
Introducing a Tool for Concurrent Argumentation
 
Advanced Java (Revised Syllabus) [QP / October - 2016]
Advanced Java (Revised Syllabus) [QP / October - 2016]Advanced Java (Revised Syllabus) [QP / October - 2016]
Advanced Java (Revised Syllabus) [QP / October - 2016]
 

Viewers also liked

Evaluac ión 3 marco teórico
Evaluac ión 3  marco teóricoEvaluac ión 3  marco teórico
Evaluac ión 3 marco teórico
Adalberto
 

Viewers also liked (7)

Java Virtual Machine, Call stack, Java Byte Code
Java Virtual Machine, Call stack, Java Byte CodeJava Virtual Machine, Call stack, Java Byte Code
Java Virtual Machine, Call stack, Java Byte Code
 
Seattle Data Geeks: Hadoop and Beyond
Seattle Data Geeks: Hadoop and BeyondSeattle Data Geeks: Hadoop and Beyond
Seattle Data Geeks: Hadoop and Beyond
 
Contemporary source control for pharo
Contemporary source control for pharoContemporary source control for pharo
Contemporary source control for pharo
 
Bitsy graph database
Bitsy graph databaseBitsy graph database
Bitsy graph database
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015
 
ES6: The Awesome Parts
ES6: The Awesome PartsES6: The Awesome Parts
ES6: The Awesome Parts
 
Evaluac ión 3 marco teórico
Evaluac ión 3  marco teóricoEvaluac ión 3  marco teórico
Evaluac ión 3 marco teórico
 

Similar to 3 myths

Bimbo Final Project Presentation
Bimbo Final Project PresentationBimbo Final Project Presentation
Bimbo Final Project Presentation
Can Köklü
 

Similar to 3 myths (20)

educational course/tutorialoutlet.com
educational course/tutorialoutlet.comeducational course/tutorialoutlet.com
educational course/tutorialoutlet.com
 
TinkerPop 2020
TinkerPop 2020TinkerPop 2020
TinkerPop 2020
 
GraphQL Bangkok meetup 5.0
GraphQL Bangkok meetup 5.0GraphQL Bangkok meetup 5.0
GraphQL Bangkok meetup 5.0
 
Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHP
 
Anything-to-Graph
Anything-to-GraphAnything-to-Graph
Anything-to-Graph
 
Tips for data science competitions
Tips for data science competitionsTips for data science competitions
Tips for data science competitions
 
Scaling your GraphQL applications with Dgraph
Scaling your GraphQL applications with DgraphScaling your GraphQL applications with Dgraph
Scaling your GraphQL applications with Dgraph
 
Code-first GraphQL Server Development with Prisma
Code-first  GraphQL Server Development with PrismaCode-first  GraphQL Server Development with Prisma
Code-first GraphQL Server Development with Prisma
 
Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...
Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...
Ehtsham Elahi, Senior Research Engineer, Personalization Science and Engineer...
 
Multiple Graphs: Updatable Views
Multiple Graphs: Updatable ViewsMultiple Graphs: Updatable Views
Multiple Graphs: Updatable Views
 
Introduction to Machine Learning with Spark
Introduction to Machine Learning with SparkIntroduction to Machine Learning with Spark
Introduction to Machine Learning with Spark
 
GraphQL Meetup Bangkok 3.0
GraphQL Meetup Bangkok 3.0GraphQL Meetup Bangkok 3.0
GraphQL Meetup Bangkok 3.0
 
008 GNNs at Scale With Graph Data Science Sampling and Python Client Integrat...
008 GNNs at Scale With Graph Data Science Sampling and Python Client Integrat...008 GNNs at Scale With Graph Data Science Sampling and Python Client Integrat...
008 GNNs at Scale With Graph Data Science Sampling and Python Client Integrat...
 
Hardware Accelerated Machine Learning Solution for Detecting Fraud and Money ...
Hardware Accelerated Machine Learning Solution for Detecting Fraud and Money ...Hardware Accelerated Machine Learning Solution for Detecting Fraud and Money ...
Hardware Accelerated Machine Learning Solution for Detecting Fraud and Money ...
 
GraphQL + relay
GraphQL + relayGraphQL + relay
GraphQL + relay
 
openGL basics for sample program (1).ppt
openGL basics for sample program (1).pptopenGL basics for sample program (1).ppt
openGL basics for sample program (1).ppt
 
openGL basics for sample program.ppt
openGL basics for sample program.pptopenGL basics for sample program.ppt
openGL basics for sample program.ppt
 
Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
Build GraphQL APIs with Graphene (Big Mountain Data & Dev 2019)
 
Information to Wisdom: Commonsense Knowledge Extraction and Compilation - Part 2
Information to Wisdom: Commonsense Knowledge Extraction and Compilation - Part 2Information to Wisdom: Commonsense Knowledge Extraction and Compilation - Part 2
Information to Wisdom: Commonsense Knowledge Extraction and Compilation - Part 2
 
Bimbo Final Project Presentation
Bimbo Final Project PresentationBimbo Final Project Presentation
Bimbo Final Project Presentation
 

Recently uploaded

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

3 myths

  • 1. 3 Myths about graph query languages Busted by Pixy Sridhar Ramachandran Founder, LambdaZen LLC
  • 2. Background ● Graph databases are a category of NoSQL databases that model graphs consisting of vertices and edges. ○ The property-graph model from Tinkerpop is a graph database standard. ○ It offers a common abstraction for over a dozen graph databases using the Blueprints API. ● There are two querying paradigms for graph DBs, viz. graph query languages (GQL) and graph traversal languages (GTL). ○ GQLs are declarative and constraint-driven. ○ GTLs are imperative and step-driven.
  • 3. Background ● The Tinkerpop software stack includes Gremlin, a graph traversal language (GTL) that is a monadic Groovy DSL. ● All other GQLs to date are proprietary and can not be ported across graph databases. ● Pixy is a new declarative graph query language (GQL) that works on any Blueprints-compatible graph database. ○ Project page: https://github.com/lambdazen/pixy/ ○ Available under the Apache 2.0 license
  • 4. Myth #1: GQLs and GTLs can’t mix ● Myth #1: Graph Query Languages and Graph Traversal Languages are totally different ways to look at the graph query problem. ● Common wisdom dictates that: ○ A graph “access” language must either be a GTL or a GQL. ○ The programmer must choose one paradigm or the other for a specific query.
  • 5. Pixy co-exists with Gremlin ● Pixy queries are run from Gremlin expressions using the ‘pixy’ step. ● The input and output to the query can be operated on by Gremlin. ● The programmer can use both paradigms in the same query using Pixy + Gremlin. Gremlin (GTL) GremlinPixy (GQL)
  • 6. Myth #2: GQLs are slower ● Myth #2: Graph Query Languages are much slower than Graph Traversal Languages because of their declarative nature. ● Common wisdom dictates that: ○ the performance penalty is the price paid for declarative expressiveness. ○ you can’t be sure about the execution plan of a query written in a GQL, as it is with SQL.
  • 7. Pixy compiles to Gremlin ● Pixy compiles PROLOG-style rules to Gremlin expressions. ● The execution plan is a Gremlin pipeline and can be tweaked by reordering the clauses. ● Performance should be the same in most cases.
  • 8. Myth #3: GQLs can’t be relational ● Myth #3: A graph query language can not be based on N-ary predicate-calculus or relational algebra, since graphs can only express binary relations/predicates. ● Common wisdom dictates that: ○ Graph-based models unlike relational models can only capture binary relationships in edges. ○ Therefore, GQLs can only operate on vertices and edges, not N-ary relations. ○ HypergraphDB is designed to support “hyper” edges across N vertices to address this perceived weakness with graph-based associative models.
  • 9. Pixy derives N-ary relations ● The property graph model can only capture binary relations between vertices in a graph, aka edges. ● But Pixy can derive N-ary relations across vertices, edges and properties. ● These relations can be used to derive other N-ary relations. ○ These relations form what is called the “domain model” for the graph. ○ When any relation is queried, Pixy compiles the query into a sequence of Gremlin steps.
  • 10. An example gremlin> pt = new PixyTheory( '''father(Child, Father) :- out(Child, 'father', Father).''') The above rule means that: - father(A, B), father(B, C), father(D, B) are all true. - father(A, C), father(D, E), etc. are false. gremlin> pt = pt.extend( '''grandfather(X, Y, Z) :- father(X, Y), father(Y, Z).''') The above rule means that: - grandfather(A, B, C) and grandfather(D, B, C) are true - All other combinations are false Sample query from the Pixy Tutorial
  • 11. Wrap-up ● Pixy is a declarative graph query language that dispels 3 myths about GQLs. ● Myth #1: GQLs and GTLs can’t mix. ○ Pixy’s querying capability is integrated into Gremlin, bringing the capabilities of both querying paradigms in one combined language. ● Myth #2: GQLs are slower than GTLs. ○ Pixy compiles PROLOG-based queries and rules to Gremlin expressions. ● Myth #3: GQLs can’t be relational. ○ Pixy can derive N-ary relations from graphs. ○ New relations can be derived from existing ones.