SlideShare a Scribd company logo
What’s New in Apache TinkerPop?
Open Source Graph Computing Framework
http://tinkerpop.incubator.apache.org/
Stephen Mallette - @spmallette
© 2015. All Rights Reserved.
© 2015. All Rights Reserved.
By Andrea Mann from London, United Kingdom (Flickr Uploaded by Hohum) [CC BY 2.0 (http:
//creativecommons.org/licenses/by/2.0)], via Wikimedia Commons
© 2015. All Rights Reserved.
© 2015. All Rights Reserved.
Georgius Agricola, De re metallica 1556
© 2015. All Rights Reserved.
“Woman at spinning wheel with man carding” Smithfield Decretals (British Library, Royal 10 E. IV, fol. 147v), c. 1340“Carding, Spinning and Weaving” by Giovanni Boccaccio
from De claris mulieribus 15th Century
© 2015. All Rights Reserved.
London, British Library, Royal 18 E.iii (15th century) [Public domain], via Wikimedia Commons
© 2015. All Rights Reserved.
[Public domain], via Wikimedia Commons
© 2015. All Rights Reserved.
By Unknown. Photo credit: Yale University Art Gallery. In the Public Domain.
[Public domain], via Wikimedia Commons
[Public domain], via Wikimedia Commons
© 2015. All Rights Reserved.
By Dogcow (Own work) [CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0) or GFDL (http://www.
gnu.org/copyleft/fdl.html)], via Wikimedia Commons
© 2015. All Rights Reserved.
By Adam Schuster (Flickr: Proto IBM) [CC BY 2.0 (http://creativecommons.
org/licenses/by/2.0)], via Wikimedia Commons
By Arnold Reinhold [CC BY-SA 2.5 (http://creativecommons.org/licenses/by-sa/2.5)], via
Wikimedia Commons
© 2015. All Rights Reserved.
© 2015. All Rights Reserved.
label: person
name: Stephen
label: book
title: Connections
label: person
name: James
label: bought label: wrote
Graph Data Structure
© 2015. All Rights Reserved.
TinkerPop 2.0
TinkerPop 3.0
The TinkerPop Stack
© 2015. All Rights Reserved.
The TinkerPop Stack
© 2015. All Rights Reserved.
Gremlin in TinkerPop3
is NOT “just ”
It is advised that not use expressionsƛ
supports BOTH imperative and declarative querying
© 2015. All Rights Reserved.
$ bin/gremlin.sh
,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin>
© 2015. All Rights Reserved.
$ bin/gremlin.sh
,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> graph = GraphFactory.open("graph.properties")
==>tinkergraph[vertices:0 edges:0]
gremlin>
© 2015. All Rights Reserved.
$ bin/gremlin.sh
,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> graph = GraphFactory.open("graph.properties")
==>tinkergraph[vertices:0 edges:0]
gremlin> graph.io(gryo()).readGraph('data.kryo')
==>null
gremlin> graph
==>tinkergraph[vertices:1933 edges:4125]
gremlin>
discussion
wrote
hasResponse
person response
participatesIn hasRoot
© 2015. All Rights Reserved.
$ bin/gremlin.sh
,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> graph = GraphFactory.open("graph.properties")
==>tinkergraph[vertices:0 edges:0]
gremlin> graph.io(gryo()).readGraph('data.kryo')
==>null
gremlin> graph
==>tinkergraph[vertices:1933 edges:4125]
gremlin> g = graph.traversal()
==>graphtraversalsource[tinkergraph[vertices:1933 edges:4125], standard]
gremlin>
© 2015. All Rights Reserved.
gremlin> g.V(4608)
==>v[4608]
4608
person
g.V(4608)
“Find the vertex with id 4608”
© 2015. All Rights Reserved.
gremlin> g.V(4608).values('userName')
==>Renlit
4608
person
g.V(4608)
Renlit
userName
.values('userName')
“Get the value of the ‘userName’ property on vertex 4608”
© 2015. All Rights Reserved.
gremlin> g.V(4608).out('wrote')
==>v[354560]
==>v[640768]
...
==>v[466432]
4608 wrote
person response
g.V(4608) .out('wrote')
“Find the responses posted by ‘Renlit’”
© 2015. All Rights Reserved.
gremlin> g.V(4608).out('wrote').count()
==>67
4608 wrote
person response
.out('wrote')
“Find the number of responses posted by ‘Renlit’”
g.V(4608) .count()
67
© 2015. All Rights Reserved.
gremlin> t = g.V(4608).out('wrote').count();null
==>null
gremlin> t.strategies.toList()
==>ConjunctionStrategy
==>IncidentToAdjacentStrategy
==>AdjacentToIncidentStrategy
==>IdentityRemovalStrategy
==>DedupBijectionStrategy
==>MatchPredicateStrategy
==>RangeByIsCountStrategy
==>TinkerGraphStepStrategy
==>ProfileStrategy
==>EngineDependentStrategy
==>ComputerVerificationStrategy
==>StandardVerificationStrategy
© 2015. All Rights Reserved.
t.strategies.toList()
Strategy
Application
Original Query g.V(4608).out('wrote').count()
© 2015. All Rights Reserved.
AdjacentToIncidentStrategy
Post-Strategies g.V(4608).outE('wrote').count()
ConjunctionStrategy
IncidentToAdjacentStrategy
IdentityRemovalStrategy
DedupBijectionStrategy
MatchPredicateStrategy
RangeByIsCountStrategy
TinkerGraphStepStrategy
ProfileStrategy
EngineDependentStrategy
ComputerVerificationStrategy
StandardVerificationStrategy
gremlin> g.V(4608).as('a').out('wrote').out('hasResponse').in('wrote')
.where(neq('a')).groupCount().next()
==>v[5376]=4
==>v[2304]=2
==>v[5888]=7
...
==>v[10496]=1
4608 wrote
person response
hasResponse
hasResponse
hasResponse
...
response
wrote
wrote
wrote
...
person person
4608
g.V(4608).
as('a')
.out('wrote') .out('hasResponse') .in('wrote') .where(neq('a')) .groupCount()
“Get a distribution over the authors who replied to ‘Renlit’”
© 2015. All Rights Reserved.
gremlin> g.V(4608).out('wrote').values('responseLevel').groupCount()
==>[1:11, 2:19, 3:22, 4:9, 5:3, 6:3]
gremlin>
4608 wrote
person response
g.V(4608) .out('wrote')
...
responseLevel
.values('responseLevel').groupCount()
“Get a distribution over the ‘responseLevel’ value for posts by ‘Renlit’”
© 2015. All Rights Reserved.
gremlin> g.V().has('type','response').values('responseLevel').groupCount()
==>[1:358, 2:796, 3:445, 4:150, 5:57, 6:13, 7:4, 8:1]
gremlin>
response
g.V() .has('type','response')
...
responseLevel
.values('responseLevel') .groupCount()
type response
“Get a distribution over the ‘responseLevel’ for all posts in the graph”
gremlin> g.V(4608).out('wrote').values('responseLevel').groupCount()
==>[1:11, 2:19, 3:22, 4:9, 5:3, 6:3]
gremlin> g.V().has('type','response').values('responseLevel').groupCount()
==>[1:358, 2:796, 3:445, 4:150, 5:57, 6:13, 7:4, 8:1]
gremlin>
g.V(4608).out('wrote')
.values('responseLevel')
.groupCount()
g.V().has('type','response')
.values('responseLevel')
.groupCount()
© 2015. All Rights Reserved.
gremlin> :install org.apache.tinkerpop hadoop-gremlin 3.0.0-incubating
==>Loaded: [org.apache.tinkerpop, hadoop-gremlin, 3.0.0-incubating] - restart the console
to use [tinkerpop.hadoop]
gremlin> :exit
...
$ bin/gremlin.sh
,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> :plugin use tinkerpop.hadoop
==>tinkerpop.hadoop activated
gremlin> hdfs.copyFromLocal('data.kryo', 'data.kryo')
==>null
gremlin> hdfs.ls()
==>rw-r--r-- smallette supergroup 5782840 data.kryo
gremlin>
© 2015. All Rights Reserved.
gremlin> graph = GraphFactory.open('conf/hadoop/data-gryo.properties')
==>hadoopgraph[gryoinputformat->gryooutputformat]
gremlin> g = graph.traversal(computer(SparkGraphComputer))
==>graphtraversalsource[hadoopgraph[gryoinputformat->gryooutputformat],sparkgraphcomputer]
© 2015. All Rights Reserved.
gremlin> graph = GraphFactory.open('conf/hadoop/data-gryo.properties')
==>hadoopgraph[gryoinputformat->gryooutputformat]
gremlin> g = graph.traversal(computer(SparkGraphComputer))
==>graphtraversalsource[hadoopgraph[gryoinputformat->gryooutputformat],sparkgraphcomputer]
gremlin> g.V(4608).out('wrote').values('responseLevel').groupCount()
==>[1:11, 2:19, 3:22, 4:9, 5:3, 6:3]
gremlin> g.V().has('type','response').values('responseLevel').groupCount()
==>[1:358, 2:796, 3:445, 4:150, 5:57, 6:13, 7:4, 8:1]
© 2015. All Rights Reserved.
g.V(4608)
groupCount()
out().in()
g.V().
Any Graph System
Neo4j
Titan
Sqlg
BlueMix
Hadoop
Giraph
Spark
OrientDB
...
gremlin> :plugin use tinkerpop.gephi
==>tinkerpop.gephi activated
gremlin> :remote connect tinkerpop.gephi
==>Connection to Gephi - http://localhost:8080/workspace0 with stepDelay:1000,
startRGBColor:[0.0, 1.0, 0.5], colorToFade:g, colorFadeRate:0.7, startSize:20.0,
sizeDecrementRate:0.33
© 2015. All Rights Reserved.
gremlin> :plugin use tinkerpop.gephi
==>tinkerpop.gephi activated
gremlin> :remote connect tinkerpop.gephi
==>Connection to Gephi - http://localhost:8080/workspace0 with stepDelay:1000,
startRGBColor:[0.0, 1.0, 0.5], colorToFade:g, colorFadeRate:0.7, startSize:20.0,
sizeDecrementRate:0.33
gremlin> :> graph
==>tinkergraph[vertices:1933 edges:4125]
© 2015. All Rights Reserved.
gremlin> :> graph
==>tinkergraph[vertices:1933 edges:4125]
© 2015. All Rights Reserved.
gremlin> g.V(10240).values('userName')
==>Naya
gremlin> g.V(5888).values('userName')
==>Loret
© 2015. All Rights Reserved.
gremlin> subGraph = g.V(10240,5888).repeat(__.outE().subgraph('subGraph').inV())
.times(10)
.cap('subGraph').next()
==>tinkergraph[vertices:1152 edges:1343]
gremlin> :> subGraph
© 2015. All Rights Reserved.
Naya
Loret
gremlin> :remote config visualTraversal subGraph svg
==>Connection to Gephi - http://localhost:8080/workspace0 with stepDelay:1000,
startRGBColor:[0.0, 1.0, 0.5], colorToFade:g, colorFadeRate:0.7, startSize:20.0,
sizeDecrementRate:0.33
gremlin> svg
==>graphtraversalsource[tinkergraph[vertices:1152 edges:1343], standard]
gremlin> svg.strategies.toList()
==>ConjunctionStrategy
==>IncidentToAdjacentStrategy
==>AdjacentToIncidentStrategy
==>IdentityRemovalStrategy
==>FilterRankingStrategy
==>MatchPredicateStrategy
==>RangeByIsCountStrategy
==>TinkerGraphStepStrategy
==>EngineDependentStrategy
==>GephiTraversalVisualizationStrategy
==>ProfileStrategy
==>ComputerVerificationStrategy
© 2015. All Rights Reserved.
gremlin> :> svg.V(10240).as('x').out('wrote').out('hasResponse').in('wrote')
.where(neq('x')).groupCount()
==>[v[5888]:4]
© 2015. All Rights Reserved.
gremlin> :> svg.V(10240).as('x').out('wrote').out('hasResponse').in('wrote')
.where(neq('x')).groupCount()
==>[v[5888]:4]
© 2015. All Rights Reserved.
gremlin> :> svg.V(10240).as('x').out('wrote').out('hasResponse').in('wrote')
.where(neq('x')).groupCount()
==>[v[5888]:4]
© 2015. All Rights Reserved.
gremlin> :> svg.V(10240).as('x').out('wrote').out('hasResponse').in('wrote')
.where(neq('x')).groupCount()
==>[v[5888]:4]
© 2015. All Rights Reserved.
gremlin> :> svg.V(10240).as('x').out('wrote').out('hasResponse').in('wrote')
.where(neq('x')).groupCount()
==>[v[5888]:4]
© 2015. All Rights Reserved.
gremlin> :> svg.V(10240).as('x').out('wrote').out('hasResponse').in('wrote')
.where(neq('x')).groupCount()
==>[v[5888]:4]
© 2015. All Rights Reserved.
Takeaways
If you have connected data, use a Graph DB
If you use a Graph DB, consider
If you use , get started with
Gremlin Console
© 2015. All Rights Reserved.
Acknowledgements
Ketrina Yim
@KetrinaYim
Artist behind Gremlin and his friends
Joe Lee
http://jml3designz.com/
Graphic designer providing support on this presentation
Apache TinkerPop
http://tinkerpop.incubator.apache.org/
The TinkerPop Community
© 2015. All Rights Reserved.

More Related Content

PPTX
Cassandra Summit - What's New In Apache TinkerPop?
PPTX
Kotlin collections
PDF
Python Peculiarities
PDF
Collectors in the Wild
PDF
Go for the paranoid network programmer, 2nd edition
PDF
Transaction is a monad
PDF
Data Pipelines in Swift
PDF
Pure kotlin
Cassandra Summit - What's New In Apache TinkerPop?
Kotlin collections
Python Peculiarities
Collectors in the Wild
Go for the paranoid network programmer, 2nd edition
Transaction is a monad
Data Pipelines in Swift
Pure kotlin

Similar to What's New in Apache TinkerPop - the Graph Computing Framework (20)

PDF
The Gremlin Graph Traversal Language
PDF
Mining the social web ch1
PPT
Swift: Apple's New Programming Language for iOS and OS X
PDF
The Ring programming language version 1.9 book - Part 56 of 210
PDF
Rack Middleware
PDF
Current State of Coroutines
PDF
The Ring programming language version 1.5.4 book - Part 47 of 185
PDF
Greyhound - Powerful Pure Functional Kafka Library
PDF
Perl 6 For Mere Mortals
PDF
Mastering Kotlin Standard Library
KEY
Small pieces loosely joined
PDF
The Ring programming language version 1.5.3 book - Part 10 of 184
PDF
Brand New JavaScript - ECMAScript 2015
PDF
Analysing Github events with Neo4j
PDF
Building resilient services in go
PPT
chapter4.ppt
PDF
The Ring programming language version 1.5.4 book - Part 10 of 185
PDF
Un monde où 1 ms vaut 100 M€ - Devoxx France 2015
PDF
The Ring programming language version 1.8 book - Part 90 of 202
PDF
Architecture Patterns in Practice with Kotlin. UA Mobile 2017.
The Gremlin Graph Traversal Language
Mining the social web ch1
Swift: Apple's New Programming Language for iOS and OS X
The Ring programming language version 1.9 book - Part 56 of 210
Rack Middleware
Current State of Coroutines
The Ring programming language version 1.5.4 book - Part 47 of 185
Greyhound - Powerful Pure Functional Kafka Library
Perl 6 For Mere Mortals
Mastering Kotlin Standard Library
Small pieces loosely joined
The Ring programming language version 1.5.3 book - Part 10 of 184
Brand New JavaScript - ECMAScript 2015
Analysing Github events with Neo4j
Building resilient services in go
chapter4.ppt
The Ring programming language version 1.5.4 book - Part 10 of 185
Un monde où 1 ms vaut 100 M€ - Devoxx France 2015
The Ring programming language version 1.8 book - Part 90 of 202
Architecture Patterns in Practice with Kotlin. UA Mobile 2017.
Ad

More from DataStax Academy (20)

PDF
Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
PPTX
Introduction to DataStax Enterprise Graph Database
PPTX
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
PPTX
Cassandra on Docker @ Walmart Labs
PDF
Cassandra 3.0 Data Modeling
PPTX
Cassandra Adoption on Cisco UCS & Open stack
PDF
Data Modeling for Apache Cassandra
PDF
Coursera Cassandra Driver
PDF
Production Ready Cassandra
PDF
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
PPTX
Cassandra @ Sony: The good, the bad, and the ugly part 1
PPTX
Cassandra @ Sony: The good, the bad, and the ugly part 2
PDF
Standing Up Your First Cluster
PDF
Real Time Analytics with Dse
PDF
Introduction to Data Modeling with Apache Cassandra
PDF
Cassandra Core Concepts
PPTX
Enabling Search in your Cassandra Application with DataStax Enterprise
PPTX
Bad Habits Die Hard
PDF
Advanced Data Modeling with Apache Cassandra
PDF
Advanced Cassandra
Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
Introduction to DataStax Enterprise Graph Database
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Cassandra on Docker @ Walmart Labs
Cassandra 3.0 Data Modeling
Cassandra Adoption on Cisco UCS & Open stack
Data Modeling for Apache Cassandra
Coursera Cassandra Driver
Production Ready Cassandra
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 2
Standing Up Your First Cluster
Real Time Analytics with Dse
Introduction to Data Modeling with Apache Cassandra
Cassandra Core Concepts
Enabling Search in your Cassandra Application with DataStax Enterprise
Bad Habits Die Hard
Advanced Data Modeling with Apache Cassandra
Advanced Cassandra
Ad

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PPTX
A Presentation on Artificial Intelligence
PPTX
Spectroscopy.pptx food analysis technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Approach and Philosophy of On baking technology
A Presentation on Artificial Intelligence
Spectroscopy.pptx food analysis technology
Chapter 3 Spatial Domain Image Processing.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation_ Review paper, used for researhc scholars
Digital-Transformation-Roadmap-for-Companies.pptx
Unlocking AI with Model Context Protocol (MCP)
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Big Data Technologies - Introduction.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
MIND Revenue Release Quarter 2 2025 Press Release
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Programs and apps: productivity, graphics, security and other tools
Agricultural_Statistics_at_a_Glance_2022_0.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Empathic Computing: Creating Shared Understanding
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

What's New in Apache TinkerPop - the Graph Computing Framework