1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...

By Bruno P. Kinoshita When I was younger and my older brother was living in Germany, I asked him if he
had learned German. He said that he did, and explained that there are several
dialects, and he was quite proud for some people told him that he was using the
Bavarian dialect correctly.

Even though Cypher,
Gremlin and SPARQL
are all query languages, I think we can consider them dialects of a common graph language.
Cypher is the query language used in neo4j, a graph database.
Gremlin is part of the Tinkerpop, an open source project
that contains graph server, graph algorithms, graph language, among other sub-projects.
And last but not least, SPARQL is used to query RDF documents.

Let’s use the example of the Matrix movie provided by neo4j to take a look at the
three languages.


First we create the graph.

CREATE (matrix1:Movie {id : ‘603’, title : ‘The Matrix’, YEAR : ‘1999-03-31’}),
(matrix2:Movie {id : ‘604’, title : ‘The Matrix Reloaded’, YEAR : ‘2003-05-07’}),
(matrix3:Movie {id : ‘605’, title : ‘The Matrix Revolutions’, YEAR : ‘2003-10-27′}),

(neo:Actor {name:’Keanu Reeves’}),
(morpheus:Actor {name:’Laurence Fishburne’}),
(trinity:Actor {name:’Carrie-Anne Moss’}),



Você também pode querer ler

Comments are off for this post.