I'm struggling to detect various patterns in a graph database. At the moment I'd like to combine various MATCH statements in one query. I have a test dataset which records, among other things, the Church in which people married. It was possible (we're talking about the early modern Dutch Republic here) that a couple married in the Catholic Church and in the Dutch Reformed Church. I therefore want to create a query which retrieves the names of these people.
Slightly simplified, the building blocks of the graphs consists of three types of nodes: person, event, church. The event node has another label 'marriage', whereas the church node has another label 'Roman Catholic Church' or 'Dutch Reformed Church'. So for example: John Doe's marriage in the Catholic Church exists in this form:
(p:Person {name: "John Doe"})-[:MARRIED_AT]->(event:marriage)-[:TOOK_PLACE_IN]->(church:Roman_Catholic_Church)
Some person nodes have various marriages to various Churches associated to them. How retrieve the couples that married in the Catholic Church and Dutch Reformed Church? I created this query, but although it should yield results, it doesn't:
Match (p:person)-[:MARRIED_AT]->(event)-[:TOOK_PLACE_IN]->(ch:church:Roman_Catholic_Church), (p:person)-[:MARRIED_AT]->(event)-[:TOOK_PLACE_IN]->(ch:church:Reformed_Church) Return p.name
I don't get any error messages, but the query doesn't yield any results (whereas I've checked that my dataset does include people who had their marriage solemnized in two Churches). Any idea what I'm doing wrong here?