For an example of similar scripts, see http://docs.neo4j.org/chunked/1.4-SNAPSHOT/gremlin-plugin.html#rest-api-send-a-gremlin-script---json-encoded-with-table-result
Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Thu, Jun 23, 2011 at 4:44 PM, Marko Rodriguez <okramma...@gmail.com> wrote: > Hi, > > Me, being that I know Gremlin (http://gremlin.tinkerpop.com), would do this > in Gremlin as such: > > m = [:] > g.v(1).out('like').in('like').except([g.v(1)]).groupCount(m) > > This is basic collaborative filtering. The statement reads, > > 1. create the map m > 2. starting at vertex with id 1 > 3. traverse the outgoing likes edges to products > 4. traverse the incoming likes edges to people > 5. remove the self as I don't want to say I'm similar to myself. > 6. count the amount of people I've arrived it over shared product > likes (store in m) > 7. m is your resultant map. to rank it, do: > m.sort{a,b -> a.value <=> b.value} > > There are numerous variations of this theme that you can expand on from this > core. > > Hope that helps, > Marko. > > http://markorodriguez.com > > On Jun 23, 2011, at 7:30 AM, Rick Otten wrote: > >> I have a graph of a bunch of people who are not connected to each other, >> but instead connected to things they "like". I'd like to start with one >> person, and find a list of people have the 'most in common' with them. >> >> Ideally I'd like to be able to prioritize the things they like, for >> example, it is more important to find people who like live in the same >> town, than people who liked the same movie. >> >> One approach is to traverse each 'like', one at a time, in order of >> importance, and then do a bunch of Set intersections on the results, and >> then return the list of people in reverse order. >> >> Is there a way to do this without having to run a whole bunch of queries? >> >> >> >> -- >> Rick Otten >> rot...@windfish.net >> O=='=+ >> >> >> _______________________________________________ >> 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 > _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user