NoSQL Zone is brought to you in partnership with:

Andreas Kollegger is a leading speaker and writer on graph databases and Neo4j and the bridge between community and developer efforts. He works actively in the community, speaking around the world and promoting the larger Neo4j ecosystem of projects. Author of Fair Trade Software, and the lead for Neo4j in the cloud, Andreas plays a valuable role for progressive happenings within Neo4j. Andreas is a DZone MVB and is not an employee of DZone and has posted 75 posts at DZone. You can read more from them at their website. View Full User Profile

Neo4j-[:LOVES]->Cypher

09.04.2012
| 2992 views |
  • submit to reddit

Webinar Follow-Up

Thanks to everyone for attending the webinar, I was thrilled about the attendance and the great discussions in the chat.

As promised we publish this follow-up post to address questions that were not answered and provide a convenient place to check out the resources mentioned in the webinar.

Your Questions

Oleg Okun: How easily can one migrate from a graph database to a non-graph NoSQL database?
Export your data using any of the API's (Java, REST, Cypher) and import it on the other side.

Alexandre Meynaud: Should we be concerned about performance when defining cypher patterns?
There are some concerns, cypher performance is addressed in Neo4j 1.9, right now try to focus on simple pattern with just one or two bound nodes and non-optional relationships. You might employ patterns as experessions instead of optional relationships

Oleg Okun: Can you point to Cypher implementation of some machine learning/data mining algorithms?
I don't know of any, might be an interesting topic to contribute to. There are some data modeling examples in the Neo4j Manual.

Martin: Will future versions of Cypher be backwards compatible?
Older Cypher parser versions are supported for up to two major Neo4j versions, oder parsers might be activated by prepending a CYPHER 1.7 like prefix to your query.

Alexandre Meynaud: Do you foresee a "standard" graph query language in the coming years (or decades)?
Not really, for us we focus on allowing our community users and customers to solve their problems. We've had discussions with other vendors about it, but it seems premature to agree on a standard while we are all so busy and focused on product development.

Ajinkya: Can you discuss the reasons that went into the decision to implement cypher using Scala ?
This is a longer discussion, which I covered in a talk given at Geekout Tallinn, see the resources section below.

Slides

Intro to Cypher from jexp

Video Recording

0830 - Cypher and Neo4j from Neo Technology on Vimeo.

More Resources

Great Webinar Chat!

The chat during the webinars was great, thanks a lot to Andreas Kollegger for answering all the questions.

Hassan: Washington DC here
Chris Skardon: evening from Cornwall, UK
Matt Taylor: hello from Chicago
ASHISH M: wow! looks like we have an internnational crowd on today!! Anyone from Australia?
MilanSK: eveninig from Humenne, Slovakia
Harald: Frankfurt, Germany
Martin: Hi from Spain (and Gibraltar)
...
Alexandre Meynaud: Yes, the great thing about Cypher is that you express *what* you want to retreive from the graph, and not how
Aki Ristkari: It's easy to visualize and you don't have to explain any table-row-kill_me_now-hibernate stuff to people. That marketing term 'Whiteboard friendly' is actually very accurate
Andreas Kollegger: @Hisao you can't do sub-queries, but you can "chain" queries using a "WITH" clause to sort-of pipe the results to another query instead of returning them
Amit: is there a way to indicate in cypher to prune conditionally like we can using the traverser API
Hisao Motoyama: ok, thanks
Andreas Kollegger: @Ivan the query performance is not affected by the database size, though it is affected by an increase in "local" data
Alex Guerrieri: I love how intuitive it is
...
IvanTraveso: nice presentation. thanks!
Alexandre Meynaud: Great presentation Michael, thanks a lot
Wes: Thanks a lot guys.
Andreas Kollegger: thanks everyone, thanks Michael!
James Camfield: cheers
Chris Skardon: Thanks!
Mylène: Thanks. this was absolutely cool!
Aki Ristkari: Thanks for the show  
 

 

How to use Cypher from other programming languages

This topic is so broad, we will address it in a separate blog, for now here is the link to the gist.

ExecutionEngine engine = new ExecutionEngine(graphDB);

String query = "start n=node:Person(name={name})
 match n-[:ACTS_IN]->movie<-[:ACTS_IN]-friend
 return friend";
ExecutionResult result = engine.query(query, map("name", "Keanu");

for (Map<String,Object> row : result) {
    Node friend = row.get("friend");
}

Iterator<Node> friends = result.columnAs("friend");

for (Node friend : friends) {
    friend.getProperty("name");

 

Published at DZone with permission of Andreas Kollegger, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)