Re: [Neo4j] Using the REST neo4j

2010-09-14 Thread Mattias Persson
I see your point and I think that it'd be a good idea to have the
ability to build/download a .war file for convenience, in addition to
the current format. I don't really see any arguments against it at
least. And it should be a fairly easy task to create such an assembly.


2010/9/10, Alexandru Popescu ☀ the.mindstorm.mailingl...@gmail.com:
 On Tuesday, September 7, 2010, Jacob Hansson ja...@voltvoodoo.com wrote:
 2010/9/6 Alexandru Popescu ☀ the.mindstorm.mailingl...@gmail.com

 On Monday, September 6, 2010, Jim Webber j...@webber.name wrote:
  Hi Alex,
 
  While I still can achieve all these with the current packaging, it
  feels more hacky: I need to create a new Jetty6BasedWebServer or
  modify the existing one to enhance it with my own stuff. Each change
  would require compiling and repackaging the whole neo4j-rest.
  Definitely not as easy as dropping in my own jar and a new web.xml.
 
  That's an interesting point. In a sense, the neo-rest package is Neo's
 REST package.

 Interesting... My main question is: what exactly is this package
 offering to the end user in the current form? IMO it cannot be an
 off-the-shelf product as there is no security. It is not a library
 either, as extending it is not so easy. Basically, and without any
 intention to harm any feelings, it looks like one of those dummy web
 UI interface to X. And I'd say it has much more potential than that!



 Jacob,

 I must confess I'm totally confused by your comments below.

 I've always seen it as the beginnings of a proper stand-alone neo4j
 server.

 If it is the beginning, then what comes next? And more importantly
 from whom? Basically my proposal was meant to make things easier for
 people to built on top of it, so I'm not really sure how you see the
 continuation of it.

 A REST/JSON API to Neo4j opens up for remote clients in any language, and
 would be an important part in matching offerings from other database
 vendors. While extendability is a great thing, building it as a library
 and/or packaging it as a WAR makes it very java-centric.


 Currently the neo4j-rest is distributed as a java application. So it
 is java-centric. What makes it attractive is that it allows using the
 HTTP protocol. Providing neo4j-rest as both a self contained app and
 as a web app will give you exactly the same benefits, with additional
 freedom on choosing how to use it, what servers to deploy it too, etc.

 Like you say, there is no security, and I agree it is currently the main
 culprit stopping neo4j REST from production use. This can of course be
 offset with firewalling etc, but I couldn't agree more of the importance
 of
 a proper security layer.


 Security was used as a basic example of things that could be much
 easier to be added on top of the neo4j-rest if provided in a simpler
 format. As you probably know already firewalls will give you at most a
 very basic sort of authentication, but nothing else.

 As far as UI interface to X goes, the area to focus on I think is the
 JSON
 part of the API. With that, a UI can be built in any language. Take a look
 at http://github.com/neo4j/webadmin for a more powerful browsing UI for
 neo4j REST.


 I think you mis-read my post. I'm not looking for a nice UI, but
 rather for a basis to further build REST services on top of a neo4j
 db. As Jim mentioned in his posts, currently neo4j-rest is just
 exposing the basics of a neo4j db.

 :- alex



  However the notion of just letting end users write their own code
  hadn't
 occurred at least to me. I guess I always assumed that if users really
 wanted a domain specific API then they'd write their own. But the notion
 of
 user-registered filters (at least) is pretty sensible.
 

 I think your initial assumption makes a lot of sense. But why would
 one have to duplicate all the work when this could provide him not
 only with a good example, but a common basis for a complete solution.
 I'm looking at it from the perspective of a DB vizualization tool:
 what's in there offers you the default view. Next you could build your
 own views, etc. You could even build your complete application using
 it.

 Best thing is that I don't even think it is difficult to get it being
 more a matter of packaging than anything else. All would be needed:

 - a web.xml file with some configuration options in it (db location)
 - providing better access to the GraphDatabaseService (see my previous
 suggestion) and other common shared resources (IndexService, etc)
 - a different final package in form of a war
 - done

 Does it make sense to you?

 :- alex

  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




 --
 Jacob Hansson
 Phone: +46 (0) 763503395
 Twitter: @jakewins
 ___
 Neo4j 

Re: [Neo4j] Timeline class in Neo Index

2010-09-14 Thread Mattias Persson
2010/8/14 Rick Bullotta rick.bullo...@burningskysoftware.com

 Hi, all.



 Has anyone used the Timeline capabilities for a searchable set of
 timestamped nodes?  I was about to write my own custom linked list
 implementation using relationships w/a timestamp property, and came across
 this.  I have a need to handle queries similar to those provided by the
 TimelineIndex with a few additions:



 -  I want to be able to limit the # of nodes retrieved to a maximum
 of n


It's just a matter of iterating over n nodes... the iterating is done
lazily anyway.



 -  I need to be able to retrieve nodes either in increasing
 timestamp or decreasing timestamp order


That could be an easy patch... look into the code and see if that can be
done in an easy way!





 I was planning on either building a new set of classes based on Timeline,
 extending Timeline, or starting from scratch.  Any insights/suggestions
 welcomed.



 Best,



 Rick



 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




-- 
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] neo4j REST server configuration

2010-09-14 Thread Mattias Persson
Is this resolved? Take a look at
http://wiki.neo4j.org/content/Getting_Started_REST#Configure_amount_of_memoryotherwise

2010/8/7 Mohit Vazirani mohi...@yahoo.com

 Hi,

 I'm running the standalone neo4j REST server on a 64 bit linux machine with
 64GB
 RAM and am trying to configure the following memory settings through the
 wrapper.conf file:

 wrapper.java.initmemory=16144
 wrapper.java.maxmemory=16144

 However when I restart the server, JMX shows me the following VM arguments:

 -Dcom.sun.management.jmxremote -Xms4096m -Xmx4096m -Djava.library.path=lib
 -Dwrapper.key=q8W6vP8LS9mj0ekz -Dwrapper.port=32000
 -Dwrapper.jvm.port.min=31000
 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=27943 -Dwrapper.version=3.2.3
 -Dwrapper.native_library=wrapper -Dwrapper.service=TRUE
 -Dwrapper.cpu.timeout=10
 -Dwrapper.jvmid=1

 Another unrelated issue is that JMX Mbeans shows configuration attributes
 as
 unavailable when I attach to the REST wrapper.

 The reason I am looking into modifying the configuration is that my client
 servers seem to be timing out. The server cannot handle more than 5
 concurrent
 transactions, so I want to tweak the heap size and see if that helps.

 Thanks,
 ~Mohit




 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




-- 
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Timeline class in Neo Index

2010-09-14 Thread rick.bullotta
   Hi, Mattias.



   I ended up writing some logic in our domain objects to handle this.
   Basically we keep the timestamp nodes in buckets for rapid traversal
   to the closest nodes for a given time range (on an hourly or daily
   bucket), then within each bucket the nodes are managed via a first
   and last relationship from the bucket node, and next relationships
   from the time series data nodes.  Since 99.9% of insertion is at the
   end of the list, linear searches for insertion are fairly rare.  Thanks
   to the ability of Neo to traverse a relationship in either direction,
   we were able to implement a doubly linked list without double
   links. ;-)  This allowed us to rapidly retrieve data in ascending
   (oldest) or descending (newest) order without requiring post-processing
   to sort the data.



   In any case, performance seems really good.



   Best,



   Rick





    Original Message 
   Subject: Re: [Neo4j] Timeline class in Neo Index
   From: Mattias Persson [1]matt...@neotechnology.com
   Date: Tue, September 14, 2010 4:58 am
   To: Neo4j user discussions [2]u...@lists.neo4j.org
   2010/8/14 Rick Bullotta [3]rick.bullo...@burningskysoftware.com
Hi, all.
   
   
   
Has anyone used the Timeline capabilities for a searchable set of
timestamped nodes? I was about to write my own custom linked list
implementation using relationships w/a timestamp property, and came
   across
this. I have a need to handle queries similar to those provided by
   the
TimelineIndex with a few additions:
   
   
   
- I want to be able to limit the # of nodes retrieved to a maximum
of n
   
   It's just a matter of iterating over n nodes... the iterating is done
   lazily anyway.
   
- I need to be able to retrieve nodes either in increasing
timestamp or decreasing timestamp order
   
   That could be an easy patch... look into the code and see if that can
   be
   done in an easy way!
   
   
   
I was planning on either building a new set of classes based on
   Timeline,
extending Timeline, or starting from scratch. Any
   insights/suggestions
welcomed.
   
   
   
Best,
   
   
   
Rick
   
   
   
___
Neo4j mailing list
[4]u...@lists.neo4j.org
[5]https://lists.neo4j.org/mailman/listinfo/user
   
   --
   Mattias Persson, [[6]matt...@neotechnology.com]
   Hacker, Neo Technology
   [7]www.neotechnology.com
   ___
   Neo4j mailing list
   [8]u...@lists.neo4j.org
   [9]https://lists.neo4j.org/mailman/listinfo/user

References

   1. mailto:matt...@neotechnology.com
   2. mailto:user@lists.neo4j.org
   3. mailto:rick.bullo...@burningskysoftware.com
   4. mailto:User@lists.neo4j.org
   5. https://lists.neo4j.org/mailman/listinfo/user
   6. mailto:matt...@neotechnology.com
   7. http://www.neotechnology.com/
   8. mailto:User@lists.neo4j.org
   9. https://lists.neo4j.org/mailman/listinfo/user
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] GeoTools and Neo4j

2010-09-14 Thread Ivan Willig
Thanks for the information Peter.

In regards to updating to 2.7, I want to make sure that the Neo4j Geotools
(gt) Datastore works with 2.7 onwards to ensure compatibility with all of
the GeoScripts http://geoscript.org/ and
Geo.cljhttp://github.com/iwillig/geo.clj.
These, I think, are the future of GeoTools. I make changes in my fork and
later worry about pushing back to the main project later. Anyway, back to
real work:).

Ivan Willig



On Mon, Sep 13, 2010 at 2:59 PM, Peter Neubauer 
peter.neuba...@neotechnology.com wrote:

 Ivan,
 welcome to Neo4j! Answers (or attempts to) inline:

 On Mon, Sep 13, 2010 at 6:07 PM, Ivan Willig iwil...@gmail.com wrote:

  Hi list,
  I was playing around with Neo4j spatial stuff over the weekend and
 noticed
  we are using GeoTools 2.6. GeoTools is moving to release 2.7 and I think
  its
  worth the time to update Neo4jSpatialDataStore. Right now I am running
 into
  this http://paste.pocoo.org/show/261438/ issue right now while using
  GeoTools 2.7. I can do some digging after work hours, but I am not sure
 how
  much time I can devote to this.
 
  Well, welcome to fork away and contribute! I think upgrading should not
 be
 a big issue if you know what changed in GeoTools 2.7. I think the main
 reason behind this is that uDig is at GeoTools 2.7, but I might be wrong.
 Craig?
 Before merging, let's make sure you get the CLA into place,
 http://wiki.neo4j.org/content/About_Contributor_License_Agreement

 Couple of questions, should we move to GeoTools trunk? Has someone already
  started this? Is there a maintainer of the GeoTools datastore? Lastly,
  where
  can I find the list of all of the issues regrading the spatial component
 of
  neo4j? I am looking to help out more.
 
  We have started to talk to the GeoTools guys, but need to review their
 code
 contribution guidelines more carefully before being able to fill them in.
 Otherwise, it would be great to have a maintainer over there to take care
 of
 at least a thin adapter pulling in the Neo4j-Spatial artifacts.

 We are maintaining a list of issues (or just the beginning of one) at
 http://github.com/neo4j/neo4j-spatial/issues . Feel free to comment and
 contribute - all ideas are welcome!

 /peter
 ___
 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] GeoTools and Neo4j

2010-09-14 Thread Craig Taverner
uDig 1.2 is on Geotools 2.6, but Jody tells me that he got it working on
Geotools 2.7 last week (so we should see a 1.2.1 soon), and so a move of
Neo4j to the new Geotools should be a good move to make. I don't have time
to look at this myself right now, but you are certainly more than welcome to
make the move and send a pull request :-)

On Tue, Sep 14, 2010 at 4:36 PM, Ivan Willig iwil...@gmail.com wrote:

 Thanks for the information Peter.

 In regards to updating to 2.7, I want to make sure that the Neo4j Geotools
 (gt) Datastore works with 2.7 onwards to ensure compatibility with all of
 the GeoScripts http://geoscript.org/ and
 Geo.cljhttp://github.com/iwillig/geo.clj.
 These, I think, are the future of GeoTools. I make changes in my fork and
 later worry about pushing back to the main project later. Anyway, back to
 real work:).

 Ivan Willig



 On Mon, Sep 13, 2010 at 2:59 PM, Peter Neubauer 
 peter.neuba...@neotechnology.com wrote:

  Ivan,
  welcome to Neo4j! Answers (or attempts to) inline:
 
  On Mon, Sep 13, 2010 at 6:07 PM, Ivan Willig iwil...@gmail.com wrote:
 
   Hi list,
   I was playing around with Neo4j spatial stuff over the weekend and
  noticed
   we are using GeoTools 2.6. GeoTools is moving to release 2.7 and I
 think
   its
   worth the time to update Neo4jSpatialDataStore. Right now I am running
  into
   this http://paste.pocoo.org/show/261438/ issue right now while using
   GeoTools 2.7. I can do some digging after work hours, but I am not sure
  how
   much time I can devote to this.
  
   Well, welcome to fork away and contribute! I think upgrading should not
  be
  a big issue if you know what changed in GeoTools 2.7. I think the main
  reason behind this is that uDig is at GeoTools 2.7, but I might be wrong.
  Craig?
  Before merging, let's make sure you get the CLA into place,
  http://wiki.neo4j.org/content/About_Contributor_License_Agreement
 
  Couple of questions, should we move to GeoTools trunk? Has someone
 already
   started this? Is there a maintainer of the GeoTools datastore? Lastly,
   where
   can I find the list of all of the issues regrading the spatial
 component
  of
   neo4j? I am looking to help out more.
  
   We have started to talk to the GeoTools guys, but need to review their
  code
  contribution guidelines more carefully before being able to fill them in.
  Otherwise, it would be great to have a maintainer over there to take care
  of
  at least a thin adapter pulling in the Neo4j-Spatial artifacts.
 
  We are maintaining a list of issues (or just the beginning of one) at
  http://github.com/neo4j/neo4j-spatial/issues . Feel free to comment and
  contribute - all ideas are welcome!
 
  /peter
  ___
  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] Relationship Check During Traversal

2010-09-14 Thread Paddy
Hi ,
I'm trying to setup a Traversal in a time dependant graph
with multiple weighted connections between nodes representing
minutes. I want to only traverse the first relationship with a
value greater than the weight of the traversal's current position.
i.e if the path.weight()=100 only traverse the first relationship
with a departure time property =100

I have implemented a modified BranchSelector to identify the next
relationship to traverse depending on the path weight. But once i have
identified this relationship in BranchSelector.next(), how can
I return a new TraversalBranch using this node.

As i see the TraversalBranch is created in ExpansionSourceImpl using:
TraversalBranch next = new ExpansionSourceImpl( traverser, this,
depth + 1, node,traverser.description.expander, relationship );

Would I need to create a modified ExpansionSourceImpl?
Please let me know if i am going down the right path :-/

thanks
Paddy

On Sat, Sep 11, 2010 at 1:51 PM, Paddy paddyf...@gmail.com wrote:

 Hi David,
 Thanks for your help, I got it working using the following code. I tested
 it on a small graph with the neo4j java-dijkstra example and it works :)

 Cheers
 Paddy

   public static PruneEvaluator pruneAfterTransfer()
 {
 return new PruneEvaluator()
 {
 public boolean pruneAfter( Path path )
 {
  System.out.println(path  + path);
 int count=0;

 if(path.lastRelationship().isType(RelationshipTypes.TRANSFER))
  {
  IterableRelationship relationships =
 path.relationships();
  for(Relationship relationship : relationships)
  {
  if(relationship.isType(RelationshipTypes.TRANSFER))
  {
   if (++count == 2) {
   System.out.println(Breaking!!);
   return true;
 }
  }


  }
  }
 return false;
 }
 };
 }


 PruneEvaluator prunerAfterTransfer = pruneAfterTransfer();
 private static final TraversalDescription TRAVERSAL =
 Traversal.description().uniqueness(
 Uniqueness.NONE ).prune(pruneAfterTransfer());

 On Fri, Sep 10, 2010 at 10:11 PM, David Montag 
 david.mon...@neotechnology.com wrote:

 Hi Paddy,

 One idea is to prune the traversal by looking at whether the path so far
 already has a transfer relationship or not. You would then do some kind of
 filtering of the resulting paths, e.g. only accepting those with correct
 end
 nodes. I don't know if the computational complexity of this is acceptable
 or
 not though.

 And I don't know if this answer was relevant or not. I hope it was :)

 David

 On Sat, Sep 11, 2010 at 4:09 AM, Paddy paddyf...@gmail.com wrote:

  Hi just a quick question regarding the use of the PruneEvaluator
 
  I was wondering what would be the best way to modify the
  TraversalDescription in the Dijkstra
  algorithm in order to prune a traversal when a branch has reached a
 second
  transfer relationship.
  I want to avoid multiple transfers in a bus network.
 
  If the graph is arranged as:
 
  (stop:1) --bus (stop:2) --transfer (stop:3) --bus (stop:4) --transfer
 
  (stop:5)
 
  Is it possible to prune the traversal branch when the 2nd transfer
  relationship is reached after (stop:4)
  Could this be achieved using a PruneEvaluator? Or am I approaching this
 the
  wrong way?
 
  thanks
  Paddy
  ___
  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