I have a query that returns a selection of vertices associated with a parent record… what I need to do is process the child records in date order and create a NEXT edge between them… since I have a date string that should sort them them that way…
Here is my code:
CREATE QUERY test() for graph cust {
ListAccum<STRING> @@edgeList;
ListAccum<VERTEX<hscode>> @@vertexList;
INT edgeCount;
INT iter;
iter=0;
#STRING x;
#STRING y;
start = {parcel.*};
s = SELECT h
FROM start:v-(HAS_EVENT:e)-hscode:h
WHERE v.parcelId == "199559693"
POST-ACCUM @@vertexList += h
ORDER BY h.DateStr ASC;
WHILE (iter < @@vertexList.size()-1) DO
print @@vertexList.get(iter), @@vertexList.get(iter+1);
INSERT INTO NEXT VALUES (@@vertexList.get(iter), @@vertexList.get(iter+1));
iter = iter + 1;
End;
}
But the sort doesn’t seem to process them all in the right order… am I missing something? Is there sort of “sorted accumulator” that exists for this purpose?
Thanks,
Frank