0down votefavorite
<http://stackoverflow.com/questions/37127551/neo4j-query-to-find-same-data-link-to-different-nodes#>
Following is what I created in Neo4j:
Nodes: Customer Names, Customer Address and Customer Contact
Linked these nodes based on common relationships between all three.
Data Model ->
(a:Address)<-[:ADDRESS_AT]-(p:Person {name: '...'})-[:CONTACT_AT]->(c:Contact)
I can see all three nodes linked in Neo4j. Contact contain email and phone
numbers so some cases customer name node is connected to email address,
phone number and address.
In my learning curve I am asked to show how many same Contact (email, phone
no) are used by different customer names also how many same address used by
different customer names. Based on my little experience I tried few queries
but couldn't reach to results.
Tried following query ->
MATCH (person:Person)-[:CONTACT_AT]->(contact:Contact)
RETURN contact, COLLECT(person.name) AS names;
MATCH (person:Person)-[:ADDRESS_AT]->(address:Address)
RETURN address, COLLECT(person.name) AS names;
I tried with LIMIT 100 and 1000 but all addresses have only one node on
display. Is it possible to display only the addresses that are linked to
more than one customer names? Same for contact it is showing only one to
one relationships.
I would like to limit query to show One Address used by Multiple Persons
and One Contact (email, Phone No) used by Multiple Persons but no one to
one relationship.
Please guide. Thanks.
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.