Objective
Link analysis — "who is connected to this subject, and how far out?" — is a graph traversal, not a stack of SQL joins. This recipe models entities and their relationships as a property graph and walks the network from a subject of interest, entirely inside a self-hosted deployment.
Step 1: Model entities and links
MERGE (a:Entity {id: "SUBJ-1", name: "Subject One"})
MERGE (b:Entity {id: "ENT-2", name: "Associate A"})
MERGE (c:Entity {id: "ENT-3", name: "Associate B"})
MERGE (d:Entity {id: "ENT-4", name: "Far Node"})
MERGE (a)-[:LINKED_TO]->(b)
MERGE (b)-[:LINKED_TO]->(c)
MERGE (c)-[:LINKED_TO]->(d);
Step 2: Everything within N hops of the subject
MATCH (a:Entity {id: "SUBJ-1"})-[:LINKED_TO*1..3]->(x:Entity)
RETURN DISTINCT x.name AS connected_within_3_hops;
Result — the network out to three hops from the subject:
| connected_within_3_hops |
|---|
| Associate A |
| Associate B |
| Far Node |
Why it matters
One pattern surfaces the network a multi-join query would struggle to express, and it runs inside the boundary with no external service. Record the analysis on a tamper-evident ledger, and ground any generated summary with offline retrieval. To build the entity graph from raw text, see knowledge-graph construction.