On Sun, Feb 20, 2011 at 7:43 PM, Marko Rodriguez <okramma...@gmail.com> wrote: > Hi, > >> Updated to 0.5-SNAPSHOT. Works. Great! > > Excellent. (Again: note that IndexableGraph and AutomaticIndex are slightly > different in 0.5 than 0.4). > >> On a more abstract topic - I'm wondering it there's a good way to use >> your domain objects in Pipes instead of vertices and edges? >> So far I've just created a new Pipe<Vertex, T> that converts the >> vertices to your domain object by referring to node id. > > The "trick" to Pipes is to build more abstract relations with lower-level > pipes. So yes, you want to go from 'graph speak' of edges, vertex, etc. to > 'domain speak' of people, companies, etc. --- for example, > MyDomainSpecificFriendRecommendationPipe<Person,Map<Person,Integer>>. See > slide 117 here: >
Thats exactly what I did. class MappingPipe extends AbstractPipe<Vertex, T> implements Pipe<Vertex, T> { @Override protected T processNextStart() throws NoSuchElementException { Vertex v = this.starts.next(); return findById((Long) v.getId()); } } I'm just not sure if findById((Long) v.getId()); is the best way to map. findById is provided by NodeFinder of spring data. > http://www.slideshare.net/slidarko/memoirs-of-a-graph-addict-despair-to-redemption > I know that presentation! It still is one of the most comprehensive graph presentations out there. If someone asks me graphs... what? I usually send that link. Thanks :-) > Finally, see slide 116 in the same slideshow. All you have to do is overwrite > AbstractPipe.processNextStarts() and you can map from any type to any other > type. > > Hope that answers your question. > > Take care, > Marko. > > http://markorodriguez.com > > > > > _______________________________________________ > 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