What I've done is this:

1. Find the vertex for the start date (or closest one after it).
2. Increment your finest time unit (in my case seconds, but it may be days) 
until you find a match in the map.
3. When you get past the maximum value for that unit (59 in the case of 
seconds), move up to the parent vertex and repeat.
4. When you get a match in a parent vertex, you have to move down again to 
the children and iterate through those.

I just have to keep track of the current vertex for each part of the time 
(i.e. year, month, day, ...) so I can move up to coarser time units when 
needed.

Probably not very clear but it's a fairly complicated algorithm. However, 
it works very quickly.

On Wednesday, September 16, 2015 at 2:42:19 PM UTC-6, Timo Pulkkinen wrote:
>
> In other words, should we have links between the adjacent time units or 
> documents ("next") to be able to traverse the graph, or is the "time span" 
> query somehow doable otherwise? This most certainly is a beginner (FAQ) 
> level question, but didn't find any exact question or slideset / doc that 
> covers this use case?
>
> br,
> Timo
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to