Currently, in order to pass an object as a subgraph argument to a procedure, it has to be a Graph type object which is only provided by the output of the project() function.
For the usability purposes, it would be useful to have a function that takes map of nodes and edges as an argument and parses them into a Graph type of object. For example, the following query works as expected:
MATCH p=(:Node)-[:RELATION]-(:Node)
WITH project(p) AS subgraph
CALL bridges.get(subgraph)
YIELD node_from, node_to
RETURN node_from, node_to;
but, the you can not pass the subgraph as an argument using this query:
CALL {
MATCH (n:Node)
RETURN n
LIMIT 1
}
CALL path.subgraph_all(n, {}) YIELD nodes, rels
WITH {nodes: nodes, edges: rels} AS subgraph
CALL bridges.get(subgraph)
YIELD node_from, node_to
RETURN node_from, node_to;
Currently, in order to pass an object as a subgraph argument to a procedure, it has to be a Graph type object which is only provided by the output of the
project()
function.For the usability purposes, it would be useful to have a function that takes map of nodes and edges as an argument and parses them into a Graph type of object. For example, the following query works as expected:
but, the you can not pass the subgraph as an argument using this query:
Source from the community