Trying to troubleshoot the following query

```
CREATE QUERY oc_many_hops(
VERTEX<entity> seed,
INT hops,
INT effective_date,
INT confidence,
INT ownership_percentage
) FOR GRAPH oc {
MapAccum<STRING, STRING> @@params;
OrAccum<BOOL> @visited;
ListAccum<EDGE> @@relationships;
# Build WHERE condition
STRING where_condition = "object != seed";
IF effective_date IS NOT NULL THEN
where_condition += " AND relationship.earliest_date < effective_date AND relationship.latest_date > effective_date";
@@params += ("effective_date" -> datetime_format(epoch_to_datetime(effective_date), "%Y-%m-%d %H:%M:%S"));
END;
IF confidence IS NOT NULL THEN
where_condition += " AND relationship.confidence >= confidence";
@@params += ("confidence" -> to_string(confidence));
END;
IF ownership_percentage IS NOT NULL THEN
where_condition += " AND relationship.ownership_percentage >= ownership_percentage";
@@params += ("ownership_percentage" -> to_string(ownership_percentage));
END;
# Finished building WHERE condition
vertices = {seed};
where_condition += " AND object.@visited == false";
WHILE vertices.size() > 0 LIMIT hops DO
vertices =
SELECT object
FROM vertices:subject - (:relationship) -> :object
WHERE EVALUATE(where_condition)
ACCUM @@relationships += relationship, object.@visited = true;
PRINT vertices;
END;
PRINT @@relationships;
PRINT where_condition;
}
```

which would return expected results half of the time while the other half “relationship” accumulator returns empty. Parameters used are

seed: [entity id]

hops: 2

effective_date: NULL

confidence: NULL

ownership_percentage: NULL

Any idea what could be the issue?

Thanks.