neo4j / graph-data-science

Source code for the Neo4j Graph Data Science library of graph algorithms.
https://neo4j.com/docs/graph-data-science/current/
Other
596 stars 157 forks source link

How does one search for a small subgraph within a huge database? #246

Closed younis-bash closed 1 year ago

younis-bash commented 1 year ago

how can I search in subgraph in the neo4j database , is this feature available?

Mats-SX commented 1 year ago

@younis-ba What do you mean, precisely? Just searching for subgraphs is exactly what the Cypher query language does. Does that cover your use case?

For example, finding all the subgraphs of friends of friends who aren't friends:

MATCH (p:Person)-[:KNOWS]-(friend:Person)-[:KNOWS]-(friendOfFriend:Person)
WHERE NOT EXISTS { (p)-[:KNOWS]-(friendOfFriend) }
RETURN p, friend, friendOfFriend
Mats-SX commented 1 year ago

Closing this as inactive.