Re: [Neo4j] Transaction and REST API
Hi Ido, [off topic for folks who are just interested in graphs, here be REST things] My question is Should I have a generic Transaction resource to allow atomic changes to any resource in my service which represent data? No, I don't think so (unless you mean a transaction in the commercial sense). Instead I still think I should be able to interact with a Transfer resource which under the covers might (or might not) need some kind of coordination (similar to 2pc). If you want to go with that then I suggest both services simple broadcast the activities they considered completed (e.g. using an atom feed of events). This is a superior solution to that initially suggested by the (flawed IMHO) REST-* people. However I really think that hypermedia wins out here. Instead of a distributed 2 phase transaction, why not do this instead: 1. Client knows the source and destination account URIs 2. Client PUTs a transfer representation to a transfer resource related to the source account, that representation contains the URI of the destination account resource 3. The source account service now does a single-phase PUT to the destination resource. Any transactions are now under the covers, bounded by a single, repeatable, idempotent PUT. Sweet. Jim ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j REST API and JAXB
Hi Christoper, Peter, I wonder if this is some horrid coupling creeping in since AFAIK we also use Jackson for JSON production. Perhaps its own eccentricities are escaping our service boundary. Anyone know if Jackson is/isn't very compliant? Jim On 29 Dec 2010, at 23:41, Peter Neubauer wrote: Very cool Christopher, Tis looks like a perfect way to test the server. As we are considering using more scale in at least our testing, we really should look into this for easing web testing to start with! I guess Andres and Andreas will be all over this after New Year :) /Peter On Wednesday, December 29, 2010, Christopher Schmidt fakod...@googlemail.com wrote: I am answering my own thread here, just in case someone is interested... I solved my unmarshaling issue with Neo4j REST, JAXB and Jersey with using the Jackson JSON processor (http://jackson.codehaus.org/) instead of Jersey JSON. This makes it easy to write a POPO representation of Neo4j's REST *objects*. I implemented some of them (in Scala), see here: https://github.com/FaKod/SJersey/tree/master/src/test/scala/org/sjersey/test/json/neo4jstuff The usage is rather simple. I tested it with a *specs* test class here: https://github.com/FaKod/SJersey/blob/master/src/test/scala/org/sjersey/test/AccessTest.scala Although some idea files are checked in, it should be able to check it out with maven2 (pom.xml). I have written a blog post about this POC herehttp://blog.fakod.eu/2010/12/10/yet-another-trya-rest-client-with-jersey-and-scala/, as I said: Just in case someone is interested to use Scala, Jersey and the Neo4j REST server ;) Christopher On Wed, Dec 8, 2010 at 4:09 PM, Christopher Schmidt fakod...@googlemail.com wrote: I have a little spare time ;-) and I try to create a/another very smart REST client DSL in Scala. For testing and test data I am using the Neo4j Server from here: http://blog.neo4j.org/2010/04/neo4j-rest-server-part1-get-it-going.html Client library is Jersey, JSON marshaling and unmarshaling lib is JAXB. The current client Scala code is: rest { implicit s = val traversalPath = node/3/traverse/path.POST[JSONArray] = PathRequest(order = depth first, max_depth = 4, uniqueness = node path) println(Array length: + traversalPath.length) // prints 2 } The above JSONArray works fine, but if I use Java objects (as XmlRootElement) I get unmarshaling exceptions. It would be helpful If there is someone out there who already created some JAXB objects for Neo4j... Christopher On Wed, Dec 8, 2010 at 3:56 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Christopher, are you trying to build your own server, or are you using Neo4j Server? The REST API is now part of the server component, we are right now defining a mechanism to mount your own server extensions without breaking the REST hypermedia of the existing API. What are you trying to do? Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Wed, Dec 8, 2010 at 3:52 PM, Christopher Schmidt fakod...@googlemail.com wrote: Hi all, is anyone using the REST interface and JAXB? I have some problems with the traversal response of POST call to /node/3/traverse/path which returns: [ { start : http://localhost:/node/3;, nodes : [ http://localhost:/node/3;, http://localhost:/node/1; ], length : 1, relationships : [ http://localhost:/relationship/6; ], end : http://localhost:/node/1; }, { start : http://localhost:/node/3;, nodes : [ http://localhost:/node/3;, http://localhost:/node/2; ], length : 1, relationships : [ http://localhost:/relationship/2; ], end : http://localhost:/node/2; -- Christopher twitter: @fakod blog: http://blog.fakod.eu ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j REST API and JAXB
Hi Jim, all I can say is, that I was not able to unmarshal the anonymous array containing a anonymous object returned from a POST to traverse/path. All I got was a ArrayOutOfBounds exception (I used the maven jersey-json dependency). Maybe just an issue with the combination of Jersey and JAXB. Normally this code should work: GenericTypeCollectionTraverse genericType = new GenericTypeCollectionTraverse() {}; CollectionTraverse ja = webResource.path(node/3/traverse/path) .accept(MediaType.APPLICATION_JSON) .type(MediaType.APPLICATION_JSON) .post(genericType, {\order\:\depth first\, \max depth\: 1}); for this JAXB Entity: @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement public class Traverse { public String start; . . . } And I did not get any answer from the Jersey users list. Java.net is currently down once again :-( so I can not post the link to my question. Christopher On Thu, Dec 30, 2010 at 5:15 PM, Jim Webber j...@neotechnology.com wrote: Hi Christoper, Peter, I wonder if this is some horrid coupling creeping in since AFAIK we also use Jackson for JSON production. Perhaps its own eccentricities are escaping our service boundary. Anyone know if Jackson is/isn't very compliant? Jim On 29 Dec 2010, at 23:41, Peter Neubauer wrote: Very cool Christopher, Tis looks like a perfect way to test the server. As we are considering using more scale in at least our testing, we really should look into this for easing web testing to start with! I guess Andres and Andreas will be all over this after New Year :) /Peter On Wednesday, December 29, 2010, Christopher Schmidt fakod...@googlemail.com wrote: I am answering my own thread here, just in case someone is interested... I solved my unmarshaling issue with Neo4j REST, JAXB and Jersey with using the Jackson JSON processor (http://jackson.codehaus.org/) instead of Jersey JSON. This makes it easy to write a POPO representation of Neo4j's REST *objects*. I implemented some of them (in Scala), see here: https://github.com/FaKod/SJersey/tree/master/src/test/scala/org/sjersey/test/json/neo4jstuff The usage is rather simple. I tested it with a *specs* test class here: https://github.com/FaKod/SJersey/blob/master/src/test/scala/org/sjersey/test/AccessTest.scala Although some idea files are checked in, it should be able to check it out with maven2 (pom.xml). I have written a blog post about this POC here http://blog.fakod.eu/2010/12/10/yet-another-trya-rest-client-with-jersey-and-scala/ , as I said: Just in case someone is interested to use Scala, Jersey and the Neo4j REST server ;) Christopher On Wed, Dec 8, 2010 at 4:09 PM, Christopher Schmidt fakod...@googlemail.com wrote: I have a little spare time ;-) and I try to create a/another very smart REST client DSL in Scala. For testing and test data I am using the Neo4j Server from here: http://blog.neo4j.org/2010/04/neo4j-rest-server-part1-get-it-going.html Client library is Jersey, JSON marshaling and unmarshaling lib is JAXB. The current client Scala code is: rest { implicit s = val traversalPath = node/3/traverse/path.POST[JSONArray] = PathRequest(order = depth first, max_depth = 4, uniqueness = node path) println(Array length: + traversalPath.length) // prints 2 } The above JSONArray works fine, but if I use Java objects (as XmlRootElement) I get unmarshaling exceptions. It would be helpful If there is someone out there who already created some JAXB objects for Neo4j... Christopher On Wed, Dec 8, 2010 at 3:56 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Christopher, are you trying to build your own server, or are you using Neo4j Server? The REST API is now part of the server component, we are right now defining a mechanism to mount your own server extensions without breaking the REST hypermedia of the existing API. What are you trying to do? Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Wed, Dec 8, 2010 at 3:52 PM, Christopher Schmidt fakod...@googlemail.com wrote: Hi all, is anyone using the REST interface and JAXB? I have some problems with the traversal response of POST call to /node/3/traverse/path which returns: [ { start : http://localhost:/node/3;, nodes : [ http://localhost:/node/3;, http://localhost:/node/1; ], length : 1, relationships : [ http://localhost:/relationship/6; ], end : http://localhost:/node/1; }, { start :
Re: [Neo4j] Transaction and REST API
OK, I think I understand what you are saying. Let's try to do an example in the field of graph (after all that's why were here :) neo4j is generic graph database. One of the interesting usage of graph is to give meaning to a node by the relations it has, like the category and product samplehttp://blog.neo4j.org/2010/03/modeling-categories-in-graph-database.html . In that case when I want to add new product I need to do 2 things: 1. Create new node with the name of the product 2. Create new link of type PRODUCT from the category to the new node How will you go about implement such change using REST interface? Another example in the same area is suppose I want to change 2 links, say change a category from been sub-category to another sub-category and let's say it involve delete one link and create another. I'm trying to see if there is a generic way to implement such things of changing multiple resources in generic manager in REST or is it simply to application (or service) specific. Thank you, Ido On Thu, Dec 30, 2010 at 6:14 PM, Jim Webber j...@neotechnology.com wrote: Hi Ido, [off topic for folks who are just interested in graphs, here be REST things] My question is Should I have a generic Transaction resource to allow atomic changes to any resource in my service which represent data? No, I don't think so (unless you mean a transaction in the commercial sense). Instead I still think I should be able to interact with a Transfer resource which under the covers might (or might not) need some kind of coordination (similar to 2pc). If you want to go with that then I suggest both services simple broadcast the activities they considered completed (e.g. using an atom feed of events). This is a superior solution to that initially suggested by the (flawed IMHO) REST-* people. However I really think that hypermedia wins out here. Instead of a distributed 2 phase transaction, why not do this instead: 1. Client knows the source and destination account URIs 2. Client PUTs a transfer representation to a transfer resource related to the source account, that representation contains the URI of the destination account resource 3. The source account service now does a single-phase PUT to the destination resource. Any transactions are now under the covers, bounded by a single, repeatable, idempotent PUT. Sweet. Jim ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Neo4j 1.2 is released
Happy new year — happy new Neo4j version! The Neo4j team is happy to announce version 1.2 of the Neo4j graph database. Building on the line of milestone releases of Neo4j, version 1.2 contains only a few minor bug fixes over 1.2.M06, and should be very stable. The official announcement has been posted here: http://www.dzone.com/links/neo4j_12_final_prtporter.html If you like this version, please vote for the article on DZone, and share the link with your friends and colleagues. We would like to thank everyone on this mailing list, and all of our customers, who provided the bug reports, feedback, suggestions and patches that made this release what it is. You've already given us a lot of great ideas for the road ahead, but keep them coming, let's make Neo4j even better together! Your next stop, for downloading this version of Neo4j, is: http://neo4j.org/download The main new features in Neo4j 1.2 compared to Neo4j 1.1 are: * The Neo4j Server The Neo4j standalone server builds upon the RESTful API that was pre-released for Neo4j 1.1. The server provides a complete stand alone Neo4j graph database experience, making it easy to access Neo4j from any programming language or platform. Some of you have already provided great client libraries for languages such as Python, Ruby, PHP, the .Net stack and more. Links and further information about client libraries can be found at: http://www.delicious.com/neo4j/drivers * Neo4j High Availability The High Availability feature of Neo4j provides an easy way to set up a cluster of graph databases. This allows for read scalability and tolerates faults in any of the participating machines. Writes are allowed to any machine, but are synchronized with a slight delay across all of them. High Availability in Neo4j is still in quite an early stage of its evolution and thus still have a few limitations. While it provides scalability for read load, write operations are slightly slower. Adding new machines to a cluster still requires some manual work, and very large transactions cannot be transmitted across machines. These limitations will be addressed in the next version of Neo4j. Some other noteworthy changes include: * Additional services for the Neo4j kernel can now be loaded during startup, or injected into a running instance. Examples of such additional services are the Neo4j shell server and the Neo4j management interface. * Memory footprint and read performance has been improved. * A new cache implementation has been added for high load, low latency workloads. * A new index API has been added that is more tightly integrated with the database. This new index API supports indexing relationships as well as nodes, and also supports indexing and querying multiple properties for each node or relationship. The old index API has been deprecated but remains available and will continue to receive bug fixes for a while. * The Neo4j shell supports performing path algorithm queries. * Built in automatic feedback to improve future versions of Neo4j. See: http://blog.neo4j.org/2010/10/announcing-neo4j-12m01-and-focus-on.html Last but not least all known issues have been fixed. If you want more details, please read the change log and/or the announcements for the previous milestone releases. Happy hacking, and a happy new year 2011! - the Neo4j team, through -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j 1.2 is released
That's great ! A Happy New Year to all the Neo4j team members ! Gian Luca Farina Perseu 21Style / www.21-style.com On Thu, Dec 30, 2010 at 10:30 PM, Tobias Ivarsson tobias.ivars...@neotechnology.com wrote: Happy new year — happy new Neo4j version! The Neo4j team is happy to announce version 1.2 of the Neo4j graph database. Building on the line of milestone releases of Neo4j, version 1.2 contains only a few minor bug fixes over 1.2.M06, and should be very stable. The official announcement has been posted here: http://www.dzone.com/links/neo4j_12_final_prtporter.html If you like this version, please vote for the article on DZone, and share the link with your friends and colleagues. We would like to thank everyone on this mailing list, and all of our customers, who provided the bug reports, feedback, suggestions and patches that made this release what it is. You've already given us a lot of great ideas for the road ahead, but keep them coming, let's make Neo4j even better together! Your next stop, for downloading this version of Neo4j, is: http://neo4j.org/download The main new features in Neo4j 1.2 compared to Neo4j 1.1 are: * The Neo4j Server The Neo4j standalone server builds upon the RESTful API that was pre-released for Neo4j 1.1. The server provides a complete stand alone Neo4j graph database experience, making it easy to access Neo4j from any programming language or platform. Some of you have already provided great client libraries for languages such as Python, Ruby, PHP, the .Net stack and more. Links and further information about client libraries can be found at: http://www.delicious.com/neo4j/drivers * Neo4j High Availability The High Availability feature of Neo4j provides an easy way to set up a cluster of graph databases. This allows for read scalability and tolerates faults in any of the participating machines. Writes are allowed to any machine, but are synchronized with a slight delay across all of them. High Availability in Neo4j is still in quite an early stage of its evolution and thus still have a few limitations. While it provides scalability for read load, write operations are slightly slower. Adding new machines to a cluster still requires some manual work, and very large transactions cannot be transmitted across machines. These limitations will be addressed in the next version of Neo4j. Some other noteworthy changes include: * Additional services for the Neo4j kernel can now be loaded during startup, or injected into a running instance. Examples of such additional services are the Neo4j shell server and the Neo4j management interface. * Memory footprint and read performance has been improved. * A new cache implementation has been added for high load, low latency workloads. * A new index API has been added that is more tightly integrated with the database. This new index API supports indexing relationships as well as nodes, and also supports indexing and querying multiple properties for each node or relationship. The old index API has been deprecated but remains available and will continue to receive bug fixes for a while. * The Neo4j shell supports performing path algorithm queries. * Built in automatic feedback to improve future versions of Neo4j. See: http://blog.neo4j.org/2010/10/announcing-neo4j-12m01-and-focus-on.html Last but not least all known issues have been fixed. If you want more details, please read the change log and/or the announcements for the previous milestone releases. Happy hacking, and a happy new year 2011! - the Neo4j team, through -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Neo4j 1.2 is released
Congratulations! Now the Neo4j team has reached a earned rest. Happy New Year! On Thu, Dec 30, 2010 at 22:30, Tobias Ivarsson tobias.ivars...@neotechnology.com wrote: Happy new year — happy new Neo4j version! The Neo4j team is happy to announce version 1.2 of the Neo4j graph database. Building on the line of milestone releases of Neo4j, version 1.2 contains only a few minor bug fixes over 1.2.M06, and should be very stable. The official announcement has been posted here: http://www.dzone.com/links/neo4j_12_final_prtporter.html If you like this version, please vote for the article on DZone, and share the link with your friends and colleagues. We would like to thank everyone on this mailing list, and all of our customers, who provided the bug reports, feedback, suggestions and patches that made this release what it is. You've already given us a lot of great ideas for the road ahead, but keep them coming, let's make Neo4j even better together! Your next stop, for downloading this version of Neo4j, is: http://neo4j.org/download The main new features in Neo4j 1.2 compared to Neo4j 1.1 are: * The Neo4j Server The Neo4j standalone server builds upon the RESTful API that was pre-released for Neo4j 1.1. The server provides a complete stand alone Neo4j graph database experience, making it easy to access Neo4j from any programming language or platform. Some of you have already provided great client libraries for languages such as Python, Ruby, PHP, the .Net stack and more. Links and further information about client libraries can be found at: http://www.delicious.com/neo4j/drivers * Neo4j High Availability The High Availability feature of Neo4j provides an easy way to set up a cluster of graph databases. This allows for read scalability and tolerates faults in any of the participating machines. Writes are allowed to any machine, but are synchronized with a slight delay across all of them. High Availability in Neo4j is still in quite an early stage of its evolution and thus still have a few limitations. While it provides scalability for read load, write operations are slightly slower. Adding new machines to a cluster still requires some manual work, and very large transactions cannot be transmitted across machines. These limitations will be addressed in the next version of Neo4j. Some other noteworthy changes include: * Additional services for the Neo4j kernel can now be loaded during startup, or injected into a running instance. Examples of such additional services are the Neo4j shell server and the Neo4j management interface. * Memory footprint and read performance has been improved. * A new cache implementation has been added for high load, low latency workloads. * A new index API has been added that is more tightly integrated with the database. This new index API supports indexing relationships as well as nodes, and also supports indexing and querying multiple properties for each node or relationship. The old index API has been deprecated but remains available and will continue to receive bug fixes for a while. * The Neo4j shell supports performing path algorithm queries. * Built in automatic feedback to improve future versions of Neo4j. See: http://blog.neo4j.org/2010/10/announcing-neo4j-12m01-and-focus-on.html Last but not least all known issues have been fixed. If you want more details, please read the change log and/or the announcements for the previous milestone releases. Happy hacking, and a happy new year 2011! - the Neo4j team, through -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Javier de la Rosa http://versae.es ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user