I am currently using the following three queries to pull some information from the database.
MATCH (u:User { id: "1" }), (x:Label)
WHERE (u)-[:SEES]->(x)
RETURN collect(x) as labels
MATCH (u:User { id: "1" }), (x:Label)
WHERE (u)-[:SEES]->(x)
AND NOT((x)-[:CLASSIFIES]->())
AND NOT(()-[:CLASSIFIES]->(x))
RETURN collect(x) as uniquelabels
MATCH (u:User { id: "1" }), p=(a:Label)-[:CLASSIFIES*]->(b:Label)
WHERE ALL(n IN nodes(path) WHERE ((u)-[:SEES]->(n)))
AND NOT(()-[:CLASSIFIES]->(a))
AND NOT((b)-[:CLASSIFIES]->())
WITH collect(extract(n IN nodes(p) | n.id)) as paths
RETURN distinct paths
What is the proper way to combine these queries into one?