I have a neo4j graph database,and I am using java embedded,how can I convert this cypher query to java code(is it possible at all)?
the query:
START n=node(*)
MATCH p=n-[rels:INCLUDE*]->m
WHERE ALL (rel IN rels
WHERE rel.status='on')
WITH COLLECT(p) AS paths, MAX(length(p)) AS maxLength
RETURN FILTER(path IN paths
WHERE length(path)= maxLength) AS longestPaths
this query is about finding the longest path among nodes which have relationship with STATUS="on" property with each other,and returns the path.
because I read that working with a neo4j database, from java api is faster than running the cypher query from a java application.
so please help me to write the java code which does the same thing this cypher query does.
thanks in advance.