[ANN] AnormCypher 0.2.0 release (Scala)

72 views
Skip to first unread message

Wes Freeman

unread,
Nov 13, 2012, 10:05:35 AM11/13/12
to ne...@googlegroups.com
AnormCypher is a Cypher-oriented Scala library for Neo4j Server (REST). The goal is to provide a great API for calling arbitrary Cypher and parsing out results, with an API inspired by Anorm from the Play! Framework.


I guess it didn't take as long as I thought it would to hit my goal for 0.2, supporting the .as() functionality in the pattern matching section of the readme. I also managed to clean up the bugs for 0.1.

I've pushed 0.2.0 out to my repo.

Wes

Wes Freeman

unread,
Nov 19, 2012, 9:14:49 AM11/19/12
to ne...@googlegroups.com
I'm glad you like it. Please post any issues on github--as it's brand new, I'm still getting a chance to "dogfood" it myself. If you see anything that could work better that isn't already listed, please let us know.

Our next step is actually to make a play plugin to simplify integration with play--not that it's too bad, already having a singleton and being in SBT. :)

Wes

On Mon, Nov 19, 2012 at 8:23 AM, Joao Da Silva <jo...@codedefinition.com> wrote:
Thanks Wes, 

I am working on play scala project with neo4j and it this is an awesome piece of work.

Congrats and all the best

--
 
 

Joao Da Silva

unread,
Nov 19, 2012, 12:09:44 PM11/19/12
to ne...@googlegroups.com
Wes,


I will be giving you feedback and follow the github project, i will also write a blog post to help spread the word ;-). 

Quick question why did you choose dispatch ? as i am having great fun and success with spray.io the client lib and would like to know you opinion, thanks a lot.

Wes Freeman

unread,
Nov 19, 2012, 12:34:24 PM11/19/12
to ne...@googlegroups.com
Dispatch seemed easier to get into, although I don't particularly like their choice to use random (at least, they seem mostly random to me) symbols as methods/operators: http://www.flotsam.nl/dispatch-periodic-table.html (this is one of my Scala pet peeves--just because you can do this, doesn't mean you should: give random operator overloading to a Java dev and they tend to get excited because they've never had it before, and go way overboard). Maybe I should give spray.io a go--our current Dispatch usage is limited to a single rather simple method, so it could probably be ported rather easily (which might be a good idea before getting into streaming).

While on the topic of dependencies, I'm also somewhat disappointed with Jerkson returning me java.util collections, but it's the only JSON parser I found willing to easily parse Map[String, Any] and give me a Map (java.util.LinkedHashMap) back. Getting native Scala collections and and easily parsing Maps (arbitrary JSON) would be great, but I tried several scala json libraries (lost a couple of hours to each one without success--admittedly, not a huge amount of effort was spent), including: sjson, json4s, dispatch.json, and jackson-module-scala. If any scala guys know a great way to do that, I'll buy you a beer next time we're in the same city. :)

Also, I accept pull requests!

Wes

--
 
 

Joao Da Silva

unread,
Nov 20, 2012, 5:13:15 AM11/20/12
to ne...@googlegroups.com
I chose spray.io for my project because of it's akka, async and no extra dependencies required(all are within spray libs), for JSON i mostly like lift-json and spray-client itself has a nice JSON integration built in. My self i am not a fan of all the extreme usage of symbols on some libraries. One issue thing i see that may not suit AnormCypher may be due to the spray-client lack of HTTP Streaming.

HTTP streaming (i.e. chunked transfer encoding) is not yet fully supported on the spray-clientlevel (even though the underlying spray-can HttpClient does support it)
 

One other thing i like about spray it that is very fast and consumes fewer resources.

Is it not possible to create a scala implicit to do the conversion  Map[String, Any] to Map (java.util.LinkedHashMap) ?

Anyway i really like this project ;-)
Good luck

Wes Freeman

unread,
Nov 20, 2012, 10:43:12 AM11/20/12
to ne...@googlegroups.com
Ahhh. Good to know about spray.io streaming. I think it's actually a similar situation with Dispatch (underlying lib supports it)--haven't thoroughly looked into it. Might need to dig deep to get that to work.

The issue isn't converting to a Map, it's the JSON parsing specification. You have to specify how you want to parse the JSON, usually via a case class or some other specification. The problem is that the data returned by Cypher is a map containing an array of arbitrary data. It actually would be nice if the REST server told us what the types of the fields were (in addition to the column names)--which would enable the Anorm metadata-based type checking instead of attempting to cast to a type and throwing errors when it fails. Not that big of a deal, but it might simplify the JSON parsing, also.

Wes

--
 
 

Reply all
Reply to author
Forward
0 new messages