SlideShare a Scribd company logo
1 of 26
Download to read offline
Traversing Graph Databases with Gremlin
               Marko A. Rodriguez
             Graph Systems Architect
            http://markorodriguez.com

      NoSQL New York City Meetup – May 16, 2011




           Gremlin   G = (V, E)


                   May 10, 2011
Thank You Sponsors




Short Slideshow + Live Demo = This Presentation
TinkerPop Productions




1
    1
    TinkerPop (http://tinkerpop.com), Marko A. Rodriguez (http://markorodriguez.com), Peter
Neubauer (http://www.linkedin.com/in/neubauer), Joshua Shinavier (http://fortytwo.net/), Pavel
Yaskevich (https://github.com/xedin), Darrick Wiebe (http://ofallpossibleworlds.wordpress.
com/), Stephen Mallette (http://stephen.genoprime.com/), Alex Averbuch (http://se.linkedin.
com/in/alexaverbuch)
TinkerPop Graph Stack

                            http://host:8182/graph/vertices/1


  RESTful Server


Traversal Language


 Traversal Engine
   Graph-to-Object Mapper

 Generic Interface


                               TinkerGraph

 Graph Database
TinkerPop Graph Stack – Focus

                     http://host:8182/graph/vertices/1




Traversal Language


 Traversal Engine


 Generic Interface


                        TinkerGraph
Blueprints –> Pipes –> Groovy –> Gremlin

To understand Gremlin, its important to understand Groovy,
Blueprints, and Pipes.




                   Bl
                      ue                  s
                        pr            ip
                                         e
                             in      P
                                ts
Gremlin is a Domain Specific Language

• Gremlin 0.7+ uses Groovy as its host language.2

• Gremlin 0.7+ takes advantage of Groovy’s meta-programming, dynamic
  typing, and closure properties.

• Groovy is a superset of Java and as such, natively exposes the full JDK
  to Gremlin.




 2
     Groovy available at http://groovy.codehaus.org/.
Gremlin is for Property Graphs
                                                            name = "lop"
                                                            lang = "java"

                                           weight = 0.4              3
                         name = "marko"
                         age = 29            created
                                                                                    weight = 0.2
                                       9
                                   1                                                created
                                       8                     created
                                                                                              12
                                   7       weight = 1.0
                    weight = 0.5
                                                                    weight = 0.4                    6
                                            knows
                              knows                          11                               name = "peter"
                                                                                              age = 35
                                                                    name = "josh"
                                                            4       age = 32
                                   2
                                                            10
                         name = "vadas"
                         age = 27
                                                                 weight = 1.0

                                                          created



                                                            5
                                                    name = "ripple"
                                                    lang = "java"




A graph is composed of vertices (nodes), edges (links), and properties (keys/values).
Gremlin is for Blueprints-enabled Graph Databases

•   Blueprints can be seen as the JDBC for property graph databases.3
•   Provides a collection of interfaces for graph database providers to implement.
•   Provides tests to ensure the operational semantics of any implementation are correct.
•   Provides numerous “helper utilities” to make working with graph databases easy.




                                 Blueprints

    3
        Blueprints is available at http://blueprints.tinkerpop.com.
A Blueprints Detour - Implementations


  TinkerGraph
A Blueprints Detour - Ouplementations




     JUNG
     Java Universal Network/Graph Framework
Gremlin Compiles Down to Pipes
• Pipes is a data flow framework for evaluating lazy graph traversals.4

• A Pipe extends Iterator, Iterable and can be chained together
  to create processing pipelines.

• A Pipe can be embedded into another Pipe to allow for nested
  processing.




                                                 Pipes
 4
     Pipes is available at http://pipes.tinkerpop.com.
A Pipes Detour - Chained Iterators

• This Pipeline takes objects of type A and turns them into objects of
  type D.


                                                                      D
                                                              D
       A
               A   A   Pipe1   B    Pipe2     C   Pipe3   D       D
   A                                                          D
           A
                                   Pipeline



Pipe<A,D> pipeline =
   new Pipeline<A,D>(Pipe1<A,B>, Pipe2<B,C>, Pipe3<C,D>)
A Pipes Detour - Simple Example

“What are the names of the people that marko knows?”

                                     B       name=peter
                        knows



                A       knows        C       name=pavel

          name=marko
                                   created
                        created
                                     D       name=gremlin
A Pipes Detour - Simple Example
Pipe<Vertex,Edge> pipe1 = new OutEdgesPipe("knows");
Pipe<Edge,Vertex> pipe2 = new InVertexPipe();
Pipe<Vertex,String> pipe3 = new PropertyPipe<String>("name");
Pipe<Vertex,String> pipeline = new Pipeline(pipe1,pipe2,pipe3);
pipeline.setStarts(new SingleIterator<Vertex>(graph.getVertex("A"));


                                                        InVertexPipe()


                       OutEdgesPipe("knows")
                                                                          PropertyPipe("name")

                                                                  B       name=peter
                                              knows



                               A               knows              C       name=pavel

                       name=marko
                                                                created
                                              created
                                                                  D       name=gremlin




HINT: The benefit of Gremlin is that this Java verbosity is reduced to g.v(‘A’).outE(‘knows’).inV.name.
A Pipes Detour - Pipes Library


                       [ GRAPHS ]           [ SIDEEFFECTS ]
[ FILTERS ]            OutEdgesPipe         AggregatorPipe
AndFilterPipe          InEdgesPipe          GroupCountPipe
BackFilterPipe         OutVertexPipe        CountPipe
CollectionFilterPipe   InVertexPip          SideEffectCapPipe
ComparisonFilterPipe   IdFilterPipe
DuplicateFilterPipe    IdPipe               [ UTILITIES ]
FutureFilterPipe       LabelFilterPipe      GatherPipe
ObjectFilterPipe       LabelPipe            PathPipe
OrFilterPipe           PropertyFilterPipe   ScatterPipe
RandomFilterPipe       PropertyPipe         Pipeline
RangeFilterPipe                             ...
A Pipes Detour - Creating Pipes


public class NumCharsPipe extends AbstractPipe<String,Integer> {
  public Integer processNextStart() {
    String word = this.starts.next();
    return word.length();
  }
}


When extending the base class AbstractPipe<S,E> all that is required is
an implementation of processNextStart().
Now onto Gremlin proper...
The Gremlin Architecture




   Neo4j   OrientDB   DEX
The Many Ways of Using Gremlin

• Gremlin has a REPL to be run from the shell.

• Gremlin can be natively integrated into any Groovy class.

• Gremlin can be interacted with indirectly through Java, via Groovy.

• Gremlin has a JSR 223 ScriptEngine as well.
Pipe = Step: 3 Generic Steps
In general a Pipe is a “step” in Gremlin. Gremlin is founded on a collection
of atomic steps. The syntax is generally seen as step.step.step. There
are 3 categories of steps.

• transform: map the input to some output. S → T
     outE, inV, paths, copySplit, fairMerge, . . .

• filter: either output the input or not. S → (S ∪ ∅)
     back, except, uniqueObject, andFilter, orFilter, . . .

• sideEffect: output the input and yield a side-effect. S → S
     aggregate, groupCount, . . .
Abstract/Derived/Inferred Adjacency
                              outE


                                         in                                 outE
                                              V


                                     loop(2){..}                   back(3)
                                               {i
                                                    t.
                                                         sa
                                                              la




                                      }                            ry
                                                                        }


                       friend_of_a_friend_who_earns_less_than_friend_at_work




• outE, inV, etc. is low-level graph speak (the domain is the graph).
• codeveloper is high-level domain speak (the domain is software development).5

   5
     In this way, Gremlin can be seen as a DSL (domain-specific language) for creating DSL’s for your
graph applications. Gremlin’s domain is “the graph.” Build languages for your domain on top of Gremlin
(e.g. “software development domain”).
Developer's FOAF Import
               Graph

                                     Friend-Of-A-Friend
                                           Graph




Developer Imports                                         Friends at Work
     Graph                                                     Graph



                                                                            You need not make
                       Software Imports   Friendship                        derived graphs explicit.
                            Graph           Graph                           You can, at runtime,
                                                                            compute them.
                                                                            Moreover, generate
                                                                            them locally, not
   Developer Created                                                        globally (e.g. ``Marko's
                                                          Employment
        Graph                                                               friends from work
                                                            Graph
                                                                            relations").

                                                                            This concept is related
                                                                            to automated reasoning
                                                                            and whether reasoned
                                                                            relations are inserted
                                                                            into the explicit graph or
                              Explicit Graph                                computed at query time.
Integrating the JDK (Java API)

• Groovy is the host language for Gremlin. Thus, the JDK is natively
  available in a path expression.

gremlin> v.out(‘friend’){it.name.matches(‘M.*’)}.name
==>Mattias
==>Marko
==>Matt
...
gremlin> x.out(‘rated’).transform{JSONParser.get(it.uri).stars}.mean()
...
gremlin> y.outE(‘rated’).filter{TextAnalysis.isElated(it.review)}.inV
...
Time for a demo
marko$ gremlin
         ,,,/
         (o o)
-----oOOo-(_)-oOOo-----
gremlin>




                             Gremlin    G = (V, E)


                     http://gremlin.tinkerpop.com
             http://groups.google.com/group/gremlin-users
                         http://tinkerpop.com
Graph Bootcamp




      http://markorodriguez.com/services/workshops/graph-bootcamp/

• June 23-24th in Chicago, Illinois.
• August X-Yth in Denver, Colorado.
• Book a private gig for your organization.

More Related Content

What's hot

Gremlin's Graph Traversal Machinery
Gremlin's Graph Traversal MachineryGremlin's Graph Traversal Machinery
Gremlin's Graph Traversal MachineryMarko Rodriguez
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQLAppier
 
MySQL Tutorial For Beginners | Relational Database Management System | MySQL ...
MySQL Tutorial For Beginners | Relational Database Management System | MySQL ...MySQL Tutorial For Beginners | Relational Database Management System | MySQL ...
MySQL Tutorial For Beginners | Relational Database Management System | MySQL ...Edureka!
 
The Gremlin Graph Traversal Language
The Gremlin Graph Traversal LanguageThe Gremlin Graph Traversal Language
The Gremlin Graph Traversal LanguageMarko Rodriguez
 
Oracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web ServicesOracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web ServicesJeff Smith
 
Graph database Use Cases
Graph database Use CasesGraph database Use Cases
Graph database Use CasesMax De Marzi
 
Designing and Building a Graph Database Application – Architectural Choices, ...
Designing and Building a Graph Database Application – Architectural Choices, ...Designing and Building a Graph Database Application – Architectural Choices, ...
Designing and Building a Graph Database Application – Architectural Choices, ...Neo4j
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with SpringJoshua Long
 
What's new in Oracle 19c & 18c Recovery Manager (RMAN)
What's new in Oracle 19c & 18c Recovery Manager (RMAN)What's new in Oracle 19c & 18c Recovery Manager (RMAN)
What's new in Oracle 19c & 18c Recovery Manager (RMAN)Satishbabu Gunukula
 
ORDS - Oracle REST Data Services
ORDS - Oracle REST Data ServicesORDS - Oracle REST Data Services
ORDS - Oracle REST Data ServicesJustin Michael Raj
 
Lecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxLecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxSaziaRahman
 
GraphQL Introduction
GraphQL IntroductionGraphQL Introduction
GraphQL IntroductionSerge Huber
 
Maximum Availability Architecture - Best Practices for Oracle Database 19c
Maximum Availability Architecture - Best Practices for Oracle Database 19cMaximum Availability Architecture - Best Practices for Oracle Database 19c
Maximum Availability Architecture - Best Practices for Oracle Database 19cGlen Hawkins
 
Apache Spark Training | Spark Tutorial For Beginners | Apache Spark Certifica...
Apache Spark Training | Spark Tutorial For Beginners | Apache Spark Certifica...Apache Spark Training | Spark Tutorial For Beginners | Apache Spark Certifica...
Apache Spark Training | Spark Tutorial For Beginners | Apache Spark Certifica...Edureka!
 
The Play Framework at LinkedIn
The Play Framework at LinkedInThe Play Framework at LinkedIn
The Play Framework at LinkedInYevgeniy Brikman
 

What's hot (20)

Spring Boot
Spring BootSpring Boot
Spring Boot
 
Gremlin's Graph Traversal Machinery
Gremlin's Graph Traversal MachineryGremlin's Graph Traversal Machinery
Gremlin's Graph Traversal Machinery
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
MySQL Tutorial For Beginners | Relational Database Management System | MySQL ...
MySQL Tutorial For Beginners | Relational Database Management System | MySQL ...MySQL Tutorial For Beginners | Relational Database Management System | MySQL ...
MySQL Tutorial For Beginners | Relational Database Management System | MySQL ...
 
The Gremlin Graph Traversal Language
The Gremlin Graph Traversal LanguageThe Gremlin Graph Traversal Language
The Gremlin Graph Traversal Language
 
Oracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web ServicesOracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web Services
 
Graph database Use Cases
Graph database Use CasesGraph database Use Cases
Graph database Use Cases
 
Designing and Building a Graph Database Application – Architectural Choices, ...
Designing and Building a Graph Database Application – Architectural Choices, ...Designing and Building a Graph Database Application – Architectural Choices, ...
Designing and Building a Graph Database Application – Architectural Choices, ...
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
What's new in Oracle 19c & 18c Recovery Manager (RMAN)
What's new in Oracle 19c & 18c Recovery Manager (RMAN)What's new in Oracle 19c & 18c Recovery Manager (RMAN)
What's new in Oracle 19c & 18c Recovery Manager (RMAN)
 
ORDS - Oracle REST Data Services
ORDS - Oracle REST Data ServicesORDS - Oracle REST Data Services
ORDS - Oracle REST Data Services
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Lecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptxLecture 2_ Intro to laravel.pptx
Lecture 2_ Intro to laravel.pptx
 
GraphQL Introduction
GraphQL IntroductionGraphQL Introduction
GraphQL Introduction
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Maximum Availability Architecture - Best Practices for Oracle Database 19c
Maximum Availability Architecture - Best Practices for Oracle Database 19cMaximum Availability Architecture - Best Practices for Oracle Database 19c
Maximum Availability Architecture - Best Practices for Oracle Database 19c
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
Introduction to java 8 stream api
Introduction to java 8 stream apiIntroduction to java 8 stream api
Introduction to java 8 stream api
 
Apache Spark Training | Spark Tutorial For Beginners | Apache Spark Certifica...
Apache Spark Training | Spark Tutorial For Beginners | Apache Spark Certifica...Apache Spark Training | Spark Tutorial For Beginners | Apache Spark Certifica...
Apache Spark Training | Spark Tutorial For Beginners | Apache Spark Certifica...
 
The Play Framework at LinkedIn
The Play Framework at LinkedInThe Play Framework at LinkedIn
The Play Framework at LinkedIn
 

Viewers also liked

Intro to Graph Databases Using Tinkerpop, TitanDB, and Gremlin
Intro to Graph Databases Using Tinkerpop, TitanDB, and GremlinIntro to Graph Databases Using Tinkerpop, TitanDB, and Gremlin
Intro to Graph Databases Using Tinkerpop, TitanDB, and GremlinCaleb Jones
 
Gremlin: A Graph-Based Programming Language
Gremlin: A Graph-Based Programming LanguageGremlin: A Graph-Based Programming Language
Gremlin: A Graph-Based Programming LanguageMarko Rodriguez
 
DataStax: What's New in Apache TinkerPop - the Graph Computing Framework
DataStax: What's New in Apache TinkerPop - the Graph Computing FrameworkDataStax: What's New in Apache TinkerPop - the Graph Computing Framework
DataStax: What's New in Apache TinkerPop - the Graph Computing FrameworkDataStax Academy
 
The Gremlin in the Graph
The Gremlin in the GraphThe Gremlin in the Graph
The Gremlin in the GraphMarko Rodriguez
 
Solving Problems with Graphs
Solving Problems with GraphsSolving Problems with Graphs
Solving Problems with GraphsMarko Rodriguez
 
Problem-Solving using Graph Traversals: Searching, Scoring, Ranking, and Reco...
Problem-Solving using Graph Traversals: Searching, Scoring, Ranking, and Reco...Problem-Solving using Graph Traversals: Searching, Scoring, Ranking, and Reco...
Problem-Solving using Graph Traversals: Searching, Scoring, Ranking, and Reco...Marko Rodriguez
 
Introduction to Gremlin
Introduction to GremlinIntroduction to Gremlin
Introduction to GremlinMax De Marzi
 
Graph Processing with Apache TinkerPop
Graph Processing with Apache TinkerPopGraph Processing with Apache TinkerPop
Graph Processing with Apache TinkerPopJason Plurad
 
What are systems and how does this apply to school leadership
What are systems and how does this apply to school leadership What are systems and how does this apply to school leadership
What are systems and how does this apply to school leadership Ruth Deakin Crick
 
The Graph Traversal Programming Pattern
The Graph Traversal Programming PatternThe Graph Traversal Programming Pattern
The Graph Traversal Programming PatternMarko Rodriguez
 
System concepts, elements and types of systems ppt
System concepts, elements and types of systems pptSystem concepts, elements and types of systems ppt
System concepts, elements and types of systems pptShobhit Sharma
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logicAmey Kerkar
 
ACM DBPL Keynote: The Graph Traversal Machine and Language
ACM DBPL Keynote: The Graph Traversal Machine and LanguageACM DBPL Keynote: The Graph Traversal Machine and Language
ACM DBPL Keynote: The Graph Traversal Machine and LanguageMarko Rodriguez
 

Viewers also liked (13)

Intro to Graph Databases Using Tinkerpop, TitanDB, and Gremlin
Intro to Graph Databases Using Tinkerpop, TitanDB, and GremlinIntro to Graph Databases Using Tinkerpop, TitanDB, and Gremlin
Intro to Graph Databases Using Tinkerpop, TitanDB, and Gremlin
 
Gremlin: A Graph-Based Programming Language
Gremlin: A Graph-Based Programming LanguageGremlin: A Graph-Based Programming Language
Gremlin: A Graph-Based Programming Language
 
DataStax: What's New in Apache TinkerPop - the Graph Computing Framework
DataStax: What's New in Apache TinkerPop - the Graph Computing FrameworkDataStax: What's New in Apache TinkerPop - the Graph Computing Framework
DataStax: What's New in Apache TinkerPop - the Graph Computing Framework
 
The Gremlin in the Graph
The Gremlin in the GraphThe Gremlin in the Graph
The Gremlin in the Graph
 
Solving Problems with Graphs
Solving Problems with GraphsSolving Problems with Graphs
Solving Problems with Graphs
 
Problem-Solving using Graph Traversals: Searching, Scoring, Ranking, and Reco...
Problem-Solving using Graph Traversals: Searching, Scoring, Ranking, and Reco...Problem-Solving using Graph Traversals: Searching, Scoring, Ranking, and Reco...
Problem-Solving using Graph Traversals: Searching, Scoring, Ranking, and Reco...
 
Introduction to Gremlin
Introduction to GremlinIntroduction to Gremlin
Introduction to Gremlin
 
Graph Processing with Apache TinkerPop
Graph Processing with Apache TinkerPopGraph Processing with Apache TinkerPop
Graph Processing with Apache TinkerPop
 
What are systems and how does this apply to school leadership
What are systems and how does this apply to school leadership What are systems and how does this apply to school leadership
What are systems and how does this apply to school leadership
 
The Graph Traversal Programming Pattern
The Graph Traversal Programming PatternThe Graph Traversal Programming Pattern
The Graph Traversal Programming Pattern
 
System concepts, elements and types of systems ppt
System concepts, elements and types of systems pptSystem concepts, elements and types of systems ppt
System concepts, elements and types of systems ppt
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 
ACM DBPL Keynote: The Graph Traversal Machine and Language
ACM DBPL Keynote: The Graph Traversal Machine and LanguageACM DBPL Keynote: The Graph Traversal Machine and Language
ACM DBPL Keynote: The Graph Traversal Machine and Language
 

Similar to Traversing Graph Databases with Gremlin

The Path-o-Logical Gremlin
The Path-o-Logical GremlinThe Path-o-Logical Gremlin
The Path-o-Logical GremlinMarko Rodriguez
 
1st UIM-GDB - Connections to the Real World
1st UIM-GDB - Connections to the Real World1st UIM-GDB - Connections to the Real World
1st UIM-GDB - Connections to the Real WorldAchim Friedland
 
Fosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
Fosdem 2011 - A Common Graph Database Access Layer for .Net and MonoFosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
Fosdem 2011 - A Common Graph Database Access Layer for .Net and MonoAchim Friedland
 
ソーシャルグラフ分析
ソーシャルグラフ分析ソーシャルグラフ分析
ソーシャルグラフ分析shunya kimura
 
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Rajmahendra Hegde
 
JSPP: Morphing C++ into Javascript
JSPP: Morphing C++ into JavascriptJSPP: Morphing C++ into Javascript
JSPP: Morphing C++ into JavascriptChristopher Chedeau
 
Application Modeling with Graph Databases
Application Modeling with Graph DatabasesApplication Modeling with Graph Databases
Application Modeling with Graph DatabasesJosh Adell
 
Rapid Development with Ruby/JRuby and Rails
Rapid Development with Ruby/JRuby and RailsRapid Development with Ruby/JRuby and Rails
Rapid Development with Ruby/JRuby and Railselliando dias
 
In The Land Of Graphs...
In The Land Of Graphs...In The Land Of Graphs...
In The Land Of Graphs...Fernand Galiana
 
Concurrent Stream Processing
Concurrent Stream ProcessingConcurrent Stream Processing
Concurrent Stream ProcessingAlex Miller
 
A walk in graph databases v1.0
A walk in graph databases v1.0A walk in graph databases v1.0
A walk in graph databases v1.0Pierre De Wilde
 
BUILDING WHILE FLYING
BUILDING WHILE FLYINGBUILDING WHILE FLYING
BUILDING WHILE FLYINGKamal Shannak
 
Neo4j -- or why graph dbs kick ass
Neo4j -- or why graph dbs kick assNeo4j -- or why graph dbs kick ass
Neo4j -- or why graph dbs kick assEmil Eifrem
 
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallJavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallYuichi Sakuraba
 

Similar to Traversing Graph Databases with Gremlin (20)

The Path-o-Logical Gremlin
The Path-o-Logical GremlinThe Path-o-Logical Gremlin
The Path-o-Logical Gremlin
 
Gremlin
Gremlin Gremlin
Gremlin
 
1st UIM-GDB - Connections to the Real World
1st UIM-GDB - Connections to the Real World1st UIM-GDB - Connections to the Real World
1st UIM-GDB - Connections to the Real World
 
Fosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
Fosdem 2011 - A Common Graph Database Access Layer for .Net and MonoFosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
Fosdem 2011 - A Common Graph Database Access Layer for .Net and Mono
 
ソーシャルグラフ分析
ソーシャルグラフ分析ソーシャルグラフ分析
ソーシャルグラフ分析
 
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
 
JSPP: Morphing C++ into Javascript
JSPP: Morphing C++ into JavascriptJSPP: Morphing C++ into Javascript
JSPP: Morphing C++ into Javascript
 
J
JJ
J
 
Neo4j Nosqllive
Neo4j NosqlliveNeo4j Nosqllive
Neo4j Nosqllive
 
Application Modeling with Graph Databases
Application Modeling with Graph DatabasesApplication Modeling with Graph Databases
Application Modeling with Graph Databases
 
Rapid Development with Ruby/JRuby and Rails
Rapid Development with Ruby/JRuby and RailsRapid Development with Ruby/JRuby and Rails
Rapid Development with Ruby/JRuby and Rails
 
In The Land Of Graphs...
In The Land Of Graphs...In The Land Of Graphs...
In The Land Of Graphs...
 
Groovy & Grails
Groovy & GrailsGroovy & Grails
Groovy & Grails
 
Concurrent Stream Processing
Concurrent Stream ProcessingConcurrent Stream Processing
Concurrent Stream Processing
 
A walk in graph databases v1.0
A walk in graph databases v1.0A walk in graph databases v1.0
A walk in graph databases v1.0
 
ruby1_6up
ruby1_6upruby1_6up
ruby1_6up
 
ruby1_6up
ruby1_6upruby1_6up
ruby1_6up
 
BUILDING WHILE FLYING
BUILDING WHILE FLYINGBUILDING WHILE FLYING
BUILDING WHILE FLYING
 
Neo4j -- or why graph dbs kick ass
Neo4j -- or why graph dbs kick assNeo4j -- or why graph dbs kick ass
Neo4j -- or why graph dbs kick ass
 
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallJavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
 

More from Marko Rodriguez

mm-ADT: A Virtual Machine/An Economic Machine
mm-ADT: A Virtual Machine/An Economic Machinemm-ADT: A Virtual Machine/An Economic Machine
mm-ADT: A Virtual Machine/An Economic MachineMarko Rodriguez
 
mm-ADT: A Multi-Model Abstract Data Type
mm-ADT: A Multi-Model Abstract Data Typemm-ADT: A Multi-Model Abstract Data Type
mm-ADT: A Multi-Model Abstract Data TypeMarko Rodriguez
 
Open Problems in the Universal Graph Theory
Open Problems in the Universal Graph TheoryOpen Problems in the Universal Graph Theory
Open Problems in the Universal Graph TheoryMarko Rodriguez
 
Gremlin 101.3 On Your FM Dial
Gremlin 101.3 On Your FM DialGremlin 101.3 On Your FM Dial
Gremlin 101.3 On Your FM DialMarko Rodriguez
 
Quantum Processes in Graph Computing
Quantum Processes in Graph ComputingQuantum Processes in Graph Computing
Quantum Processes in Graph ComputingMarko Rodriguez
 
Faunus: Graph Analytics Engine
Faunus: Graph Analytics EngineFaunus: Graph Analytics Engine
Faunus: Graph Analytics EngineMarko Rodriguez
 
Titan: The Rise of Big Graph Data
Titan: The Rise of Big Graph DataTitan: The Rise of Big Graph Data
Titan: The Rise of Big Graph DataMarko Rodriguez
 
The Pathology of Graph Databases
The Pathology of Graph DatabasesThe Pathology of Graph Databases
The Pathology of Graph DatabasesMarko Rodriguez
 
Memoirs of a Graph Addict: Despair to Redemption
Memoirs of a Graph Addict: Despair to RedemptionMemoirs of a Graph Addict: Despair to Redemption
Memoirs of a Graph Addict: Despair to RedemptionMarko Rodriguez
 
Graph Databases: Trends in the Web of Data
Graph Databases: Trends in the Web of DataGraph Databases: Trends in the Web of Data
Graph Databases: Trends in the Web of DataMarko Rodriguez
 
A Perspective on Graph Theory and Network Science
A Perspective on Graph Theory and Network ScienceA Perspective on Graph Theory and Network Science
A Perspective on Graph Theory and Network ScienceMarko Rodriguez
 
The Network Data Structure in Computing
The Network Data Structure in ComputingThe Network Data Structure in Computing
The Network Data Structure in ComputingMarko Rodriguez
 
A Model of the Scholarly Community
A Model of the Scholarly CommunityA Model of the Scholarly Community
A Model of the Scholarly CommunityMarko Rodriguez
 
General-Purpose, Internet-Scale Distributed Computing with Linked Process
General-Purpose, Internet-Scale Distributed Computing with Linked ProcessGeneral-Purpose, Internet-Scale Distributed Computing with Linked Process
General-Purpose, Internet-Scale Distributed Computing with Linked ProcessMarko Rodriguez
 
Collective Decision Making Systems: From the Ideal State to Human Eudaimonia
Collective Decision Making Systems: From the Ideal State to Human EudaimoniaCollective Decision Making Systems: From the Ideal State to Human Eudaimonia
Collective Decision Making Systems: From the Ideal State to Human EudaimoniaMarko Rodriguez
 
Distributed Graph Databases and the Emerging Web of Data
Distributed Graph Databases and the Emerging Web of DataDistributed Graph Databases and the Emerging Web of Data
Distributed Graph Databases and the Emerging Web of DataMarko Rodriguez
 
An Overview of Data Management Paradigms: Relational, Document, and Graph
An Overview of Data Management Paradigms: Relational, Document, and GraphAn Overview of Data Management Paradigms: Relational, Document, and Graph
An Overview of Data Management Paradigms: Relational, Document, and GraphMarko Rodriguez
 
Graph Databases and the Future of Large-Scale Knowledge Management
Graph Databases and the Future of Large-Scale Knowledge ManagementGraph Databases and the Future of Large-Scale Knowledge Management
Graph Databases and the Future of Large-Scale Knowledge ManagementMarko Rodriguez
 
Automatic Metadata Generation using Associative Networks
Automatic Metadata Generation using Associative NetworksAutomatic Metadata Generation using Associative Networks
Automatic Metadata Generation using Associative NetworksMarko Rodriguez
 

More from Marko Rodriguez (20)

mm-ADT: A Virtual Machine/An Economic Machine
mm-ADT: A Virtual Machine/An Economic Machinemm-ADT: A Virtual Machine/An Economic Machine
mm-ADT: A Virtual Machine/An Economic Machine
 
mm-ADT: A Multi-Model Abstract Data Type
mm-ADT: A Multi-Model Abstract Data Typemm-ADT: A Multi-Model Abstract Data Type
mm-ADT: A Multi-Model Abstract Data Type
 
Open Problems in the Universal Graph Theory
Open Problems in the Universal Graph TheoryOpen Problems in the Universal Graph Theory
Open Problems in the Universal Graph Theory
 
Gremlin 101.3 On Your FM Dial
Gremlin 101.3 On Your FM DialGremlin 101.3 On Your FM Dial
Gremlin 101.3 On Your FM Dial
 
Quantum Processes in Graph Computing
Quantum Processes in Graph ComputingQuantum Processes in Graph Computing
Quantum Processes in Graph Computing
 
The Path Forward
The Path ForwardThe Path Forward
The Path Forward
 
Faunus: Graph Analytics Engine
Faunus: Graph Analytics EngineFaunus: Graph Analytics Engine
Faunus: Graph Analytics Engine
 
Titan: The Rise of Big Graph Data
Titan: The Rise of Big Graph DataTitan: The Rise of Big Graph Data
Titan: The Rise of Big Graph Data
 
The Pathology of Graph Databases
The Pathology of Graph DatabasesThe Pathology of Graph Databases
The Pathology of Graph Databases
 
Memoirs of a Graph Addict: Despair to Redemption
Memoirs of a Graph Addict: Despair to RedemptionMemoirs of a Graph Addict: Despair to Redemption
Memoirs of a Graph Addict: Despair to Redemption
 
Graph Databases: Trends in the Web of Data
Graph Databases: Trends in the Web of DataGraph Databases: Trends in the Web of Data
Graph Databases: Trends in the Web of Data
 
A Perspective on Graph Theory and Network Science
A Perspective on Graph Theory and Network ScienceA Perspective on Graph Theory and Network Science
A Perspective on Graph Theory and Network Science
 
The Network Data Structure in Computing
The Network Data Structure in ComputingThe Network Data Structure in Computing
The Network Data Structure in Computing
 
A Model of the Scholarly Community
A Model of the Scholarly CommunityA Model of the Scholarly Community
A Model of the Scholarly Community
 
General-Purpose, Internet-Scale Distributed Computing with Linked Process
General-Purpose, Internet-Scale Distributed Computing with Linked ProcessGeneral-Purpose, Internet-Scale Distributed Computing with Linked Process
General-Purpose, Internet-Scale Distributed Computing with Linked Process
 
Collective Decision Making Systems: From the Ideal State to Human Eudaimonia
Collective Decision Making Systems: From the Ideal State to Human EudaimoniaCollective Decision Making Systems: From the Ideal State to Human Eudaimonia
Collective Decision Making Systems: From the Ideal State to Human Eudaimonia
 
Distributed Graph Databases and the Emerging Web of Data
Distributed Graph Databases and the Emerging Web of DataDistributed Graph Databases and the Emerging Web of Data
Distributed Graph Databases and the Emerging Web of Data
 
An Overview of Data Management Paradigms: Relational, Document, and Graph
An Overview of Data Management Paradigms: Relational, Document, and GraphAn Overview of Data Management Paradigms: Relational, Document, and Graph
An Overview of Data Management Paradigms: Relational, Document, and Graph
 
Graph Databases and the Future of Large-Scale Knowledge Management
Graph Databases and the Future of Large-Scale Knowledge ManagementGraph Databases and the Future of Large-Scale Knowledge Management
Graph Databases and the Future of Large-Scale Knowledge Management
 
Automatic Metadata Generation using Associative Networks
Automatic Metadata Generation using Associative NetworksAutomatic Metadata Generation using Associative Networks
Automatic Metadata Generation using Associative Networks
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Traversing Graph Databases with Gremlin

  • 1. Traversing Graph Databases with Gremlin Marko A. Rodriguez Graph Systems Architect http://markorodriguez.com NoSQL New York City Meetup – May 16, 2011 Gremlin G = (V, E) May 10, 2011
  • 2. Thank You Sponsors Short Slideshow + Live Demo = This Presentation
  • 3. TinkerPop Productions 1 1 TinkerPop (http://tinkerpop.com), Marko A. Rodriguez (http://markorodriguez.com), Peter Neubauer (http://www.linkedin.com/in/neubauer), Joshua Shinavier (http://fortytwo.net/), Pavel Yaskevich (https://github.com/xedin), Darrick Wiebe (http://ofallpossibleworlds.wordpress. com/), Stephen Mallette (http://stephen.genoprime.com/), Alex Averbuch (http://se.linkedin. com/in/alexaverbuch)
  • 4. TinkerPop Graph Stack http://host:8182/graph/vertices/1 RESTful Server Traversal Language Traversal Engine Graph-to-Object Mapper Generic Interface TinkerGraph Graph Database
  • 5. TinkerPop Graph Stack – Focus http://host:8182/graph/vertices/1 Traversal Language Traversal Engine Generic Interface TinkerGraph
  • 6. Blueprints –> Pipes –> Groovy –> Gremlin To understand Gremlin, its important to understand Groovy, Blueprints, and Pipes. Bl ue s pr ip e in P ts
  • 7. Gremlin is a Domain Specific Language • Gremlin 0.7+ uses Groovy as its host language.2 • Gremlin 0.7+ takes advantage of Groovy’s meta-programming, dynamic typing, and closure properties. • Groovy is a superset of Java and as such, natively exposes the full JDK to Gremlin. 2 Groovy available at http://groovy.codehaus.org/.
  • 8. Gremlin is for Property Graphs name = "lop" lang = "java" weight = 0.4 3 name = "marko" age = 29 created weight = 0.2 9 1 created 8 created 12 7 weight = 1.0 weight = 0.5 weight = 0.4 6 knows knows 11 name = "peter" age = 35 name = "josh" 4 age = 32 2 10 name = "vadas" age = 27 weight = 1.0 created 5 name = "ripple" lang = "java" A graph is composed of vertices (nodes), edges (links), and properties (keys/values).
  • 9. Gremlin is for Blueprints-enabled Graph Databases • Blueprints can be seen as the JDBC for property graph databases.3 • Provides a collection of interfaces for graph database providers to implement. • Provides tests to ensure the operational semantics of any implementation are correct. • Provides numerous “helper utilities” to make working with graph databases easy. Blueprints 3 Blueprints is available at http://blueprints.tinkerpop.com.
  • 10. A Blueprints Detour - Implementations TinkerGraph
  • 11. A Blueprints Detour - Ouplementations JUNG Java Universal Network/Graph Framework
  • 12. Gremlin Compiles Down to Pipes • Pipes is a data flow framework for evaluating lazy graph traversals.4 • A Pipe extends Iterator, Iterable and can be chained together to create processing pipelines. • A Pipe can be embedded into another Pipe to allow for nested processing. Pipes 4 Pipes is available at http://pipes.tinkerpop.com.
  • 13. A Pipes Detour - Chained Iterators • This Pipeline takes objects of type A and turns them into objects of type D. D D A A A Pipe1 B Pipe2 C Pipe3 D D A D A Pipeline Pipe<A,D> pipeline = new Pipeline<A,D>(Pipe1<A,B>, Pipe2<B,C>, Pipe3<C,D>)
  • 14. A Pipes Detour - Simple Example “What are the names of the people that marko knows?” B name=peter knows A knows C name=pavel name=marko created created D name=gremlin
  • 15. A Pipes Detour - Simple Example Pipe<Vertex,Edge> pipe1 = new OutEdgesPipe("knows"); Pipe<Edge,Vertex> pipe2 = new InVertexPipe(); Pipe<Vertex,String> pipe3 = new PropertyPipe<String>("name"); Pipe<Vertex,String> pipeline = new Pipeline(pipe1,pipe2,pipe3); pipeline.setStarts(new SingleIterator<Vertex>(graph.getVertex("A")); InVertexPipe() OutEdgesPipe("knows") PropertyPipe("name") B name=peter knows A knows C name=pavel name=marko created created D name=gremlin HINT: The benefit of Gremlin is that this Java verbosity is reduced to g.v(‘A’).outE(‘knows’).inV.name.
  • 16. A Pipes Detour - Pipes Library [ GRAPHS ] [ SIDEEFFECTS ] [ FILTERS ] OutEdgesPipe AggregatorPipe AndFilterPipe InEdgesPipe GroupCountPipe BackFilterPipe OutVertexPipe CountPipe CollectionFilterPipe InVertexPip SideEffectCapPipe ComparisonFilterPipe IdFilterPipe DuplicateFilterPipe IdPipe [ UTILITIES ] FutureFilterPipe LabelFilterPipe GatherPipe ObjectFilterPipe LabelPipe PathPipe OrFilterPipe PropertyFilterPipe ScatterPipe RandomFilterPipe PropertyPipe Pipeline RangeFilterPipe ...
  • 17. A Pipes Detour - Creating Pipes public class NumCharsPipe extends AbstractPipe<String,Integer> { public Integer processNextStart() { String word = this.starts.next(); return word.length(); } } When extending the base class AbstractPipe<S,E> all that is required is an implementation of processNextStart().
  • 18. Now onto Gremlin proper...
  • 19. The Gremlin Architecture Neo4j OrientDB DEX
  • 20. The Many Ways of Using Gremlin • Gremlin has a REPL to be run from the shell. • Gremlin can be natively integrated into any Groovy class. • Gremlin can be interacted with indirectly through Java, via Groovy. • Gremlin has a JSR 223 ScriptEngine as well.
  • 21. Pipe = Step: 3 Generic Steps In general a Pipe is a “step” in Gremlin. Gremlin is founded on a collection of atomic steps. The syntax is generally seen as step.step.step. There are 3 categories of steps. • transform: map the input to some output. S → T outE, inV, paths, copySplit, fairMerge, . . . • filter: either output the input or not. S → (S ∪ ∅) back, except, uniqueObject, andFilter, orFilter, . . . • sideEffect: output the input and yield a side-effect. S → S aggregate, groupCount, . . .
  • 22. Abstract/Derived/Inferred Adjacency outE in outE V loop(2){..} back(3) {i t. sa la } ry } friend_of_a_friend_who_earns_less_than_friend_at_work • outE, inV, etc. is low-level graph speak (the domain is the graph). • codeveloper is high-level domain speak (the domain is software development).5 5 In this way, Gremlin can be seen as a DSL (domain-specific language) for creating DSL’s for your graph applications. Gremlin’s domain is “the graph.” Build languages for your domain on top of Gremlin (e.g. “software development domain”).
  • 23. Developer's FOAF Import Graph Friend-Of-A-Friend Graph Developer Imports Friends at Work Graph Graph You need not make Software Imports Friendship derived graphs explicit. Graph Graph You can, at runtime, compute them. Moreover, generate them locally, not Developer Created globally (e.g. ``Marko's Employment Graph friends from work Graph relations"). This concept is related to automated reasoning and whether reasoned relations are inserted into the explicit graph or Explicit Graph computed at query time.
  • 24. Integrating the JDK (Java API) • Groovy is the host language for Gremlin. Thus, the JDK is natively available in a path expression. gremlin> v.out(‘friend’){it.name.matches(‘M.*’)}.name ==>Mattias ==>Marko ==>Matt ... gremlin> x.out(‘rated’).transform{JSONParser.get(it.uri).stars}.mean() ... gremlin> y.outE(‘rated’).filter{TextAnalysis.isElated(it.review)}.inV ...
  • 25. Time for a demo marko$ gremlin ,,,/ (o o) -----oOOo-(_)-oOOo----- gremlin> Gremlin G = (V, E) http://gremlin.tinkerpop.com http://groups.google.com/group/gremlin-users http://tinkerpop.com
  • 26. Graph Bootcamp http://markorodriguez.com/services/workshops/graph-bootcamp/ • June 23-24th in Chicago, Illinois. • August X-Yth in Denver, Colorado. • Book a private gig for your organization.