Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-21-2018 06:01 AM
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
11-21-2018 06:13 AM
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 ??
11-21-2018 06:37 AM
Hi, a freelancer is just a Person who is hired and liked by other Persons. Person has attribute userID among others.
11-21-2018 02:03 PM
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
11-22-2018 10:36 PM
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
All the sessions of the conference are now available online