I think GraphDatabaseService will expose getAllRelationships() in the near
future. But until then you could do something like:
public Iterable<Relationship> getAllRelationshipsOfType(
GraphDatabaseService db,
final RelationshipType type )
{
return new NestingIterable<Relationship, Node>( db.getAllNodes() )
{
@Override
protected Iterator<Relationship> createNestedIterator( Node item
)
{
return item.getRelationships( type, Direction.OUTGOING
).iterator();
}
};
}
2011/6/29 Mathias Hensel <[email protected]>
>
> Hello,
>
> I'm considering to create a graph that represents the primitives of a web
> site: Web pages, users, tags and other stuff. I have a collaborative filter
> that measures the similarity of web pages among them. These similarities
> should be included in the graph as relations holding the strength of the
> similarity as a property. The filtering is a batch process that should be
> run every few days. To insert the newly created relations (similarities) I
> have to delete all the old similarity relations.
>
> What yould be the best approach to do that? I couldn't find any method in
> the native API for that (I'm using the EmbeddedGraphDatabase).
>
> Thanks a lot in advance,
> Mathias
>
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
>
--
Mattias Persson, [[email protected]]
Hacker, Neo Technology
www.neotechnology.com
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user