gradoop
gradoop copied to clipboard
Use pattern matching for subgraph operation
trafficstars
Just an idea for a convenience function that I'm sketching down here:
Subgraph is basically a pattern match, formulated like so:
MATCH (n)-[e]->(m)
WHERE vertexPredicate(n) AND vertexPredicate(m) AND edgePredicate(e)
subgraph could be called like so:
graph.subgraph("WHERE vertex.prop = 'foo' and label(edge) = 'knows'")
which gets translated into
MATCH (vertex1)-[edge]->(vertex2)
WHERE (vertex1.prop = 'foo') AND (vertex2.prop = 'foo') AND (label(edge) = 'knows')
The reduced combination of the resulting graph collection is equivalent to the result of the subgraph call.