neo4j - Cypher query gives unnecessary relationships -
i trying display 1 relevant relationship in cypher query web browser displays relationships in between nodes. running following query:
match (emp:employee)-[e:employed {dateendrole:"current"}]->(c:company {companyname:"xyza"}) match (emp)-[ea:edu_associated]->(ec:company) match (another_emp:employee)-[ea1:edu_associated {overlapyearstart:ea.overlapyearstart, overlapyearend:ea.overlapyearend}]->(:company {comp_id:ec.companyid}) return emp, e, c, ea, ec, another_emp, ea1, limit 1; my intention in above query find associated employees company employee employed in 1 company , or has been employed company. example, find associated employees in company employee has worked before in company , working in xyza company.
here, employee , company nodes. has associated relationship contains overlap years properties of relationship. e.g. (emp)-[:associated{overlapyearstart:x, overlapyearend:y}]->(company)
if employee has worked employee @ company overlap years same.
the above query gives following output in web interface of neo4j. 
in image, "mr"(nodes dosen't display proper names) employee. "united states" current of employer. "unknown" company he/she worked in past , "doctor" associated employee "mr" @ "unknown" company.
i've 2 questions:
from "doctor" "unknown", why displays relationships? how can show 1 relevant relationship? shows "doctor" "unknown" relationship.
how can same above "mr" "unknown"?
i believe these relationships present in "graph" visualization mode of neo4j browser. if change visualization mode "text", "table" or "code" these relationships not shown. is: graph visualization mode trying "complete" graph you.
to achieve desired result should go section "graph visualization" of neo4j browser settings , uncheck option "connect result nodes" show in image below:

Comments
Post a Comment