TAO offers four queries on a source and a type of association.
- Get. It returns the associations from the source to any destination in a set, between a start time and an end time.
- Count. It returns the count of all edges of the type from the source.
- Range. It takes a position and a limit, such as the first 50 after an offset of a hundred. This helps pagination.
- Time range. It takes a start time, an end time and a limit, such as the top 10 posts Gaurav has liked in the last three days.
The 50 most recent comments on a post is a time range. The likes on a post are a count.
A check-in can be stored in two ways. In the first, Gaurav has an edge to a check-in object, which has an edge to Taj. It is more flexible, but a query goes through two edges. In the second, each check-in object holds the place, so a count of places in the last three days is one query.