Hi Alberto,

Depending on your graph and setup, you could do this in different ways. I
could suggest numerous ones, but it would be helpful if you could provide
more info on step 1.

Does the selection have to be statistically random? What does it mean to
"fulfill certain attributes?" Does it mean that the node has a property with
key X and value Y? Two nodes might not have a relationship, but there might
be a longer path between them, via other nodes? (see Marko Rodriguez' latest
slides for more goodies on paths)

In either case, I think I need more info before being able to provide a good
answer.

David


On Tue, Jul 27, 2010 at 7:52 PM, Alberto Perdomo
<alberto.perd...@gmail.com>wrote:

> Hi,
>
> I'm considering using neo4j for a current project I'm working on.
>
> I need to do the following periodically (e.g. daily):
> * step 1: for every node, let's call it A, I need to pick n other
> nodes randomly that fullfill certain attributes and have no
> relationship to A.
> * step2: For each of those nodes and A, I calculate some value and
> store it within the relationship.
>
> Regarding step 1, from what I've read, it seems there is no way of
> querying nodes that have no relationship to a specific node. Of course
> I could query all the nodes of the database that fullfill certain
> attributes, store them within a variable, then query all relationhips
> for node A and then substract those nodes from the array variable. But
> I think this approach won't work very well as the amount and density
> of relationships gets higher...
>
> Do you have any recommendations? Can you suggest another strategy?
> Perhaps there is a way of making that query?
>
> Any help of appreciated.
> Alberto.
> _______________________________________________
> 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

Reply via email to