Cypher custom query for people and places over time

I would like to query a dataset to reveal a variety of connections between 1000+ nodes. More specifically, I would like to isolate the literal "crossings of paths" of various people as they are posted at different locations at different times.

Everything I've tried so far has gotten me nowhere. I am new to this.

My nodes are of individual's names and building names. Relationships have date, geo-coding, and additional properties - though they are not all directly graphically connected as I would like to leave that up to the user to custom query. Any help? Is neo4j good for this?

Also, I am in Chicago. The community intro suggests I "Connect with others in your local region." ??? Thanks, thanks, thanks

Depends if you modeled your data with a "visit" node or not.

in general the query would look like:

MATCH (p1:Person)-[vis1:VISITED]->(b:Building)<-[vis2:VISITED]-(p2:Person)
WHERE p1 <> p2 and =
RETURN, as date,,

or generically

MATCH (b:Building)<-[vis:VISITED]-(p:Person)
WITH b, as date, collect(p) as people
WHERE size(people) > 1
RETURN, date, people

there are some optimizations here but that's the basics.

Thanks for your response, but I've been side lined with this:
neo4j - can't create NEW relationships between existing nodes

when I -

CREATE (c:Church{name: "Sts. Peter and Paul", address: "3745 S Paulina St Chicago IL 60609"})
and then I -

MATCH (p:Priest{name: "Fr. Thomas J OGorman" }), (c:Church {name: "Sts. Peter and Paul"}) MERGE (p)-[:POSTED {posting:1982-83}]->(c) It works fine,

however, when I enter the identical statement, but change variables, like church, I then get (no changes, no records) Tried creating indexes and variations which didn't help.

For instance: MATCH (p:Priest {name:'Fr. Thomas J OGorman'}), (c:Church {name:'St Barnabas'}) MERGE (p)-[:POSTED {posting:1977-82}]->(c) I then get (no changes, no records)

Suggestions please? Thanks

Perhaps the church doesn't exist yet?
You have to create it before.

Church existed, My queries lacked identical letter word spacings as my church nodes. Simple. Learning here. Thanks for the help.

1 Like