# tests/cypher/corpus/library.jsonl, method get_node_ancestors
query: "MATCH (t:StructureNode {id: $node_id}) MATCH p = (doc:Document)-[:HAS_STRUCTURE]->(a:StructureNode)-[:HAS_CHILD*0..10]->(t) RETURN [x IN nodes(p) WHERE x:StructureNode][0..-1] AS anc, doc.path AS dp, doc.version AS dv ORDER BY length(p) DESC LIMIT 1"
---
Match optional=False
  Path var=None selector=None
    Node var=t labels=(StructureNode) props={id: (Param node_id)} where=None
  where=None
Match optional=False
  Path var=p selector=None
    Node var=doc labels=(Document) props={} where=None
    Rel var=__r0 types=(HAS_STRUCTURE) dir=out props={} where=None
    Node var=a labels=(StructureNode) props={} where=None
    Quantified min=0 max=10
      Node var=__a0 labels=* props={} where=None
      Rel var=__r1 types=(HAS_CHILD) dir=out props={} where=None
      Node var=__a1 labels=* props={} where=None
    Node var=t labels=* props={} where=None
  where=None
Return distinct=False order=((Func length (Var p)) DESC) skip=None limit=(Lit 1)
  anc = (Slice (ListComp x (Func nodes (Var p)) where=(LabelTest (Var x) (StructureNode)) project=None) (Lit 0) (Lit -1))
  dp = (Prop (Var doc) path)
  dv = (Prop (Var doc) version)
