cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Question About Collaborative Filtering Query

Hello community, I'm new to Neo4j and graph databases, and struggling with a query for a collaborative filter recommender.

I'm imagining myself as a hiring manager trying to find freelancers I don't know who have been liked by other hiring managers that have (some proportion / number of) similar likes to me.

So far I have
MATCH (fl:Person)<-[:LIKED]-(oh:Person), (oh)-[:LIKED]->(mfl:Person)<-[:LIKED]-(p:Person) WHERE oh.userId = 6562 RETURN fl - which is not returning anything.

Can anyone see where I'm going wrong?

Many thanks for any advice.

Tom

4 REPLIES 4

12kunal34
Graph Fellow

Hi Tom,

could you please share your data modal ,it would help us to understand your query
is there any criteria or properties for freelancer ??

Hi, a freelancer is just a Person who is hired and liked by other Persons. Person has attribute userID among others.

ameyasoft
Graph Maven

Hi,

Your userid is an integer or string? See if you get any result with this query:

if integer:
MATCH (oh:Person)-[:LIKED]->(fl:Person)
WHERE oh.useid = 6562
RETURN oh, fl;

If string:

MATCH (oh:Person)-[:LIKED]->(fl:Person)
WHERE oh.useid = "6562"
RETURN oh, fl;

Check to see if any one of the above quries show result.
-Kamal

I think you got the order wrong.
If oh is your start user (yourself).

// find peer group (p)
MATCH (oh)-[:LIKED]->(mfl:Person)<-[:LIKED]-(p:Person) 
WHERE oh.userId = 6562 
// find freelancers that our peers liked
MATCH (fl:Person)<-[:LIKED]-(p:Person)
// exclude already known
WHERE not (oh)-[:LIKED]->(fl)
RETURN fl, count(*) order by count(*) desc