Hi, I'm new to graph databases and have been trying to understand the power
of Cypher and/or Gremlin as a way to develop suggestion queries. I've
watched a few webinars and read through some of the documentation but I've
had a hard time figuring out complex suggestion type queries other than
stuff like "find me the top 3 movies my friends have recommended," or "given
that I rated this movie 5 stars, find me other people who liked this movie."

To give a simplified example of what I'm trying to achieve is something like
suggesting users based on attributes they weight from 0-1 and those
attributes can have relationships between each other and I want to find
something like the Tanimoto coefficient but weights as opposed to strictly
binary attributes or slope one for a start user to end users and then list
the top X. I have the O'Reilly book on Collective Intelligence but I've only
seen examples for set theory, not for graph theory.

I was thinking of Something like:

UserA likes Digital Photography with a weight of 1
UserA likes Wine with a weight of .8
UserA likes Rock music with a weight of 1
UserB likes Film Photography with a weight of 1
UserB likes Rock music with a weight of .5
UserB likes Beer with a weight of 1
Digital Photography is related to Film Photography with a weight of .5

I want to return how alike these two users are. I understand the graph
theory behind it in that I want to follow all likes relationships and is
related relationships till I hit another user and then with those paths that
I have to that user I want to multiply the weights of the relationships
along that path to get a score and then add those scores to get a final
score.

So in the above example it would look something like:
UserA->Digital Photography->Film Photography->UserB = 1 * .5 * 1 = .5
UserA->Rock->UserB = 1 * .5 = .5
Final tally = 1.

And then if there were mere users it would follow the paths to find those
users as well and find the scores and then sort the users by score. Looking
at Gremlin and Cypher, I'm not sure where to even start to work on query
that can do this and if it even is possible.

I know what I described isn't slope one or the Tanimoto coefficient because
it doesn't take into account the full set of attributes for the second user,
but I'm just getting used to this and right now my potential solution is
just have all unrelated attributes have edges of weight 0, but yeah I'm
probably getting ahead of myself. I'm just looking for a point in the right
direction for places to research and perhaps if they're available see some
actual Cypher queries that have done weighted suggestions based on
attributes.

Sorry for my ignorance and thanks in advance,
Mike
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to