Thanks to all of those who attended our Intro to Graph Databases on Wednesday, July 13. We had a great turnout and LOADS of fantastic questions!



Below are answers to all questions posed during the webinar. For any other questions, be sure to refer to our user list. We have an incredible community that answers your questions ridiculously fast, no matter what time zone.
  • Can keys/values be first class objects? -@PatrickDurusau
No, keys are just strings, and values can be primitives and strings and arrays of those. You can easily add methods that convert arbitrary objects into these primitives or graph structures at your domain level. Support for JSON types is planned.
  • What is the best Clojure library for Neo4J? Some of them seem quite old, is that because this is a “solved problem” or nobody cares…. -DJ
see here: http://stackoverflow.com/questions/5680976/is-neo4j-a-good-fit-for-clojure
  • How does CAP theorem apply to neo4j? -MK
Neo4j is not partition tolerant. Automatic, domain agnostic graph sharding is still a problem that we have to solve to scale out. (See also the thesis of Alex Averbuch: http://alexaverbuch.blogspot.com/2010/04/me-my-names-alex-im-currently.html)
  • Is Facebook using neo4j for their social graph? -Anonymous
No, but they should :)
  • Can there be multiple relationships between nodes? -Anonymous
Yes as many as you’d like. For most domains one relationshhip is enough as it can be traversed in both directions.
  • So, can Neo both know and love Trinity? -Anonymous
Yes.
  • What does the 4j in neo4j stand for? -Anonymous
“For Java”. As Neo4j is written in Java and provides a native API for the JVM. Other languages can access Neo4j Databases via a RESTful server protocol. There are lots of language bindings for the Neo4j graph database (see: http://wiki.neo4j.org/content/Main_Page#Language_and_framework_bindings)
  • Shouldn’t it be “At depth %d => %sn” in the example? ‘np’ just a type in the slides, I guess. -DM
That would have only worked on unix, since “n” is the char code for linefeed, windows uses carriage return and linefeed for line endings. The format string “%n” will expand to the appropriate line ending for the current platform. Check out http://download.oracle.com/javase/6/docs/api/java/util/Formatter.html#syntax in the table called “Conversions” for more details.
  • Is there a performance penalty if there is a large number of nodes linked to a single node or does this not matter? -DM
The number of connections of a node (nodes with many (> 100 000) connections are sometimes called supernodes) matters. Mostly when loading them initially in the cache (cold caches). The Neo4j team is currently working on improving that aspect.
  • What if Trinity was in love with Morpheus? Will Trinity’s node be returned because she only has the outgoing “LOVES” relationship? There was no check if the node the relationship points to is the start node. -BP
Yes. Any node in the traversed graph (reachable through KNOWS relationships from the start node) that has an outgoing LOVES relationship would be returned.
  • If possible, can you please take one simple example and explain the difference in representation between connected database and Graph database. -SR??
What is a connected databases?
  • Is the Cypher query language implemented in the programming language like LINQ or is it String-based? -US
Cypher is implemented in Scala using the parser-combinator library of scala. This parser is string based, but renders to a object based expression tree which is then evaluated using graph matching and several filtering and aggregation steps.
  • Are there other Traversers that return a set of Relations rather than a set of Nodes? -US
Yes, by using our more advanced traversal framework. See our documentation about this traversal framework and its JavaDoc API documentation.
  • Seems you have reinvented the hierarchical data model that was used in the late 60′s, 70′s and early 80′s and was then replaced by the relational model. -AG
Good point. Graph databases such as Neo4j have a lot in common with the navigational databases of old. Even back then the navigational databases often outperformed relational databases. There are thus two questions that you ought to ask: why did the relational databases take over the market? and what has changed since then?

The navigational databases back then were a pain to work with. They lacked good abstractions for working with the data, and required trained specialists to work with. Relational databases took over the market because of their structured query language, this meant that any developer could use relational databases.

A lot has changed since that time. The biggest game changer has been the advent of object oriented programming. Objects gives us the abstraction we need for making graph databases accessible as a pattern to work with for anyone. We are of course working on making Neo4j even more user friendly, with efforts such as Cypher. Having the foundation of a clear object model for the graph makes such efforts possible, and make navigational databases interesting again.
  • Is the traversal asynchronous? -NV
Right now traversals are synchronous. And so far they were fast enough. But we’ve been thinking about providing parallel traversals.
  • How do I get the node that I want to work with from the Graph DB ? I mean how do I get i.e. Mr Andersson? -RE
You can look up the start nodes for your traversal using the integrated indexing framework (e.g. by name) or you can create “category” nodes that aggregate nodes of a certain type, tag or category and link the category nodes to the root node and start your traversal from there.
  • How can you deal with versions of graphs? Or, just versions of key-value properties, for example, if you wanted to keep the date a relationship or a specific property on a node changed while keep the old value (the history, or last version)?
There are several ways of dealing with that, either by cloning parts of the graph or by putting those relationships into array based properties. One of our engineers created a proof of concept for that (https://github.com/dmontag/neo4j-versioning). You could also look into the theory of clojure’s persistent data structures for creating such a versioning approach not just for properties but for relationships or whole subgraphs.  

Keywords:  


5 Comments

Anonymous says:

at 40:30 in the video, will that traverser traverse all KNOWS relationships before it stops? even though only one LOVES was found ?<br />that seems like a sound yes …<br />Then maybe, can we make a traverser that parses all LOVES relationships ? seems less operations to be done, at least in that example

Anonymous says:

why did my anon comment disappear after 10 seconds? that explains why there are no comments :P

Tysana says:

@40:30, he wanted to find all people who ARE friends who love SOMEBODY. If you wanted to find all people who loved NEO, you could search all LOVES relationships on the INCOMING direction.<br /><br />The results of the two queries could be drastically different, however (if, say, Cypher loved himself).

Anonymous says:

please tell the procedure how to connect an database with neo4j a graph database?

You could look at http://docs.neo4j.org/chunked/snapshot/index.html to get started with Neo4j and the Neo4j Server …

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Popular Graph Topics

Archives

Have a Graph Question?

Reach out and connect with the Neo4j staff.
Stackoverflow
Contact Us