I have also built an implementation of this on top of the rest of Py2neo, and I /love/ how it simplifies the rest of my code. It's similar to the py2neo version of it, but is simpler to use and includes transactions. Source for it is here:
http://hg.linux-ha.org/assimilation/file/tip/cma/store.py It needs a little work to do everything one might need - which I'll no doubt get around to ;-). It also includes transactional semantics through the REST interface. I haven't compared it to the spring implementation. You basically create python objects (using the interface), and from then on, you only worry about your objects (not Neo4j), then when you're ready, you commit the transaction you created. I think this was also included in a talk I gave at GraphConnect a couple of years ago. The basic idea is like this: obj = store.load_or_create(constructor parameters) # instead of calling a constructor obj.attribute = value # and so on store.commit() The only real oddity that the object can't set any attributes that Neo4j won't support in a node. That can be pretty restrictive, but not much I can do about that... If you want to set a temporary attribute that I won't try and write to the database, start it with an _ in it's name. Of course there are abilities to query, and create relationships, and so on. The most surprising thing is a Neo4j node can't have an empty array as an attribute. It can be None, or it can be an array of ints or strings, but it can't be empty... Email me directly if you have questions. On 05/20/2015 10:49 AM, Gelli Ravikumar wrote: > Hello to all, > > I am looking for the concept of how to develop a Object-Graph mapping > (OGM) as an analogous to Object-Relational mapping (ORM). > > However, I have came across some information from these links: > > 1. http://py2neo.org/2.0/ext/ogm.html > 2. http://nigelsmall.com/py2neo/1.6/ogm/ > 3. http://www.slideshare.net/neo4j/ogm-withsdn30 > 4. https://vimeo.com/80618455 > 5. > https://github.com/spring-projects/spring-data-neo4j/tree/4.0/neo4j-ogm/src/main/java/org/neo4j/ogm > 6. > > But, if there are any other references to get to know a deeper > understanding of OGM, please post them here. > > Also, if there are any comparisons for ORM and OGM, please let me know. > > Thanks so much for your reply! > > > > > > > > > -- > with Regards > ---------------------------------------------------- > Gelli Ravikumar > Research Scholar (Ph.D), > Field Computations Lab, > Dept. of Electrical Engineering, > IIT Bombay, Powai, Mumbai 400076 > Ph: 022-2576 4424, 089 765 983 96 > My publications: http://tinyurl.com/gelliPapers > > Gandhian Young Technological Innovation Award - 2013 > POSOCO Power System Award: PPSA - 2013 > IITB PhD Executive Member - 2013-14 > IITB SARC Core Technical Member - 2014-15 > > > -- > You received this message because you are subscribed to the Google > Groups "Neo4j" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout. -- Alan Robertson / CTO [email protected] <mailto:[email protected]>/ +1 303.947.7999 Assimilation Systems Limited http://AssimilationSystems.com Twitter <https://twitter.com/ossalanr> Linkedin <https://www.linkedin.com/in/alanr> skype <https://htmlsig.com/skype?username=alanr_unix.sh> -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
