On 19 May 2009, at 20:03, Tobias Ivarsson wrote:
> Since you are planning to publish your code under AGPL on github, do  
> you mind me asking what the system you are building is doing?

I'm afraid I can't talk about the application yet (we're going to get  
a commercial license for Neo4j). I just want to release a general- 
purpose application template, to help others (and myself on future  
projects) hit the ground running.

> I would like it if I could model each entity as one node, but if it  
> makes
> things more manageable to model it as more than one node, then I  
> will do
> that.

Sounds like we're thinking along similar lines.

> This sounds like a good way to model things. In my system it is more  
> common
> to to change / add / remove the relationships than the entities. So  
> perhaps
> I need to introduce a relationship indirection to be able to do the  
> same
> thing for relationships in my system. ie let each relationship in  
> the model
> be represented by two relationships with an intermediate node with  
> your
> suggestion for history management.

That sounds like a neat solution, good idea. So how would you  
implement an update to a relationship? Create a new intermediate node,  
delete the relationships from the old intermediate node to the two  
entity nodes, create new relationships from the new intermediate node  
to the two entity nodes, and create a relationship from the new to the  
old intermediate node?

I guess any properties which you would have previously attached to the  
relationship (in a non-versioned data model) could now be attached to  
the intermedate node instead. I'm just wondering how the type of  
relationship should be represented. Should the two relationships to  
the intermediate node be of the type intended by the domain model? Or  
should they be a special relationship type (e.g. "versioned  
relationship") and the domain model relation type encoded as a  
property? Either way the graph traversers will have to be modified to  
take into account the intermediate node.

I'm wondering if it's possible to write a wrapper around a traverser  
which operates on a graph of nodes with versions, but makes it look as  
though it was a simple unversioned graph (i.e. abstracts away the  
intermediate nodes and finds the latest version of each entity). It  
would be good to separate the versioning from the application logic.

> My gut feeling is that you will make things complicated, with an  
> explosion
> in the number of relationships for the target nodes, if you copy the
> relationships.

Yes, I had that fear too. Your solution sounds a lot better.

> To the rest of you: all ideas are welcome, any input is good to get,  
> please chime in!

Indeed. By the way, are there links to any publicly accessible apps  
built on Neo4j somewhere? Or are the production uses all hidden away  
inside big banks? ;-)

Best wishes
Martin

-- 
Martin Kleppmann
Managing Director, Ept Computing Ltd.
Web: http://www.eptcomputing.com
Blog: http://www.yes-no-cancel.co.uk
Twitter: http://twitter.com/martinkl

_______________________________________________
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to