This question comes from experience with the CONSTRUCT operator in SPARQL, which allows to take variable bindings in a graph query and return a new graph as result.
Is there anything like that in Cypher/OpenCypher?
I mean, suppose you have:
react1 - [part-of] -> pathway1
mol1 - [consumed-by] -> react1
mol2 - [consumed-by] -> react1
mol3 - [produced-by] -> react1
I'd like to return a simplified graph like:
pathway1 - [input] - mol1
pathway1 - [input] - mol2
pathway1 - [output] - mol3
Note that I've already played with WITH/COLLECT/UNWIND to return JSON structures very similar to the graph above, but this approach is much more difficult to write.
