code: @Override
    public void exitQuery(GDLParser.QueryContext ctx) {
      for(Vertex v : vertices) {
        addPredicates(Predicate.fromGraphElement(v, getDefaultVertexLabel()));
      }
      for(Edge e : edges) {
        addPredicates(Predicate.fromGraphElement(e, getDefaultEdgeLabel()));
      }
    }
docs: When leaving a query context its save to add the pattern predicates to the filters
  
  @param ctx query context