Hi again,

> The way you have modeled things, are all active relationships at a
> particular version present at that version node, or is the set of
> relationships made up from all version nodes all the way back to the
first
> version of an object.

in my case, all relationships are copied. For my data, this is
acceptable. (There are no nodes with thousands of relationships.)

If you can't copy them, because you have too many relationships, you
need to separate them into 2 groups somehow: "added" and "removed".
The "added" group could be just the plain relationship, the "removed"
group could be a property with an array with ID's of the removed
relationships.

For determining the visible relationships, you could go back to the
first version and then build up a set where you add the "added"
relationships and remove the "removed" relationships, until you arrive
at the latest revision. This would reduce the amount of data, but needs
more navigation.

Maybe you can also mix both approaches: if the "removed" list becomes
too large, create a complete copy which serves as new baseline for the
next modifications.

It all depends on your data and the frequency of changes which approach
is best. 


> If all relationships are present at each version: do you then create
> relationships from the version nodes of both objects? Or perhaps all
> relationships are unidirectional in your system?

Yes, there are only unidirectional relationships, like in Neo.

 
> Consider the scenario: Two VersionedObjects: a and b. You want to
create a
> bidirectional relationship in between these objects.
> 
> Let a.v represent the new ObjectVersion for a, and b.v represent the
new
> ObjectVersion for b, a.i the identity for a and b.i the identity for
b.
> 
> As far as I can tell you will need to create two relationships here:
one
> for
> each direction:
> a.v --> b.i
> b.v <-- a.i

a.v --> b.i
b.v --> a.i

Removing a relationship in my case would mean to create a new version
a.v' with all properties and relationships of a.v except the
relationship to be removed.
If the relationship is bidirectional, you would also need to create a
b.v' without the opposite direction.


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

Reply via email to