Hi, FYI, DataNucleus JDO/JPA now has a prototype plugin for persisting normal Java objects to Neo4J; it already supported persistence to RDBMS, ODBMS, XML, JSON, Excel, ODF, MongoDB, HBase, AppEngine, VMForce, Cassandra, LDAP and others so supporting some of the nice graph databases like Neo4J makes a lot of sense.
To use this support you mark your model classes with JDO or JPA metadata (annotations or XML) in the normal way you would for RDBMS (or any other datastore), and write your JDO or JPA persistence code in the normal way. The only difference is that the data is persisted into Neo4j transparently. I've not had time to write up a tutorial yet, but the model and persistence code would be identical to persisting to any other datastore, just that in the definition of the datastore "URL" it would be something like datanucleus.ConnectionURL=neo4j:{my_datastore_location}
- Each object of a class becomes a Node. - Supports datastore identity, application identity, and nondurable identity - Supports versioned objects - Fields of all primitive and primitive wrappers can be persisted - Fields of many other standard Java types can be persisted (Date, URL, URI, Locale, Currency, JodaTime, javax.time, plus many more). - 1-1, 1-N, M-N, N-1 relations are persisted as Relationships (doesn't support Maps currently) - JDOQL/JPQL queries can be performed, and the operators &&, ||, ==, !=, >, >=, <, <= are processed using Cypher, with any remaining syntax handled in-memory currently.
What is likely to be added (hopefully soon)
- Processing of more JDOQL/JPQL syntaxis in Cypher to minimise any in-memory processing - Embedded fields (and querying of embedded fields) - Check for duplicate object identity - Support for using the (Neo4j-assigned) node "id" as a global unique object id
that's great news thanks a lot. What about starting by just blogging the content of this email? We could then re-blog/promote it. Or if you don't have the time we can also blog it on blog.neo4j.org
Thanks a lot for all your work, seems that quite an effort went into the plugin.
Do you have a sample application that you could imagine for showing off the power and ease of the approach?
We can definitely put a link to it onto the resources section of neo4j.org
> Hi,
> FYI, DataNucleus JDO/JPA now has a prototype plugin for persisting normal Java objects to Neo4J; it already supported persistence to RDBMS, ODBMS, XML, JSON, Excel, ODF, MongoDB, HBase, AppEngine, VMForce, Cassandra, LDAP and others so supporting some of the nice graph databases like Neo4J makes a lot of sense.
> To use this support you mark your model classes with JDO or JPA metadata (annotations or XML) in the normal way you would for RDBMS (or any other datastore), and write your JDO or JPA persistence code in the normal way. The only difference is that the data is persisted into Neo4j transparently. I've not had time to write up a tutorial yet, but the model and persistence code would be identical to persisting to any other datastore, just that in the definition of the datastore "URL" it would be something like
> datanucleus.ConnectionURL=neo4j:{my_datastore_location}
> What it currently supports :
> Each object of a class becomes a Node.
> Supports datastore identity, application identity, and nondurable identity
> Supports versioned objects
> Fields of all primitive and primitive wrappers can be persisted
> Fields of many other standard Java types can be persisted (Date, URL, URI, Locale, Currency, JodaTime, javax.time, plus many more).
> 1-1, 1-N, M-N, N-1 relations are persisted as Relationships (doesn't support Maps currently)
> JDOQL/JPQL queries can be performed, and the operators &&, ||, ==, !=, >, >=, <, <= are processed using Cypher, with any remaining syntax handled in-memory currently.
> What is likely to be added (hopefully soon)
> Processing of more JDOQL/JPQL syntaxis in Cypher to minimise any in-memory processing
> Embedded fields (and querying of embedded fields)
> Check for duplicate object identity
> Support for using the (Neo4j-assigned) node "id" as a global unique object id
> Feedback is welcome; go to http://www.datanucleus.org/servlet/forum/listrecentthreads
> Would it be possible to get a link to it put on the Neo4j website or docs in a convenient place?
Since we already had quite a few datastore plugins (allowing copy across of some features), this one actually took 2-3 days to get to its current point.
> Since we already had quite a few datastore plugins (allowing copy across of
> some features), this one actually took 2-3 days to get to its current point.
I've just released v3.1.0-m1 (1st milestone for use with DataNucleus v3.1) of the "datanucleus-neo4j" plugin. It includes all features I mentioned before, plus support for embedded and nested embedded fields and the querying of those fields, support for use of Neo4j node id as a global object identity, a check for duplicated identity on persist, support for JDOQL/JPQL ordering in Cypher, and a few other things.
It ought to be in the Maven central repo tomorrow (1st Aug), and in the meantime can be found in the DataNucleus Maven repo at http://www.datanucleus.org/downloads/maven2/ under group "org.datanucleus"
As for whether it is "production ready", well everyone has their own definition of that :-) but it passes all of my tests for the above functionality so I'd definitely recommend people to try persistence using it, and view Nodes/Relationships in the datastore to gain some confidence/understanding of what it is doing. Obviously the DataNucleus persistence engine + JDO/JPA API implementations are tested over many years so not likely a problem from that side. If some query syntax is not yet implemented to use Cypher it will currently evaluate the query in-memory (hence not efficient) - see the log when running the query. Raise any issues at http://www.datanucleus.org/servlet/jira/browse/NUCNEOFORJ