>
> If an item can only be "had" by one user at a time, then the "display", or
> "visible_to", relationship could originate from the item.
>



> > 9. "owesItemTo" -relation between User, Item, User/Group. (A triple, Do I
> > need a node?)
> >
>
> Same here.
>


Thanks

I will rename "have" to "owner_of".
Then use the relations

item "visible_to" user/group
item "currently_held_by" user/group

Why would you need two relationships? Can you let a single relationship
> represent the mutual credit line between two users?
>

If I use a single directed relationship, how could I prepare the data for
the traversal to be fast?
I know the traversal is equally fast in both directions, but the calculation
"remaining_credits" can be made in advance or while traversing.
I can't really decide if the pre calculated properties "remaining_credits"
will make traversal faster or if it just introduces the unnecessary risk of
inconsistency.

I could have 5 properties:
long balance
long end_node_limit
long start_node_limit
long end_node_remaining_credits
long start_node_remaining_credits

My thoughts are something like this to make a faster traversal:

If the traversal finds a "incoming" mutual_credit-relation it could check
property
"end_node_remaining_credits" to decide if it is enough for the transaction.

And if the traversal finds a "outgoing" mutual_credit-relation it could
check property
"start_node_remaining_credits" to decide if it is enough for the
transaction.
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to