I was wondering if Neo4j supports subgraph isomorphism (finding pattern in a target), if both graphs come from the database. I'm quite new to Neo4j but to me it seems that the pattern is only described by Cypher language. However, what if I have some interesting and decently sized graph, and I would like to find all graphs in database that contain this graph. I think that theoretically, the "query" graph could be transformed to Cypher, although it screams at me "ineffective". Also building the Cypher query from graph might not be as easy as it seems until I attempt it. So my 2 questions would be:
1) Is there some built-in algorithm, that could perform this operation efficiently?
2) If not, is it possible to build GENERIC Cypher query that, given 2 graphs, would tell if one is subgraph of the other? And by generic I mean that it's not uniquely constructed for each queried graph.Note that in this example, there would be a lot of disconnected graphs in DB. The way I was considering to distinguish graphs was by having a property like ".graphId" on each vertex, or possibly by having "partOf" relationship from all vertices to a single node representing the graph as whole.
Regarding the first question, I found some hints
here and
here, but I'm not sure what these are for or how to use them. On the other side, I've found a
webinar followup from 2012 that answers:
Is subgraph isomorphism possible?- Subgraph matching is not directly supported, just path pattern-matching. So the match would have to be expressed as a path pattern.
I wonder if there was some development in this area in the last 5 years. I will be glad for any piece of information, although direct yes+how / no+why would earn you my eternal gratitude.