Re: [Neo4j] Neo4j graph collections introduction of NodeCollection interface

2011-09-20 Thread Niels Hoogeveen

Hi Bryce,
Sorry for the late response.
I understand it's difficult to come up with a really good use-case for making 
NodeCollection more general in the context of IndexedRelationships, but I like 
to think of that interface as something we can eventually use for all sorts of 
collections, not just the ones derived from SortedTree. 
There is of course the issue that relationships can not attach to 
relationships, so collections of relationships will need to be addressed by Id. 
This is not necessarily a bad thing, because it decouples the container and the 
elements. In other words the container knows what elements it contains, but the 
elements don't know in what containers they are placed. 
Another option would be to create shadow nodes for contained relationships. 
Instead of adding a relationships to the collection, its shadow node is added 
and both the shadow node and the relationship contain pointers (properties with 
Id values) towards each other.
I think it would be best if we do indeed create a GraphCollection interface 
parameterized by T extends PropertyContainer  even if that type parameter for 
now is always a Node. It doesn't add much complexity now to do it, and later on 
we may regret it and by then it becomes harder to do because there is an 
installed base.
Niels

 Date: Sat, 17 Sep 2011 14:19:04 +1200
 From: bryc...@gmail.com
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] Neo4j graph collections introduction of NodeCollection   
 interface
 
 Hi Niels,
 
 I had wondered about having a collection interface that covered both nodes
 and relationships.  There were a couple of reasons I didn't go with that
 right now, though well worthwhile discussing it and going with a
 GraphCollection super interface if it fits properly.
 
 Firstly I wanted to get something out there so people could have a look,
 and having something that matched what IndexedRelationship currently
 required was easiest first step.  Biggest thing specific in there to that
 functionality is the addNode method returning a relationship.
 
 The other issue was more wondering how a relationship collection would work.
  Say I have a relationship collection, and I have a relationship R1 between
 node A and B, how am I going to represent that relationship withing some
 graph based data structure that makes sense.  There could be a node X that
 is part of the relationship collection data structure (e.g. tree) and that
 node could have an attribute that has the relationship id on it, but that
 doesn't seem like it would be very performant.  There could be a
 relationship between X and A that also gave the relationship type of R1, so
 you could find the relationship based on that, but there isn't
 any guarantee of the relationship type being unique.  What it would need to
 properly model it is the ability to have a relationship between X and R1,
 i.e. a relationship from a node to a relationship.
 
 If instead of being able to add any given relationship to the relationship
 collection you instead restrict it to being relationships matching a certain
 criteria from a given node then it is practically the same thing as a
 relationship expander.
 
 Or if you instead have a way through the relationship collection to create
 relationships from a given node to a set of other arbitrary nodes, with the
 relationship collection having a fixed relationship type and direction, then
 that is practically the current IndexedRelationship.
 
 I guess a way it could work is similar to IndexedRelationship, basically
 more general case of that class, where you have a method on the relationship
 collection createRelationship(startNode, endNode, relationshipType,
 direction) that was then stored in an internal data structure to create a
 pseudo relationship between the start and end, and then being able to
 iterate over this set of relationships.  Not sure exactly what the use case
 of that would be.  Maybe of more interest could be the same situation where
 the relationship type and direction are fixed, then you may have a friend
 of set of relationships that you create between arbitrary nodes and then
 iterate over all of those.
 
 I can't personally think of a good way of adding a set of arbitrary
 relationships into a collection stored in a graph data structure.
 
 Thoughts?
 
 Cheers
 Bryce
 
 P.S. Peter, I had thought to remove the passing in of the graph database and
 instead just getting it from the node, or only passing in the graph database
 and creating the node internally.
 
 On Sat, Sep 17, 2011 at 2:19 AM, Niels Hoogeveen
 pd_aficion...@hotmail.comwrote:
 
 
  Hi Bryce,
  I really like what you are trying to achieve here.
  One question:
  Instead of having NodeCollection, why not have GraphCollectionT extends
  PropertyContainer. That way we can have collections of both Relationships
  and Nodes.
  Niels
 
   Date: Fri, 16 Sep 2011 17:37:29 +1200
   From: bryc...@gmail.com
   To: user@lists.neo4j.org
   Subject: [Neo4j] Neo4j graph

Re: [Neo4j] Neo4j graph collections introduction of NodeCollection interface

2011-09-20 Thread Bryce
Hi Niels,

Probably is a good idea.  I will try to get something done around that soon,
flat out with work issues/features at present (including a nice
concurrency bug, argh).

Cheers
Bryce

On Wed, Sep 21, 2011 at 2:01 AM, Niels Hoogeveen
pd_aficion...@hotmail.comwrote:


 Hi Bryce,
 Sorry for the late response.
 I understand it's difficult to come up with a really good use-case for
 making NodeCollection more general in the context of IndexedRelationships,
 but I like to think of that interface as something we can eventually use for
 all sorts of collections, not just the ones derived from SortedTree.
 There is of course the issue that relationships can not attach to
 relationships, so collections of relationships will need to be addressed by
 Id. This is not necessarily a bad thing, because it decouples the container
 and the elements. In other words the container knows what elements it
 contains, but the elements don't know in what containers they are placed.
 Another option would be to create shadow nodes for contained relationships.
 Instead of adding a relationships to the collection, its shadow node is
 added and both the shadow node and the relationship contain pointers
 (properties with Id values) towards each other.
 I think it would be best if we do indeed create a GraphCollection interface
 parameterized by T extends PropertyContainer  even if that type parameter
 for now is always a Node. It doesn't add much complexity now to do it, and
 later on we may regret it and by then it becomes harder to do because there
 is an installed base.
 Niels

  Date: Sat, 17 Sep 2011 14:19:04 +1200
  From: bryc...@gmail.com
  To: user@lists.neo4j.org
  Subject: Re: [Neo4j] Neo4j graph collections introduction of
 NodeCollection   interface
 
  Hi Niels,
 
  I had wondered about having a collection interface that covered both
 nodes
  and relationships.  There were a couple of reasons I didn't go with that
  right now, though well worthwhile discussing it and going with a
  GraphCollection super interface if it fits properly.
 
  Firstly I wanted to get something out there so people could have a
 look,
  and having something that matched what IndexedRelationship currently
  required was easiest first step.  Biggest thing specific in there to that
  functionality is the addNode method returning a relationship.
 
  The other issue was more wondering how a relationship collection would
 work.
   Say I have a relationship collection, and I have a relationship R1
 between
  node A and B, how am I going to represent that relationship withing some
  graph based data structure that makes sense.  There could be a node X
 that
  is part of the relationship collection data structure (e.g. tree) and
 that
  node could have an attribute that has the relationship id on it, but that
  doesn't seem like it would be very performant.  There could be a
  relationship between X and A that also gave the relationship type of R1,
 so
  you could find the relationship based on that, but there isn't
  any guarantee of the relationship type being unique.  What it would need
 to
  properly model it is the ability to have a relationship between X and R1,
  i.e. a relationship from a node to a relationship.
 
  If instead of being able to add any given relationship to the
 relationship
  collection you instead restrict it to being relationships matching a
 certain
  criteria from a given node then it is practically the same thing as a
  relationship expander.
 
  Or if you instead have a way through the relationship collection to
 create
  relationships from a given node to a set of other arbitrary nodes, with
 the
  relationship collection having a fixed relationship type and direction,
 then
  that is practically the current IndexedRelationship.
 
  I guess a way it could work is similar to IndexedRelationship, basically
  more general case of that class, where you have a method on the
 relationship
  collection createRelationship(startNode, endNode, relationshipType,
  direction) that was then stored in an internal data structure to create a
  pseudo relationship between the start and end, and then being able to
  iterate over this set of relationships.  Not sure exactly what the use
 case
  of that would be.  Maybe of more interest could be the same situation
 where
  the relationship type and direction are fixed, then you may have a
 friend
  of set of relationships that you create between arbitrary nodes and then
  iterate over all of those.
 
  I can't personally think of a good way of adding a set of arbitrary
  relationships into a collection stored in a graph data structure.
 
  Thoughts?
 
  Cheers
  Bryce
 
  P.S. Peter, I had thought to remove the passing in of the graph database
 and
  instead just getting it from the node, or only passing in the graph
 database
  and creating the node internally.
 
  On Sat, Sep 17, 2011 at 2:19 AM, Niels Hoogeveen
  pd_aficion...@hotmail.comwrote:
 
  
   Hi Bryce,
   I really like what

Re: [Neo4j] Neo4j graph collections introduction of NodeCollection interface

2011-09-16 Thread Peter Neubauer
Also,
since you can do node.getGraphDatabase(), I think we don't need to
pass in the graphdb instance in
new SortedTree( graphDb(), graphDb().createNode(), new IdComparator(),
true, RelTypes.INDEXED_RELATIONSHIP.name() );
?

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://startupbootcamp.org/    - Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



On Fri, Sep 16, 2011 at 7:37 AM, Bryce bryc...@gmail.com wrote:
 Hi,

 I had mentioned in a previous thread that I was working on introducing a
 NodeCollection interface to remove the dependency from IndexedRelationship
 to SortedTree.  I have an initial cut of this up now in my github repo:
 https://github.com/brycenz/graph-collections

 It would be great to get community feedback on this as I think that having a
 well designed and common NodeCollection interface would help for multiple
 use cases, e.g. sortedTreeNodeCollection.addAll(linkedListNodeCollection)
 doing exactly what you think it would.

 IndexedRelationship now takes a node to index relationships from, a
 relationship type, and a direction, as well as a NodeCollection at creation
 time.  As in the unit tests this then leads to:

 Node indexedNode = graphDb().createNode();
 SortedTree st = new SortedTree( graphDb(), graphDb().createNode(), new
 IdComparator(), true, RelTypes.INDEXED_RELATIONSHIP.name() );

 IndexedRelationship ir = new IndexedRelationship( indexedNode,
 RelTypes.INDEXED_RELATIONSHIP, Direction.OUTGOING, st );

 To create the IndexedRelationship.  To later add nodes to the relationship
 you need to create an instance of IndexedRelationship without the
 NodeCollection:

 IndexedRelationship ir = new IndexedRelationship( indexedNode,
 RelTypes.INDEXED_RELATIONSHIP, Direction.OUTGOING );


 What this means from a NodeCollection implementation point of view is that
 firstly it needs to use the NodeCollection.RelationshipType.VALUE
 relationship to connect from its internal data structure to the nodes being
 added to the collection, and it needs to be able to recreate itself from a
 base node that is passed into a constructor (that only takes the base node).
  A node collection also needs to store its class name on the base node for
 later construction purposes, as well as any other data required to recreate
 the NodeCollection instance (in the case of SortedTree this is the
 comparator class, the tree name, and whether it is a unique index.

 Niels, you may want to have a good look over SortedTree, I have made a few
 changes to it, mainly around introduction of a base node, and changing of
 the end value relationships.  This could be cleaned up better, but I wanted
 to start with minimal changes.

 Both IndexedRelationship and IndexedRelationshipExpander have no
 dependencies on SortedTree now, and should work with any properly
 implemented NodeCollection.  I will be putting together a paged linked list
 NodeCollection next to try this.

 Some future thoughts for NodeCollection, addition of as many of the
 java.util.Collection methods (e.g. addAll, removeAll, retainAll, contains,
 containsAll) as well as an abstract base NodeCollection to help provide
 non-optimised support for these methods.

 Cheers
 Bryce
 ___
 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 graph collections introduction of NodeCollection interface

2011-09-16 Thread Niels Hoogeveen

Bryce's point makes perfect sense. The argument graphDb().createNode() gives 
the constructor an instance of Node, which contains a reference to the 
database, so there is no real need to additionally supply the database instance.
Of course his example would have been less confusing if he'd written:

Node indexedNode = graphDb().createNode(); 
SortedTree st = new SortedTree( graphDb(), indexedNode, new IdComparator(), 
true, RelTypes.INDEXED_RELATIONSHIP.name() );

 From: peter.neuba...@neotechnology.com
 Date: Fri, 16 Sep 2011 15:22:27 +0200
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] Neo4j graph collections introduction of NodeCollection   
 interface
 
 Also,
 since you can do node.getGraphDatabase(), I think we don't need to
 pass in the graphdb instance in
 new SortedTree( graphDb(), graphDb().createNode(), new IdComparator(),
 true, RelTypes.INDEXED_RELATIONSHIP.name() );
 ?
 
 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://startupbootcamp.org/- Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
 
 
 
 On Fri, Sep 16, 2011 at 7:37 AM, Bryce bryc...@gmail.com wrote:
  Hi,
 
  I had mentioned in a previous thread that I was working on introducing a
  NodeCollection interface to remove the dependency from IndexedRelationship
  to SortedTree.  I have an initial cut of this up now in my github repo:
  https://github.com/brycenz/graph-collections
 
  It would be great to get community feedback on this as I think that having a
  well designed and common NodeCollection interface would help for multiple
  use cases, e.g. sortedTreeNodeCollection.addAll(linkedListNodeCollection)
  doing exactly what you think it would.
 
  IndexedRelationship now takes a node to index relationships from, a
  relationship type, and a direction, as well as a NodeCollection at creation
  time.  As in the unit tests this then leads to:
 
  Node indexedNode = graphDb().createNode();
  SortedTree st = new SortedTree( graphDb(), graphDb().createNode(), new
  IdComparator(), true, RelTypes.INDEXED_RELATIONSHIP.name() );
 
  IndexedRelationship ir = new IndexedRelationship( indexedNode,
  RelTypes.INDEXED_RELATIONSHIP, Direction.OUTGOING, st );
 
  To create the IndexedRelationship.  To later add nodes to the relationship
  you need to create an instance of IndexedRelationship without the
  NodeCollection:
 
  IndexedRelationship ir = new IndexedRelationship( indexedNode,
  RelTypes.INDEXED_RELATIONSHIP, Direction.OUTGOING );
 
 
  What this means from a NodeCollection implementation point of view is that
  firstly it needs to use the NodeCollection.RelationshipType.VALUE
  relationship to connect from its internal data structure to the nodes being
  added to the collection, and it needs to be able to recreate itself from a
  base node that is passed into a constructor (that only takes the base node).
   A node collection also needs to store its class name on the base node for
  later construction purposes, as well as any other data required to recreate
  the NodeCollection instance (in the case of SortedTree this is the
  comparator class, the tree name, and whether it is a unique index.
 
  Niels, you may want to have a good look over SortedTree, I have made a few
  changes to it, mainly around introduction of a base node, and changing of
  the end value relationships.  This could be cleaned up better, but I wanted
  to start with minimal changes.
 
  Both IndexedRelationship and IndexedRelationshipExpander have no
  dependencies on SortedTree now, and should work with any properly
  implemented NodeCollection.  I will be putting together a paged linked list
  NodeCollection next to try this.
 
  Some future thoughts for NodeCollection, addition of as many of the
  java.util.Collection methods (e.g. addAll, removeAll, retainAll, contains,
  containsAll) as well as an abstract base NodeCollection to help provide
  non-optimised support for these methods.
 
  Cheers
  Bryce
  ___
  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 graph collections introduction of NodeCollection interface

2011-09-16 Thread Niels Hoogeveen

Hi Bryce,
I really like what you are trying to achieve here. 
One question:
Instead of having NodeCollection, why not have GraphCollectionT extends 
PropertyContainer. That way we can have collections of both Relationships and 
Nodes.
Niels

 Date: Fri, 16 Sep 2011 17:37:29 +1200
 From: bryc...@gmail.com
 To: user@lists.neo4j.org
 Subject: [Neo4j] Neo4j graph collections introduction of NodeCollection   
 interface
 
 Hi,
 
 I had mentioned in a previous thread that I was working on introducing a
 NodeCollection interface to remove the dependency from IndexedRelationship
 to SortedTree.  I have an initial cut of this up now in my github repo:
 https://github.com/brycenz/graph-collections
 
 It would be great to get community feedback on this as I think that having a
 well designed and common NodeCollection interface would help for multiple
 use cases, e.g. sortedTreeNodeCollection.addAll(linkedListNodeCollection)
 doing exactly what you think it would.
 
 IndexedRelationship now takes a node to index relationships from, a
 relationship type, and a direction, as well as a NodeCollection at creation
 time.  As in the unit tests this then leads to:
 
 Node indexedNode = graphDb().createNode();
 SortedTree st = new SortedTree( graphDb(), graphDb().createNode(), new
 IdComparator(), true, RelTypes.INDEXED_RELATIONSHIP.name() );
 
 IndexedRelationship ir = new IndexedRelationship( indexedNode,
 RelTypes.INDEXED_RELATIONSHIP, Direction.OUTGOING, st );
 
 To create the IndexedRelationship.  To later add nodes to the relationship
 you need to create an instance of IndexedRelationship without the
 NodeCollection:
 
 IndexedRelationship ir = new IndexedRelationship( indexedNode,
 RelTypes.INDEXED_RELATIONSHIP, Direction.OUTGOING );
 
 
 What this means from a NodeCollection implementation point of view is that
 firstly it needs to use the NodeCollection.RelationshipType.VALUE
 relationship to connect from its internal data structure to the nodes being
 added to the collection, and it needs to be able to recreate itself from a
 base node that is passed into a constructor (that only takes the base node).
  A node collection also needs to store its class name on the base node for
 later construction purposes, as well as any other data required to recreate
 the NodeCollection instance (in the case of SortedTree this is the
 comparator class, the tree name, and whether it is a unique index.
 
 Niels, you may want to have a good look over SortedTree, I have made a few
 changes to it, mainly around introduction of a base node, and changing of
 the end value relationships.  This could be cleaned up better, but I wanted
 to start with minimal changes.
 
 Both IndexedRelationship and IndexedRelationshipExpander have no
 dependencies on SortedTree now, and should work with any properly
 implemented NodeCollection.  I will be putting together a paged linked list
 NodeCollection next to try this.
 
 Some future thoughts for NodeCollection, addition of as many of the
 java.util.Collection methods (e.g. addAll, removeAll, retainAll, contains,
 containsAll) as well as an abstract base NodeCollection to help provide
 non-optimised support for these methods.
 
 Cheers
 Bryce
 ___
 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 graph collections introduction of NodeCollection interface

2011-09-16 Thread Bryce
Hi Niels,

I had wondered about having a collection interface that covered both nodes
and relationships.  There were a couple of reasons I didn't go with that
right now, though well worthwhile discussing it and going with a
GraphCollection super interface if it fits properly.

Firstly I wanted to get something out there so people could have a look,
and having something that matched what IndexedRelationship currently
required was easiest first step.  Biggest thing specific in there to that
functionality is the addNode method returning a relationship.

The other issue was more wondering how a relationship collection would work.
 Say I have a relationship collection, and I have a relationship R1 between
node A and B, how am I going to represent that relationship withing some
graph based data structure that makes sense.  There could be a node X that
is part of the relationship collection data structure (e.g. tree) and that
node could have an attribute that has the relationship id on it, but that
doesn't seem like it would be very performant.  There could be a
relationship between X and A that also gave the relationship type of R1, so
you could find the relationship based on that, but there isn't
any guarantee of the relationship type being unique.  What it would need to
properly model it is the ability to have a relationship between X and R1,
i.e. a relationship from a node to a relationship.

If instead of being able to add any given relationship to the relationship
collection you instead restrict it to being relationships matching a certain
criteria from a given node then it is practically the same thing as a
relationship expander.

Or if you instead have a way through the relationship collection to create
relationships from a given node to a set of other arbitrary nodes, with the
relationship collection having a fixed relationship type and direction, then
that is practically the current IndexedRelationship.

I guess a way it could work is similar to IndexedRelationship, basically
more general case of that class, where you have a method on the relationship
collection createRelationship(startNode, endNode, relationshipType,
direction) that was then stored in an internal data structure to create a
pseudo relationship between the start and end, and then being able to
iterate over this set of relationships.  Not sure exactly what the use case
of that would be.  Maybe of more interest could be the same situation where
the relationship type and direction are fixed, then you may have a friend
of set of relationships that you create between arbitrary nodes and then
iterate over all of those.

I can't personally think of a good way of adding a set of arbitrary
relationships into a collection stored in a graph data structure.

Thoughts?

Cheers
Bryce

P.S. Peter, I had thought to remove the passing in of the graph database and
instead just getting it from the node, or only passing in the graph database
and creating the node internally.

On Sat, Sep 17, 2011 at 2:19 AM, Niels Hoogeveen
pd_aficion...@hotmail.comwrote:


 Hi Bryce,
 I really like what you are trying to achieve here.
 One question:
 Instead of having NodeCollection, why not have GraphCollectionT extends
 PropertyContainer. That way we can have collections of both Relationships
 and Nodes.
 Niels

  Date: Fri, 16 Sep 2011 17:37:29 +1200
  From: bryc...@gmail.com
  To: user@lists.neo4j.org
  Subject: [Neo4j] Neo4j graph collections introduction of NodeCollection
 interface
 
  Hi,
 
  I had mentioned in a previous thread that I was working on introducing a
  NodeCollection interface to remove the dependency from
 IndexedRelationship
  to SortedTree.  I have an initial cut of this up now in my github repo:
  https://github.com/brycenz/graph-collections
 
  It would be great to get community feedback on this as I think that
 having a
  well designed and common NodeCollection interface would help for multiple
  use cases, e.g. sortedTreeNodeCollection.addAll(linkedListNodeCollection)
  doing exactly what you think it would.
 
  IndexedRelationship now takes a node to index relationships from, a
  relationship type, and a direction, as well as a NodeCollection at
 creation
  time.  As in the unit tests this then leads to:
 
  Node indexedNode = graphDb().createNode();
  SortedTree st = new SortedTree( graphDb(), graphDb().createNode(), new
  IdComparator(), true, RelTypes.INDEXED_RELATIONSHIP.name() );
 
  IndexedRelationship ir = new IndexedRelationship( indexedNode,
  RelTypes.INDEXED_RELATIONSHIP, Direction.OUTGOING, st );
 
  To create the IndexedRelationship.  To later add nodes to the
 relationship
  you need to create an instance of IndexedRelationship without the
  NodeCollection:
 
  IndexedRelationship ir = new IndexedRelationship( indexedNode,
  RelTypes.INDEXED_RELATIONSHIP, Direction.OUTGOING );
 
 
  What this means from a NodeCollection implementation point of view is
 that
  firstly it needs to use the NodeCollection.RelationshipType.VALUE
 

Re: [Neo4j] neo4j-graph-collections

2011-06-29 Thread Niels Hoogeveen





At this moment Btree only supports the primitive datatype long, while Rtree 
only supports the datatype double. For Btree it makes sense to at least support 
strings, floats, doubles and ints too. Use cases for these data types are 
pretty obvious and are Btree backed in (almost) every RDBMS product around.I 
think the best solution would be to create Comparator objects wrapping these 
primitive data types and store the class name of the comparator in root of the 
index tree. This allows users to create their own comparators for datatypes not 
covered yet. It would make sense people would want to store BigInt and 
BigDecimal objects in a Btree too, others may want to store dates (instead of 
datetime), fractions, complex numbers or even more exotic data types. 
Niels
 From: sxk1...@hotmail.com
 To: user@lists.neo4j.org
 Date: Tue, 28 Jun 2011 22:43:24 -0700
 Subject: Re: [Neo4j] neo4j-graph-collections
 
 
 I've read through this thread in more detail and have a few thoughts, when 
 you talk about type I am assuming that you are referring to an interface that 
 both (Btree,Rtree) can implement, for the data types I'd like to understand 
 the use cases first before implementing the different data types, maybe we 
 could store types of Object instead of Long or Double and implement 
 comparators in a more meaningful fashion.   Also I was wondering if unit 
 tests would need to be extracted out of the spatial component and embedded 
 inside the graph-collections component as well or whether we'd potentially 
 need to write brand new unit tests as well.
 Craig as I mentioned I'd love to help, let me know if it would be possible to 
 fork a repo or to talk in more detail this week.
 Regards
 
  From: pd_aficion...@hotmail.com
  To: user@lists.neo4j.org
  Date: Wed, 29 Jun 2011 01:35:43 +0200
  Subject: Re: [Neo4j] neo4j-graph-collections
  
  
  As to the issue of n-dim doubles, it would be interesting to consider 
  creating a set of classes of type Orderable (supporting , =, , = 
  operations), this we can use in both Rtree and Btree. Right now Btree only 
  supports datatype Long. This should also become more generic. A first step 
  we can take is at least wrap the common datatypes in Orderable classes.
  Niels
  
   Date: Wed, 29 Jun 2011 00:32:15 +0200
   From: cr...@amanzi.com
   To: user@lists.neo4j.org
   Subject: Re: [Neo4j] neo4j-graph-collections
   
   The RTree in principle should be generalizable, but the current
   implementation in neo4j-spatial does make a few assumptions specific to
   spatial data, and makes use of spatial envelopes for the tree node 
   bounding
   boxes. It is also specific to 2D. We could make a few improvements first,
   like generalizing to n-dimensions, replacing the recursive search with a
   traverser and generalizing the bounding boxes to be simple double-arrays.
   Then the only thing left would be to decide if it is ok for it to be based
   on n-dim doubles or should be generalized to more types.
   
   On Tue, Jun 28, 2011 at 11:14 PM, Saikat Kanjilal 
   sxk1...@hotmail.comwrote:
   
I would be interested in helping out with this, let me know next steps.
   
Sent from my iPhone
   
On Jun 28, 2011, at 8:49 AM, Niels Hoogeveen pd_aficion...@hotmail.com
wrote:
   

 A couple of weeks ago Peter Neubauer set up a repository for in-graph
datastructures: https://github.com/peterneubauer/graph-collections.
 At this time of writing only the Btree/Timeline index is part of this
component.
 In my opinion it would be interesting to move the Rtree parts of
neo-spatial to neo4j-graph-collections too.
 I looked at the code but don't feel competent to seperate out those
classes that support generic Rtrees from those classes that are clearly
spatial related.
 Is there any enthusiasm for such a project and if so, who is willing 
 and
able to do this?
 Niels



 ___
 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

  ___
  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-graph-collections

2011-06-29 Thread Rick Bullotta
That's basically what we do - wrappers around our Location, InfoTable (2D data 
table), DateTime (JODA), JSON, and XML entities to perform those types of 
comparator actions for filtering and sorting. We also expose methods in the 
wrappers (which also include Double, Boolean, String, etc.) to deal with 
persistence/de-persistence in a variety of formats, including Neo, JSON, XML, 
and simple toString()/fromString().




-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Niels Hoogeveen
Sent: Wednesday, June 29, 2011 8:25 AM
To: user@lists.neo4j.org
Subject: Re: [Neo4j] neo4j-graph-collections






At this moment Btree only supports the primitive datatype long, while Rtree 
only supports the datatype double. For Btree it makes sense to at least support 
strings, floats, doubles and ints too. Use cases for these data types are 
pretty obvious and are Btree backed in (almost) every RDBMS product around.I 
think the best solution would be to create Comparator objects wrapping these 
primitive data types and store the class name of the comparator in root of the 
index tree. This allows users to create their own comparators for datatypes not 
covered yet. It would make sense people would want to store BigInt and 
BigDecimal objects in a Btree too, others may want to store dates (instead of 
datetime), fractions, complex numbers or even more exotic data types. 
Niels
 From: sxk1...@hotmail.com
 To: user@lists.neo4j.org
 Date: Tue, 28 Jun 2011 22:43:24 -0700
 Subject: Re: [Neo4j] neo4j-graph-collections
 
 
 I've read through this thread in more detail and have a few thoughts, when 
 you talk about type I am assuming that you are referring to an interface that 
 both (Btree,Rtree) can implement, for the data types I'd like to understand 
 the use cases first before implementing the different data types, maybe we 
 could store types of Object instead of Long or Double and implement 
 comparators in a more meaningful fashion.   Also I was wondering if unit 
 tests would need to be extracted out of the spatial component and embedded 
 inside the graph-collections component as well or whether we'd potentially 
 need to write brand new unit tests as well.
 Craig as I mentioned I'd love to help, let me know if it would be possible to 
 fork a repo or to talk in more detail this week.
 Regards
 
  From: pd_aficion...@hotmail.com
  To: user@lists.neo4j.org
  Date: Wed, 29 Jun 2011 01:35:43 +0200
  Subject: Re: [Neo4j] neo4j-graph-collections
  
  
  As to the issue of n-dim doubles, it would be interesting to consider 
  creating a set of classes of type Orderable (supporting , =, , = 
  operations), this we can use in both Rtree and Btree. Right now Btree only 
  supports datatype Long. This should also become more generic. A first step 
  we can take is at least wrap the common datatypes in Orderable classes.
  Niels
  
   Date: Wed, 29 Jun 2011 00:32:15 +0200
   From: cr...@amanzi.com
   To: user@lists.neo4j.org
   Subject: Re: [Neo4j] neo4j-graph-collections
   
   The RTree in principle should be generalizable, but the current
   implementation in neo4j-spatial does make a few assumptions specific to
   spatial data, and makes use of spatial envelopes for the tree node 
   bounding
   boxes. It is also specific to 2D. We could make a few improvements first,
   like generalizing to n-dimensions, replacing the recursive search with a
   traverser and generalizing the bounding boxes to be simple double-arrays.
   Then the only thing left would be to decide if it is ok for it to be based
   on n-dim doubles or should be generalized to more types.
   
   On Tue, Jun 28, 2011 at 11:14 PM, Saikat Kanjilal 
   sxk1...@hotmail.comwrote:
   
I would be interested in helping out with this, let me know next steps.
   
Sent from my iPhone
   
On Jun 28, 2011, at 8:49 AM, Niels Hoogeveen pd_aficion...@hotmail.com
wrote:
   

 A couple of weeks ago Peter Neubauer set up a repository for in-graph
datastructures: https://github.com/peterneubauer/graph-collections.
 At this time of writing only the Btree/Timeline index is part of this
component.
 In my opinion it would be interesting to move the Rtree parts of
neo-spatial to neo4j-graph-collections too.
 I looked at the code but don't feel competent to seperate out those
classes that support generic Rtrees from those classes that are clearly
spatial related.
 Is there any enthusiasm for such a project and if so, who is willing 
 and
able to do this?
 Niels



 ___
 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

Re: [Neo4j] neo4j-graph-collections

2011-06-29 Thread Craig Taverner
I have previously used two solutions to deal with multiple types in btrees:

   - My first index in 2009 was a btree-like n-dim index using generics to
   support int[], long[], float[] and double[] (no strings). I used this for
   TimeLine (long[1]) and Location (double[2]). The knowledge about what type
   was used was in the code for constructing the index (whether a new index or
   accessing an existing index in the graph).
   - In December I started my amanzi-index (on
githubhttps://github.com/craigtaverner/amanzi-index)
   that is also btree-like, n-dimensional. But this time it can index multiple
   types in the same tree (so a float, int and string in the same tree, instead
   of being forced to have all properties of the same type). It is a re-write
   of the previous index to support Strings, and mixed types. This time it does
   save the type information in meta-data at the tree root.

The idea of using a 'comparator' class for the types is similar, but simpler
than the idea I implemented for amanzi-index, where I have mapper classes
that describe not only how to compare types, but also how to map from values
to index keys and back. This includes (to some extent) the concept of the
lucene analyser, since the mapper can decide on custom distribution of, for
example, strings and category indexes.

For both of these indexes, you configure the index up front, and then only
call index.add(node) to index a node. This will fit in well with the new
auto-indexing ideas in neo4j.

On Wed, Jun 29, 2011 at 2:25 PM, Niels Hoogeveen
pd_aficion...@hotmail.comwrote:






 At this moment Btree only supports the primitive datatype long, while Rtree
 only supports the datatype double. For Btree it makes sense to at least
 support strings, floats, doubles and ints too. Use cases for these data
 types are pretty obvious and are Btree backed in (almost) every RDBMS
 product around.I think the best solution would be to create Comparator
 objects wrapping these primitive data types and store the class name of the
 comparator in root of the index tree. This allows users to create their own
 comparators for datatypes not covered yet. It would make sense people would
 want to store BigInt and BigDecimal objects in a Btree too, others may want
 to store dates (instead of datetime), fractions, complex numbers or even
 more exotic data types.
 Niels
  From: sxk1...@hotmail.com
  To: user@lists.neo4j.org
  Date: Tue, 28 Jun 2011 22:43:24 -0700
  Subject: Re: [Neo4j] neo4j-graph-collections
 
 
  I've read through this thread in more detail and have a few thoughts,
 when you talk about type I am assuming that you are referring to an
 interface that both (Btree,Rtree) can implement, for the data types I'd like
 to understand the use cases first before implementing the different data
 types, maybe we could store types of Object instead of Long or Double and
 implement comparators in a more meaningful fashion.   Also I was wondering
 if unit tests would need to be extracted out of the spatial component and
 embedded inside the graph-collections component as well or whether we'd
 potentially need to write brand new unit tests as well.
  Craig as I mentioned I'd love to help, let me know if it would be
 possible to fork a repo or to talk in more detail this week.
  Regards
 
   From: pd_aficion...@hotmail.com
   To: user@lists.neo4j.org
   Date: Wed, 29 Jun 2011 01:35:43 +0200
   Subject: Re: [Neo4j] neo4j-graph-collections
  
  
   As to the issue of n-dim doubles, it would be interesting to consider
 creating a set of classes of type Orderable (supporting , =, , =
 operations), this we can use in both Rtree and Btree. Right now Btree only
 supports datatype Long. This should also become more generic. A first step
 we can take is at least wrap the common datatypes in Orderable classes.
   Niels
  
Date: Wed, 29 Jun 2011 00:32:15 +0200
From: cr...@amanzi.com
To: user@lists.neo4j.org
Subject: Re: [Neo4j] neo4j-graph-collections
   
The RTree in principle should be generalizable, but the current
implementation in neo4j-spatial does make a few assumptions specific
 to
spatial data, and makes use of spatial envelopes for the tree node
 bounding
boxes. It is also specific to 2D. We could make a few improvements
 first,
like generalizing to n-dimensions, replacing the recursive search
 with a
traverser and generalizing the bounding boxes to be simple
 double-arrays.
Then the only thing left would be to decide if it is ok for it to be
 based
on n-dim doubles or should be generalized to more types.
   
On Tue, Jun 28, 2011 at 11:14 PM, Saikat Kanjilal 
 sxk1...@hotmail.comwrote:
   
 I would be interested in helping out with this, let me know next
 steps.

 Sent from my iPhone

 On Jun 28, 2011, at 8:49 AM, Niels Hoogeveen 
 pd_aficion...@hotmail.com
 wrote:

 
  A couple of weeks ago Peter Neubauer set up a repository for
 in-graph

Re: [Neo4j] neo4j-graph-collections

2011-06-29 Thread Niels Hoogeveen

Craig,
Would it be possible to merge your work on Amanzi with the work the Neo team 
has done on the Btree component that is now in neo4j-graph-collections, so we 
can eventually have one implementation that meets a broad variety of needs?
Niels

 Date: Wed, 29 Jun 2011 15:34:47 +0200
 From: cr...@amanzi.com
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] neo4j-graph-collections
 
 I have previously used two solutions to deal with multiple types in btrees:
 
- My first index in 2009 was a btree-like n-dim index using generics to
support int[], long[], float[] and double[] (no strings). I used this for
TimeLine (long[1]) and Location (double[2]). The knowledge about what type
was used was in the code for constructing the index (whether a new index or
accessing an existing index in the graph).
- In December I started my amanzi-index (on
 githubhttps://github.com/craigtaverner/amanzi-index)
that is also btree-like, n-dimensional. But this time it can index multiple
types in the same tree (so a float, int and string in the same tree, 
 instead
of being forced to have all properties of the same type). It is a re-write
of the previous index to support Strings, and mixed types. This time it 
 does
save the type information in meta-data at the tree root.
 
 The idea of using a 'comparator' class for the types is similar, but simpler
 than the idea I implemented for amanzi-index, where I have mapper classes
 that describe not only how to compare types, but also how to map from values
 to index keys and back. This includes (to some extent) the concept of the
 lucene analyser, since the mapper can decide on custom distribution of, for
 example, strings and category indexes.
 
 For both of these indexes, you configure the index up front, and then only
 call index.add(node) to index a node. This will fit in well with the new
 auto-indexing ideas in neo4j.
 
 On Wed, Jun 29, 2011 at 2:25 PM, Niels Hoogeveen
 pd_aficion...@hotmail.comwrote:
 
 
 
 
 
 
  At this moment Btree only supports the primitive datatype long, while Rtree
  only supports the datatype double. For Btree it makes sense to at least
  support strings, floats, doubles and ints too. Use cases for these data
  types are pretty obvious and are Btree backed in (almost) every RDBMS
  product around.I think the best solution would be to create Comparator
  objects wrapping these primitive data types and store the class name of the
  comparator in root of the index tree. This allows users to create their own
  comparators for datatypes not covered yet. It would make sense people would
  want to store BigInt and BigDecimal objects in a Btree too, others may want
  to store dates (instead of datetime), fractions, complex numbers or even
  more exotic data types.
  Niels
   From: sxk1...@hotmail.com
   To: user@lists.neo4j.org
   Date: Tue, 28 Jun 2011 22:43:24 -0700
   Subject: Re: [Neo4j] neo4j-graph-collections
  
  
   I've read through this thread in more detail and have a few thoughts,
  when you talk about type I am assuming that you are referring to an
  interface that both (Btree,Rtree) can implement, for the data types I'd like
  to understand the use cases first before implementing the different data
  types, maybe we could store types of Object instead of Long or Double and
  implement comparators in a more meaningful fashion.   Also I was wondering
  if unit tests would need to be extracted out of the spatial component and
  embedded inside the graph-collections component as well or whether we'd
  potentially need to write brand new unit tests as well.
   Craig as I mentioned I'd love to help, let me know if it would be
  possible to fork a repo or to talk in more detail this week.
   Regards
  
From: pd_aficion...@hotmail.com
To: user@lists.neo4j.org
Date: Wed, 29 Jun 2011 01:35:43 +0200
Subject: Re: [Neo4j] neo4j-graph-collections
   
   
As to the issue of n-dim doubles, it would be interesting to consider
  creating a set of classes of type Orderable (supporting , =, , =
  operations), this we can use in both Rtree and Btree. Right now Btree only
  supports datatype Long. This should also become more generic. A first step
  we can take is at least wrap the common datatypes in Orderable classes.
Niels
   
 Date: Wed, 29 Jun 2011 00:32:15 +0200
 From: cr...@amanzi.com
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] neo4j-graph-collections

 The RTree in principle should be generalizable, but the current
 implementation in neo4j-spatial does make a few assumptions specific
  to
 spatial data, and makes use of spatial envelopes for the tree node
  bounding
 boxes. It is also specific to 2D. We could make a few improvements
  first,
 like generalizing to n-dimensions, replacing the recursive search
  with a
 traverser and generalizing the bounding boxes to be simple
  double-arrays.
 Then the only thing left would be to decide

Re: [Neo4j] neo4j-graph-collections

2011-06-29 Thread Peter Neubauer
Craig,
just gave you push access to the graph collections in case you want to
do anything there.

Also, IMHO it would be more important to isolate and split out the
RTree component from Spatial than to optimize it - that could be done
in the new place with targeted performance tests later?

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://startupbootcamp.org/    - Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



On Wed, Jun 29, 2011 at 4:19 PM, Niels Hoogeveen
pd_aficion...@hotmail.com wrote:

 Craig,
 Would it be possible to merge your work on Amanzi with the work the Neo team 
 has done on the Btree component that is now in neo4j-graph-collections, so we 
 can eventually have one implementation that meets a broad variety of needs?
 Niels

 Date: Wed, 29 Jun 2011 15:34:47 +0200
 From: cr...@amanzi.com
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] neo4j-graph-collections

 I have previously used two solutions to deal with multiple types in btrees:

    - My first index in 2009 was a btree-like n-dim index using generics to
    support int[], long[], float[] and double[] (no strings). I used this for
    TimeLine (long[1]) and Location (double[2]). The knowledge about what type
    was used was in the code for constructing the index (whether a new index 
 or
    accessing an existing index in the graph).
    - In December I started my amanzi-index (on
 githubhttps://github.com/craigtaverner/amanzi-index)
    that is also btree-like, n-dimensional. But this time it can index 
 multiple
    types in the same tree (so a float, int and string in the same tree, 
 instead
    of being forced to have all properties of the same type). It is a re-write
    of the previous index to support Strings, and mixed types. This time it 
 does
    save the type information in meta-data at the tree root.

 The idea of using a 'comparator' class for the types is similar, but simpler
 than the idea I implemented for amanzi-index, where I have mapper classes
 that describe not only how to compare types, but also how to map from values
 to index keys and back. This includes (to some extent) the concept of the
 lucene analyser, since the mapper can decide on custom distribution of, for
 example, strings and category indexes.

 For both of these indexes, you configure the index up front, and then only
 call index.add(node) to index a node. This will fit in well with the new
 auto-indexing ideas in neo4j.

 On Wed, Jun 29, 2011 at 2:25 PM, Niels Hoogeveen
 pd_aficion...@hotmail.comwrote:

 
 
 
 
 
  At this moment Btree only supports the primitive datatype long, while Rtree
  only supports the datatype double. For Btree it makes sense to at least
  support strings, floats, doubles and ints too. Use cases for these data
  types are pretty obvious and are Btree backed in (almost) every RDBMS
  product around.I think the best solution would be to create Comparator
  objects wrapping these primitive data types and store the class name of the
  comparator in root of the index tree. This allows users to create their own
  comparators for datatypes not covered yet. It would make sense people would
  want to store BigInt and BigDecimal objects in a Btree too, others may want
  to store dates (instead of datetime), fractions, complex numbers or even
  more exotic data types.
  Niels
   From: sxk1...@hotmail.com
   To: user@lists.neo4j.org
   Date: Tue, 28 Jun 2011 22:43:24 -0700
   Subject: Re: [Neo4j] neo4j-graph-collections
  
  
   I've read through this thread in more detail and have a few thoughts,
  when you talk about type I am assuming that you are referring to an
  interface that both (Btree,Rtree) can implement, for the data types I'd 
  like
  to understand the use cases first before implementing the different data
  types, maybe we could store types of Object instead of Long or Double and
  implement comparators in a more meaningful fashion.   Also I was wondering
  if unit tests would need to be extracted out of the spatial component and
  embedded inside the graph-collections component as well or whether we'd
  potentially need to write brand new unit tests as well.
   Craig as I mentioned I'd love to help, let me know if it would be
  possible to fork a repo or to talk in more detail this week.
   Regards
  
From: pd_aficion...@hotmail.com
To: user@lists.neo4j.org
Date: Wed, 29 Jun 2011 01:35:43 +0200
Subject: Re: [Neo4j] neo4j-graph-collections
   
   
As to the issue of n-dim doubles, it would be interesting to consider
  creating a set of classes of type Orderable (supporting , =, , =
  operations), this we can use in both Rtree and Btree. Right now Btree only
  supports datatype Long. This should also become

Re: [Neo4j] neo4j-graph-collections

2011-06-29 Thread Niels Hoogeveen

Peter, I totally agree. Having the Rtree index removed of spatial dependencies 
in graph-collections should be our first priority. Once that is done we can 
focus on the other issues.
Which doesn't mean we should stop discussing future improvements like setting 
up comparators (or something to that extent) that can be reusable, but we 
shouldn't try to get that up before Rtree is in graph-collections.
Niels

 From: peter.neuba...@neotechnology.com
 Date: Wed, 29 Jun 2011 21:10:15 +0200
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] neo4j-graph-collections
 
 Craig,
 just gave you push access to the graph collections in case you want to
 do anything there.
 
 Also, IMHO it would be more important to isolate and split out the
 RTree component from Spatial than to optimize it - that could be done
 in the new place with targeted performance tests later?
 
 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://startupbootcamp.org/- Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
 
 
 
 On Wed, Jun 29, 2011 at 4:19 PM, Niels Hoogeveen
 pd_aficion...@hotmail.com wrote:
 
  Craig,
  Would it be possible to merge your work on Amanzi with the work the Neo 
  team has done on the Btree component that is now in 
  neo4j-graph-collections, so we can eventually have one implementation that 
  meets a broad variety of needs?
  Niels
 
  Date: Wed, 29 Jun 2011 15:34:47 +0200
  From: cr...@amanzi.com
  To: user@lists.neo4j.org
  Subject: Re: [Neo4j] neo4j-graph-collections
 
  I have previously used two solutions to deal with multiple types in btrees:
 
 - My first index in 2009 was a btree-like n-dim index using generics to
 support int[], long[], float[] and double[] (no strings). I used this 
  for
 TimeLine (long[1]) and Location (double[2]). The knowledge about what 
  type
 was used was in the code for constructing the index (whether a new 
  index or
 accessing an existing index in the graph).
 - In December I started my amanzi-index (on
  githubhttps://github.com/craigtaverner/amanzi-index)
 that is also btree-like, n-dimensional. But this time it can index 
  multiple
 types in the same tree (so a float, int and string in the same tree, 
  instead
 of being forced to have all properties of the same type). It is a 
  re-write
 of the previous index to support Strings, and mixed types. This time it 
  does
 save the type information in meta-data at the tree root.
 
  The idea of using a 'comparator' class for the types is similar, but 
  simpler
  than the idea I implemented for amanzi-index, where I have mapper classes
  that describe not only how to compare types, but also how to map from 
  values
  to index keys and back. This includes (to some extent) the concept of the
  lucene analyser, since the mapper can decide on custom distribution of, for
  example, strings and category indexes.
 
  For both of these indexes, you configure the index up front, and then only
  call index.add(node) to index a node. This will fit in well with the new
  auto-indexing ideas in neo4j.
 
  On Wed, Jun 29, 2011 at 2:25 PM, Niels Hoogeveen
  pd_aficion...@hotmail.comwrote:
 
  
  
  
  
  
   At this moment Btree only supports the primitive datatype long, while 
   Rtree
   only supports the datatype double. For Btree it makes sense to at least
   support strings, floats, doubles and ints too. Use cases for these data
   types are pretty obvious and are Btree backed in (almost) every RDBMS
   product around.I think the best solution would be to create Comparator
   objects wrapping these primitive data types and store the class name of 
   the
   comparator in root of the index tree. This allows users to create their 
   own
   comparators for datatypes not covered yet. It would make sense people 
   would
   want to store BigInt and BigDecimal objects in a Btree too, others may 
   want
   to store dates (instead of datetime), fractions, complex numbers or even
   more exotic data types.
   Niels
From: sxk1...@hotmail.com
To: user@lists.neo4j.org
Date: Tue, 28 Jun 2011 22:43:24 -0700
Subject: Re: [Neo4j] neo4j-graph-collections
   
   
I've read through this thread in more detail and have a few thoughts,
   when you talk about type I am assuming that you are referring to an
   interface that both (Btree,Rtree) can implement, for the data types I'd 
   like
   to understand the use cases first before implementing the different data
   types, maybe we could store types of Object instead of Long or Double and
   implement comparators in a more meaningful fashion.   Also I was 
   wondering
   if unit tests would need to be extracted out of the spatial component

Re: [Neo4j] neo4j-graph-collections

2011-06-29 Thread Craig Taverner
It is technically possible, but it is a somewhat specialized index, not a
normal BTree, so I think you would want both (mine and a classic btree). My
index performs better for certain data patterns, is best with semi-ordered
data and moderately even distributions (since it has no rebalancing), and
requires the developer to pick a good starting 'resolution' which means they
should know something about their data. Perhaps we just port some of the
typing support into a btree in the collections project?

On Wed, Jun 29, 2011 at 4:19 PM, Niels Hoogeveen
pd_aficion...@hotmail.comwrote:


 Craig,
 Would it be possible to merge your work on Amanzi with the work the Neo
 team has done on the Btree component that is now in neo4j-graph-collections,
 so we can eventually have one implementation that meets a broad variety of
 needs?
 Niels

  Date: Wed, 29 Jun 2011 15:34:47 +0200
  From: cr...@amanzi.com
  To: user@lists.neo4j.org
  Subject: Re: [Neo4j] neo4j-graph-collections
 
  I have previously used two solutions to deal with multiple types in
 btrees:
 
 - My first index in 2009 was a btree-like n-dim index using generics
 to
 support int[], long[], float[] and double[] (no strings). I used this
 for
 TimeLine (long[1]) and Location (double[2]). The knowledge about what
 type
 was used was in the code for constructing the index (whether a new
 index or
 accessing an existing index in the graph).
 - In December I started my amanzi-index (on
  githubhttps://github.com/craigtaverner/amanzi-index)
 that is also btree-like, n-dimensional. But this time it can index
 multiple
 types in the same tree (so a float, int and string in the same tree,
 instead
 of being forced to have all properties of the same type). It is a
 re-write
 of the previous index to support Strings, and mixed types. This time
 it does
 save the type information in meta-data at the tree root.
 
  The idea of using a 'comparator' class for the types is similar, but
 simpler
  than the idea I implemented for amanzi-index, where I have mapper classes
  that describe not only how to compare types, but also how to map from
 values
  to index keys and back. This includes (to some extent) the concept of the
  lucene analyser, since the mapper can decide on custom distribution of,
 for
  example, strings and category indexes.
 
  For both of these indexes, you configure the index up front, and then
 only
  call index.add(node) to index a node. This will fit in well with the new
  auto-indexing ideas in neo4j.
 
  On Wed, Jun 29, 2011 at 2:25 PM, Niels Hoogeveen
  pd_aficion...@hotmail.comwrote:
 
  
  
  
  
  
   At this moment Btree only supports the primitive datatype long, while
 Rtree
   only supports the datatype double. For Btree it makes sense to at least
   support strings, floats, doubles and ints too. Use cases for these data
   types are pretty obvious and are Btree backed in (almost) every RDBMS
   product around.I think the best solution would be to create Comparator
   objects wrapping these primitive data types and store the class name of
 the
   comparator in root of the index tree. This allows users to create their
 own
   comparators for datatypes not covered yet. It would make sense people
 would
   want to store BigInt and BigDecimal objects in a Btree too, others may
 want
   to store dates (instead of datetime), fractions, complex numbers or
 even
   more exotic data types.
   Niels
From: sxk1...@hotmail.com
To: user@lists.neo4j.org
Date: Tue, 28 Jun 2011 22:43:24 -0700
Subject: Re: [Neo4j] neo4j-graph-collections
   
   
I've read through this thread in more detail and have a few thoughts,
   when you talk about type I am assuming that you are referring to an
   interface that both (Btree,Rtree) can implement, for the data types I'd
 like
   to understand the use cases first before implementing the different
 data
   types, maybe we could store types of Object instead of Long or Double
 and
   implement comparators in a more meaningful fashion.   Also I was
 wondering
   if unit tests would need to be extracted out of the spatial component
 and
   embedded inside the graph-collections component as well or whether we'd
   potentially need to write brand new unit tests as well.
Craig as I mentioned I'd love to help, let me know if it would be
   possible to fork a repo or to talk in more detail this week.
Regards
   
 From: pd_aficion...@hotmail.com
 To: user@lists.neo4j.org
 Date: Wed, 29 Jun 2011 01:35:43 +0200
 Subject: Re: [Neo4j] neo4j-graph-collections


 As to the issue of n-dim doubles, it would be interesting to
 consider
   creating a set of classes of type Orderable (supporting , =, , =
   operations), this we can use in both Rtree and Btree. Right now Btree
 only
   supports datatype Long. This should also become more generic. A first
 step
   we can take is at least wrap the common datatypes in Orderable classes.
 Niels

Re: [Neo4j] neo4j-graph-collections

2011-06-29 Thread Craig Taverner
I think moving the RTree to the generic collections would not be too hard. I
saw Saikat showed interested in doing this himself.

Saikat, contact me off-list for further details on what I think could be
done to make this port.

On Wed, Jun 29, 2011 at 9:52 PM, Niels Hoogeveen
pd_aficion...@hotmail.comwrote:


 Peter, I totally agree. Having the Rtree index removed of spatial
 dependencies in graph-collections should be our first priority. Once that is
 done we can focus on the other issues.
 Which doesn't mean we should stop discussing future improvements like
 setting up comparators (or something to that extent) that can be reusable,
 but we shouldn't try to get that up before Rtree is in graph-collections.
 Niels

  From: peter.neuba...@neotechnology.com
  Date: Wed, 29 Jun 2011 21:10:15 +0200
  To: user@lists.neo4j.org
  Subject: Re: [Neo4j] neo4j-graph-collections
 
  Craig,
  just gave you push access to the graph collections in case you want to
  do anything there.
 
  Also, IMHO it would be more important to isolate and split out the
  RTree component from Spatial than to optimize it - that could be done
  in the new place with targeted performance tests later?
 
  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://startupbootcamp.org/- Öresund - Innovation happens HERE.
  http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
 
 
 
  On Wed, Jun 29, 2011 at 4:19 PM, Niels Hoogeveen
  pd_aficion...@hotmail.com wrote:
  
   Craig,
   Would it be possible to merge your work on Amanzi with the work the Neo
 team has done on the Btree component that is now in neo4j-graph-collections,
 so we can eventually have one implementation that meets a broad variety of
 needs?
   Niels
  
   Date: Wed, 29 Jun 2011 15:34:47 +0200
   From: cr...@amanzi.com
   To: user@lists.neo4j.org
   Subject: Re: [Neo4j] neo4j-graph-collections
  
   I have previously used two solutions to deal with multiple types in
 btrees:
  
  - My first index in 2009 was a btree-like n-dim index using
 generics to
  support int[], long[], float[] and double[] (no strings). I used
 this for
  TimeLine (long[1]) and Location (double[2]). The knowledge about
 what type
  was used was in the code for constructing the index (whether a new
 index or
  accessing an existing index in the graph).
  - In December I started my amanzi-index (on
   githubhttps://github.com/craigtaverner/amanzi-index)
  that is also btree-like, n-dimensional. But this time it can index
 multiple
  types in the same tree (so a float, int and string in the same
 tree, instead
  of being forced to have all properties of the same type). It is a
 re-write
  of the previous index to support Strings, and mixed types. This
 time it does
  save the type information in meta-data at the tree root.
  
   The idea of using a 'comparator' class for the types is similar, but
 simpler
   than the idea I implemented for amanzi-index, where I have mapper
 classes
   that describe not only how to compare types, but also how to map from
 values
   to index keys and back. This includes (to some extent) the concept of
 the
   lucene analyser, since the mapper can decide on custom distribution
 of, for
   example, strings and category indexes.
  
   For both of these indexes, you configure the index up front, and then
 only
   call index.add(node) to index a node. This will fit in well with the
 new
   auto-indexing ideas in neo4j.
  
   On Wed, Jun 29, 2011 at 2:25 PM, Niels Hoogeveen
   pd_aficion...@hotmail.comwrote:
  
   
   
   
   
   
At this moment Btree only supports the primitive datatype long,
 while Rtree
only supports the datatype double. For Btree it makes sense to at
 least
support strings, floats, doubles and ints too. Use cases for these
 data
types are pretty obvious and are Btree backed in (almost) every
 RDBMS
product around.I think the best solution would be to create
 Comparator
objects wrapping these primitive data types and store the class name
 of the
comparator in root of the index tree. This allows users to create
 their own
comparators for datatypes not covered yet. It would make sense
 people would
want to store BigInt and BigDecimal objects in a Btree too, others
 may want
to store dates (instead of datetime), fractions, complex numbers or
 even
more exotic data types.
Niels
 From: sxk1...@hotmail.com
 To: user@lists.neo4j.org
 Date: Tue, 28 Jun 2011 22:43:24 -0700
 Subject: Re: [Neo4j] neo4j-graph-collections


 I've read through this thread in more detail and have a few
 thoughts,
when you talk about type I am assuming that you are referring to an
interface that both

Re: [Neo4j] neo4j-graph-collections

2011-06-29 Thread Saikat Kanjilal
I'm definitely interested and will contact you soon to follow up.

Sent from my iPhone

On Jun 29, 2011, at 4:17 PM, Craig Taverner cr...@amanzi.com wrote:

 I think moving the RTree to the generic collections would not be too hard. I
 saw Saikat showed interested in doing this himself.
 
 Saikat, contact me off-list for further details on what I think could be
 done to make this port.
 
 On Wed, Jun 29, 2011 at 9:52 PM, Niels Hoogeveen
 pd_aficion...@hotmail.comwrote:
 
 
 Peter, I totally agree. Having the Rtree index removed of spatial
 dependencies in graph-collections should be our first priority. Once that is
 done we can focus on the other issues.
 Which doesn't mean we should stop discussing future improvements like
 setting up comparators (or something to that extent) that can be reusable,
 but we shouldn't try to get that up before Rtree is in graph-collections.
 Niels
 
 From: peter.neuba...@neotechnology.com
 Date: Wed, 29 Jun 2011 21:10:15 +0200
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] neo4j-graph-collections
 
 Craig,
 just gave you push access to the graph collections in case you want to
 do anything there.
 
 Also, IMHO it would be more important to isolate and split out the
 RTree component from Spatial than to optimize it - that could be done
 in the new place with targeted performance tests later?
 
 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://startupbootcamp.org/- Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
 
 
 
 On Wed, Jun 29, 2011 at 4:19 PM, Niels Hoogeveen
 pd_aficion...@hotmail.com wrote:
 
 Craig,
 Would it be possible to merge your work on Amanzi with the work the Neo
 team has done on the Btree component that is now in neo4j-graph-collections,
 so we can eventually have one implementation that meets a broad variety of
 needs?
 Niels
 
 Date: Wed, 29 Jun 2011 15:34:47 +0200
 From: cr...@amanzi.com
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] neo4j-graph-collections
 
 I have previously used two solutions to deal with multiple types in
 btrees:
 
   - My first index in 2009 was a btree-like n-dim index using
 generics to
   support int[], long[], float[] and double[] (no strings). I used
 this for
   TimeLine (long[1]) and Location (double[2]). The knowledge about
 what type
   was used was in the code for constructing the index (whether a new
 index or
   accessing an existing index in the graph).
   - In December I started my amanzi-index (on
 githubhttps://github.com/craigtaverner/amanzi-index)
   that is also btree-like, n-dimensional. But this time it can index
 multiple
   types in the same tree (so a float, int and string in the same
 tree, instead
   of being forced to have all properties of the same type). It is a
 re-write
   of the previous index to support Strings, and mixed types. This
 time it does
   save the type information in meta-data at the tree root.
 
 The idea of using a 'comparator' class for the types is similar, but
 simpler
 than the idea I implemented for amanzi-index, where I have mapper
 classes
 that describe not only how to compare types, but also how to map from
 values
 to index keys and back. This includes (to some extent) the concept of
 the
 lucene analyser, since the mapper can decide on custom distribution
 of, for
 example, strings and category indexes.
 
 For both of these indexes, you configure the index up front, and then
 only
 call index.add(node) to index a node. This will fit in well with the
 new
 auto-indexing ideas in neo4j.
 
 On Wed, Jun 29, 2011 at 2:25 PM, Niels Hoogeveen
 pd_aficion...@hotmail.comwrote:
 
 
 
 
 
 
 At this moment Btree only supports the primitive datatype long,
 while Rtree
 only supports the datatype double. For Btree it makes sense to at
 least
 support strings, floats, doubles and ints too. Use cases for these
 data
 types are pretty obvious and are Btree backed in (almost) every
 RDBMS
 product around.I think the best solution would be to create
 Comparator
 objects wrapping these primitive data types and store the class name
 of the
 comparator in root of the index tree. This allows users to create
 their own
 comparators for datatypes not covered yet. It would make sense
 people would
 want to store BigInt and BigDecimal objects in a Btree too, others
 may want
 to store dates (instead of datetime), fractions, complex numbers or
 even
 more exotic data types.
 Niels
 From: sxk1...@hotmail.com
 To: user@lists.neo4j.org
 Date: Tue, 28 Jun 2011 22:43:24 -0700
 Subject: Re: [Neo4j] neo4j-graph-collections
 
 
 I've read through this thread in more detail and have a few
 thoughts,
 when you talk about type I am assuming that you are referring to an
 interface that both (Btree,Rtree

Re: [Neo4j] neo4j-graph-collections

2011-06-29 Thread Niels Hoogeveen

Let me first look into the details of the current Btree implementation and see 
how it can be expanded to other datatypes, then look into your typing support 
in Amanzi and figure out if they match. If so we can port those parts to 
graph-collections.

 Date: Thu, 30 Jun 2011 01:15:31 +0200
 From: cr...@amanzi.com
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] neo4j-graph-collections
 
 It is technically possible, but it is a somewhat specialized index, not a
 normal BTree, so I think you would want both (mine and a classic btree). My
 index performs better for certain data patterns, is best with semi-ordered
 data and moderately even distributions (since it has no rebalancing), and
 requires the developer to pick a good starting 'resolution' which means they
 should know something about their data. Perhaps we just port some of the
 typing support into a btree in the collections project?
 
 On Wed, Jun 29, 2011 at 4:19 PM, Niels Hoogeveen
 pd_aficion...@hotmail.comwrote:
 
 
  Craig,
  Would it be possible to merge your work on Amanzi with the work the Neo
  team has done on the Btree component that is now in neo4j-graph-collections,
  so we can eventually have one implementation that meets a broad variety of
  needs?
  Niels
 
   Date: Wed, 29 Jun 2011 15:34:47 +0200
   From: cr...@amanzi.com
   To: user@lists.neo4j.org
   Subject: Re: [Neo4j] neo4j-graph-collections
  
   I have previously used two solutions to deal with multiple types in
  btrees:
  
  - My first index in 2009 was a btree-like n-dim index using generics
  to
  support int[], long[], float[] and double[] (no strings). I used this
  for
  TimeLine (long[1]) and Location (double[2]). The knowledge about what
  type
  was used was in the code for constructing the index (whether a new
  index or
  accessing an existing index in the graph).
  - In December I started my amanzi-index (on
   githubhttps://github.com/craigtaverner/amanzi-index)
  that is also btree-like, n-dimensional. But this time it can index
  multiple
  types in the same tree (so a float, int and string in the same tree,
  instead
  of being forced to have all properties of the same type). It is a
  re-write
  of the previous index to support Strings, and mixed types. This time
  it does
  save the type information in meta-data at the tree root.
  
   The idea of using a 'comparator' class for the types is similar, but
  simpler
   than the idea I implemented for amanzi-index, where I have mapper classes
   that describe not only how to compare types, but also how to map from
  values
   to index keys and back. This includes (to some extent) the concept of the
   lucene analyser, since the mapper can decide on custom distribution of,
  for
   example, strings and category indexes.
  
   For both of these indexes, you configure the index up front, and then
  only
   call index.add(node) to index a node. This will fit in well with the new
   auto-indexing ideas in neo4j.
  
   On Wed, Jun 29, 2011 at 2:25 PM, Niels Hoogeveen
   pd_aficion...@hotmail.comwrote:
  
   
   
   
   
   
At this moment Btree only supports the primitive datatype long, while
  Rtree
only supports the datatype double. For Btree it makes sense to at least
support strings, floats, doubles and ints too. Use cases for these data
types are pretty obvious and are Btree backed in (almost) every RDBMS
product around.I think the best solution would be to create Comparator
objects wrapping these primitive data types and store the class name of
  the
comparator in root of the index tree. This allows users to create their
  own
comparators for datatypes not covered yet. It would make sense people
  would
want to store BigInt and BigDecimal objects in a Btree too, others may
  want
to store dates (instead of datetime), fractions, complex numbers or
  even
more exotic data types.
Niels
 From: sxk1...@hotmail.com
 To: user@lists.neo4j.org
 Date: Tue, 28 Jun 2011 22:43:24 -0700
 Subject: Re: [Neo4j] neo4j-graph-collections


 I've read through this thread in more detail and have a few thoughts,
when you talk about type I am assuming that you are referring to an
interface that both (Btree,Rtree) can implement, for the data types I'd
  like
to understand the use cases first before implementing the different
  data
types, maybe we could store types of Object instead of Long or Double
  and
implement comparators in a more meaningful fashion.   Also I was
  wondering
if unit tests would need to be extracted out of the spatial component
  and
embedded inside the graph-collections component as well or whether we'd
potentially need to write brand new unit tests as well.
 Craig as I mentioned I'd love to help, let me know if it would be
possible to fork a repo or to talk in more detail this week.
 Regards

  From: pd_aficion...@hotmail.com
  To: user

Re: [Neo4j] neo4j-graph-collections

2011-06-29 Thread Niels Hoogeveen

Great... Looking forward to your contributions. Once the port is done, we can 
look at making improvements.

 From: sxk1...@hotmail.com
 Date: Wed, 29 Jun 2011 16:34:39 -0700
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] neo4j-graph-collections
 
 I'm definitely interested and will contact you soon to follow up.
 
 Sent from my iPhone
 
 On Jun 29, 2011, at 4:17 PM, Craig Taverner cr...@amanzi.com wrote:
 
  I think moving the RTree to the generic collections would not be too hard. I
  saw Saikat showed interested in doing this himself.
  
  Saikat, contact me off-list for further details on what I think could be
  done to make this port.
  
  On Wed, Jun 29, 2011 at 9:52 PM, Niels Hoogeveen
  pd_aficion...@hotmail.comwrote:
  
  
  Peter, I totally agree. Having the Rtree index removed of spatial
  dependencies in graph-collections should be our first priority. Once that 
  is
  done we can focus on the other issues.
  Which doesn't mean we should stop discussing future improvements like
  setting up comparators (or something to that extent) that can be reusable,
  but we shouldn't try to get that up before Rtree is in graph-collections.
  Niels
  
  From: peter.neuba...@neotechnology.com
  Date: Wed, 29 Jun 2011 21:10:15 +0200
  To: user@lists.neo4j.org
  Subject: Re: [Neo4j] neo4j-graph-collections
  
  Craig,
  just gave you push access to the graph collections in case you want to
  do anything there.
  
  Also, IMHO it would be more important to isolate and split out the
  RTree component from Spatial than to optimize it - that could be done
  in the new place with targeted performance tests later?
  
  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://startupbootcamp.org/- Öresund - Innovation happens HERE.
  http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
  
  
  
  On Wed, Jun 29, 2011 at 4:19 PM, Niels Hoogeveen
  pd_aficion...@hotmail.com wrote:
  
  Craig,
  Would it be possible to merge your work on Amanzi with the work the Neo
  team has done on the Btree component that is now in 
  neo4j-graph-collections,
  so we can eventually have one implementation that meets a broad variety of
  needs?
  Niels
  
  Date: Wed, 29 Jun 2011 15:34:47 +0200
  From: cr...@amanzi.com
  To: user@lists.neo4j.org
  Subject: Re: [Neo4j] neo4j-graph-collections
  
  I have previously used two solutions to deal with multiple types in
  btrees:
  
- My first index in 2009 was a btree-like n-dim index using
  generics to
support int[], long[], float[] and double[] (no strings). I used
  this for
TimeLine (long[1]) and Location (double[2]). The knowledge about
  what type
was used was in the code for constructing the index (whether a new
  index or
accessing an existing index in the graph).
- In December I started my amanzi-index (on
  githubhttps://github.com/craigtaverner/amanzi-index)
that is also btree-like, n-dimensional. But this time it can index
  multiple
types in the same tree (so a float, int and string in the same
  tree, instead
of being forced to have all properties of the same type). It is a
  re-write
of the previous index to support Strings, and mixed types. This
  time it does
save the type information in meta-data at the tree root.
  
  The idea of using a 'comparator' class for the types is similar, but
  simpler
  than the idea I implemented for amanzi-index, where I have mapper
  classes
  that describe not only how to compare types, but also how to map from
  values
  to index keys and back. This includes (to some extent) the concept of
  the
  lucene analyser, since the mapper can decide on custom distribution
  of, for
  example, strings and category indexes.
  
  For both of these indexes, you configure the index up front, and then
  only
  call index.add(node) to index a node. This will fit in well with the
  new
  auto-indexing ideas in neo4j.
  
  On Wed, Jun 29, 2011 at 2:25 PM, Niels Hoogeveen
  pd_aficion...@hotmail.comwrote:
  
  
  
  
  
  
  At this moment Btree only supports the primitive datatype long,
  while Rtree
  only supports the datatype double. For Btree it makes sense to at
  least
  support strings, floats, doubles and ints too. Use cases for these
  data
  types are pretty obvious and are Btree backed in (almost) every
  RDBMS
  product around.I think the best solution would be to create
  Comparator
  objects wrapping these primitive data types and store the class name
  of the
  comparator in root of the index tree. This allows users to create
  their own
  comparators for datatypes not covered yet. It would make sense
  people would
  want to store BigInt and BigDecimal objects in a Btree too, others
  may want
  to store dates (instead

Re: [Neo4j] neo4j-graph-collections

2011-06-28 Thread Craig Taverner
The RTree in principle should be generalizable, but the current
implementation in neo4j-spatial does make a few assumptions specific to
spatial data, and makes use of spatial envelopes for the tree node bounding
boxes. It is also specific to 2D. We could make a few improvements first,
like generalizing to n-dimensions, replacing the recursive search with a
traverser and generalizing the bounding boxes to be simple double-arrays.
Then the only thing left would be to decide if it is ok for it to be based
on n-dim doubles or should be generalized to more types.

On Tue, Jun 28, 2011 at 11:14 PM, Saikat Kanjilal sxk1...@hotmail.comwrote:

 I would be interested in helping out with this, let me know next steps.

 Sent from my iPhone

 On Jun 28, 2011, at 8:49 AM, Niels Hoogeveen pd_aficion...@hotmail.com
 wrote:

 
  A couple of weeks ago Peter Neubauer set up a repository for in-graph
 datastructures: https://github.com/peterneubauer/graph-collections.
  At this time of writing only the Btree/Timeline index is part of this
 component.
  In my opinion it would be interesting to move the Rtree parts of
 neo-spatial to neo4j-graph-collections too.
  I looked at the code but don't feel competent to seperate out those
 classes that support generic Rtrees from those classes that are clearly
 spatial related.
  Is there any enthusiasm for such a project and if so, who is willing and
 able to do this?
  Niels
 
 
 
  ___
  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-graph-collections

2011-06-28 Thread Niels Hoogeveen

Peter would have to grant you rights to his repo and I bet he will have some 
ideas of his own to add to my suggestions.
You would need to flesh out what parts of neo4j-spatial are actually generic 
Rtree classes (making sure there are no dependencies to geotools). It would be 
nice if the Rtree classes ending up in neo4j-collections would really be a 
multi-dimensional index component that is independent of its usage as an index 
for geographical information, so it can be used for other multi-dimensional 
search actions that are not necessarily geographical in nature.
Together with the people responsible for the Lucene index component we have to 
find a common way to access the Rtree and the Btree index, so it can all 
eventually become part of the indexing framework, but i'd consider that step 2.
Niels

 From: sxk1...@hotmail.com
 Date: Tue, 28 Jun 2011 14:14:04 -0700
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] neo4j-graph-collections
 
 I would be interested in helping out with this, let me know next steps.
 
 Sent from my iPhone
 
 On Jun 28, 2011, at 8:49 AM, Niels Hoogeveen pd_aficion...@hotmail.com 
 wrote:
 
  
  A couple of weeks ago Peter Neubauer set up a repository for in-graph 
  datastructures: https://github.com/peterneubauer/graph-collections.
  At this time of writing only the Btree/Timeline index is part of this 
  component. 
  In my opinion it would be interesting to move the Rtree parts of 
  neo-spatial to neo4j-graph-collections too. 
  I looked at the code but don't feel competent to seperate out those classes 
  that support generic Rtrees from those classes that are clearly spatial 
  related.
  Is there any enthusiasm for such a project and if so, who is willing and 
  able to do this?
  Niels
  
  
  
  ___
  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-graph-collections

2011-06-28 Thread Niels Hoogeveen

Craig,
Sounds like a good plan. Would you be able to make the Rtree implentation 
spatial-independent based on the suggestions you make? Then we can move those 
classes to neo4j-graph-collections. This makes neo4j-spatial dependent on 
neo4j-graph-collections, though that component has no other dependencies than 
neo4j-kernel.
Once we have fleshed out the Rtree as spatial independent and placed in 
neo4j-graph-collections, we can start working to integrate the index into the 
current indexing framework.
Note to Peter. If we pursue this road, neo4j-graph-collections will have to 
become an official component and can no longer stay personal Git repo. 
Niels

 Date: Wed, 29 Jun 2011 00:32:15 +0200
 From: cr...@amanzi.com
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] neo4j-graph-collections
 
 The RTree in principle should be generalizable, but the current
 implementation in neo4j-spatial does make a few assumptions specific to
 spatial data, and makes use of spatial envelopes for the tree node bounding
 boxes. It is also specific to 2D. We could make a few improvements first,
 like generalizing to n-dimensions, replacing the recursive search with a
 traverser and generalizing the bounding boxes to be simple double-arrays.
 Then the only thing left would be to decide if it is ok for it to be based
 on n-dim doubles or should be generalized to more types.
 
 On Tue, Jun 28, 2011 at 11:14 PM, Saikat Kanjilal sxk1...@hotmail.comwrote:
 
  I would be interested in helping out with this, let me know next steps.
 
  Sent from my iPhone
 
  On Jun 28, 2011, at 8:49 AM, Niels Hoogeveen pd_aficion...@hotmail.com
  wrote:
 
  
   A couple of weeks ago Peter Neubauer set up a repository for in-graph
  datastructures: https://github.com/peterneubauer/graph-collections.
   At this time of writing only the Btree/Timeline index is part of this
  component.
   In my opinion it would be interesting to move the Rtree parts of
  neo-spatial to neo4j-graph-collections too.
   I looked at the code but don't feel competent to seperate out those
  classes that support generic Rtrees from those classes that are clearly
  spatial related.
   Is there any enthusiasm for such a project and if so, who is willing and
  able to do this?
   Niels
  
  
  
   ___
   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
  
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] neo4j-graph-collections

2011-06-28 Thread Niels Hoogeveen

As to the issue of n-dim doubles, it would be interesting to consider creating 
a set of classes of type Orderable (supporting , =, , = operations), this 
we can use in both Rtree and Btree. Right now Btree only supports datatype 
Long. This should also become more generic. A first step we can take is at 
least wrap the common datatypes in Orderable classes.
Niels

 Date: Wed, 29 Jun 2011 00:32:15 +0200
 From: cr...@amanzi.com
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] neo4j-graph-collections
 
 The RTree in principle should be generalizable, but the current
 implementation in neo4j-spatial does make a few assumptions specific to
 spatial data, and makes use of spatial envelopes for the tree node bounding
 boxes. It is also specific to 2D. We could make a few improvements first,
 like generalizing to n-dimensions, replacing the recursive search with a
 traverser and generalizing the bounding boxes to be simple double-arrays.
 Then the only thing left would be to decide if it is ok for it to be based
 on n-dim doubles or should be generalized to more types.
 
 On Tue, Jun 28, 2011 at 11:14 PM, Saikat Kanjilal sxk1...@hotmail.comwrote:
 
  I would be interested in helping out with this, let me know next steps.
 
  Sent from my iPhone
 
  On Jun 28, 2011, at 8:49 AM, Niels Hoogeveen pd_aficion...@hotmail.com
  wrote:
 
  
   A couple of weeks ago Peter Neubauer set up a repository for in-graph
  datastructures: https://github.com/peterneubauer/graph-collections.
   At this time of writing only the Btree/Timeline index is part of this
  component.
   In my opinion it would be interesting to move the Rtree parts of
  neo-spatial to neo4j-graph-collections too.
   I looked at the code but don't feel competent to seperate out those
  classes that support generic Rtrees from those classes that are clearly
  spatial related.
   Is there any enthusiasm for such a project and if so, who is willing and
  able to do this?
   Niels
  
  
  
   ___
   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
  
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] neo4j-graph-collections

2011-06-28 Thread Saikat Kanjilal

I've read through this thread in more detail and have a few thoughts, when you 
talk about type I am assuming that you are referring to an interface that both 
(Btree,Rtree) can implement, for the data types I'd like to understand the use 
cases first before implementing the different data types, maybe we could store 
types of Object instead of Long or Double and implement comparators in a more 
meaningful fashion.   Also I was wondering if unit tests would need to be 
extracted out of the spatial component and embedded inside the 
graph-collections component as well or whether we'd potentially need to write 
brand new unit tests as well.
Craig as I mentioned I'd love to help, let me know if it would be possible to 
fork a repo or to talk in more detail this week.
Regards

 From: pd_aficion...@hotmail.com
 To: user@lists.neo4j.org
 Date: Wed, 29 Jun 2011 01:35:43 +0200
 Subject: Re: [Neo4j] neo4j-graph-collections
 
 
 As to the issue of n-dim doubles, it would be interesting to consider 
 creating a set of classes of type Orderable (supporting , =, , = 
 operations), this we can use in both Rtree and Btree. Right now Btree only 
 supports datatype Long. This should also become more generic. A first step we 
 can take is at least wrap the common datatypes in Orderable classes.
 Niels
 
  Date: Wed, 29 Jun 2011 00:32:15 +0200
  From: cr...@amanzi.com
  To: user@lists.neo4j.org
  Subject: Re: [Neo4j] neo4j-graph-collections
  
  The RTree in principle should be generalizable, but the current
  implementation in neo4j-spatial does make a few assumptions specific to
  spatial data, and makes use of spatial envelopes for the tree node bounding
  boxes. It is also specific to 2D. We could make a few improvements first,
  like generalizing to n-dimensions, replacing the recursive search with a
  traverser and generalizing the bounding boxes to be simple double-arrays.
  Then the only thing left would be to decide if it is ok for it to be based
  on n-dim doubles or should be generalized to more types.
  
  On Tue, Jun 28, 2011 at 11:14 PM, Saikat Kanjilal 
  sxk1...@hotmail.comwrote:
  
   I would be interested in helping out with this, let me know next steps.
  
   Sent from my iPhone
  
   On Jun 28, 2011, at 8:49 AM, Niels Hoogeveen pd_aficion...@hotmail.com
   wrote:
  
   
A couple of weeks ago Peter Neubauer set up a repository for in-graph
   datastructures: https://github.com/peterneubauer/graph-collections.
At this time of writing only the Btree/Timeline index is part of this
   component.
In my opinion it would be interesting to move the Rtree parts of
   neo-spatial to neo4j-graph-collections too.
I looked at the code but don't feel competent to seperate out those
   classes that support generic Rtrees from those classes that are clearly
   spatial related.
Is there any enthusiasm for such a project and if so, who is willing and
   able to do this?
Niels
   
   
   
___
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
 
 ___
 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