Cray Graph Engine (CGE) Interval Analytics Functions
Purpose, syntax and list of CGE interval analytic functions.
Intervals
An interval is defined as the sequence between any two variables of compatible atomic types, where one defines the start of the interval and the other defines the end of the interval. The interval is inclusive of the start and end.CGE interval analytic functions can be used to gather fine-grained detail about intervals. For example, they can be used to:
- determine if a time period that ends at the same time is contiguous with one that starts at the same time.
- determine whether or not two or more time intervals intersect.
- determine the continuity of a given time period.
Function Prefix
The prefix to use when using interval functions in queries is:PREFIX arq: <http://jena.hpl.hp.com/ARQ/function#>
List of Interval Analytics Functions
CGE interval functions are case-sensitive and work with any type that has a< comparison, e.g., numerics and strings. | Function | Description |
|---|---|
| listmin(element1, .... elementN) | This function returns the smallest item in the comma-separated list of items provided as arguments. |
| listmax(element1, .... elementN) | This function returns the largest item in the list of arguments. |
| iscontinuous(start1,end1,... startN, endN) | This is a pairwise function that accepts a list of comma-separated list of start and end times and determines whether or not there is a gap between the intervals under consideration.
|
| isintersecting(start1, end1, .... startN, endN) | This is a pairwise function that determines whether or not there is a period within which all the intervals under consideration are present. This function returns:
|
| duration(startTime, endTime) | This function uses the Unix epoch and time functions to calculate the duration between the start and end times, which are provided as arguments. This function returns the xsd:dayTimeDuration between startTime and endTime. Note: This function only accepts dates starting from July 5, 1776. |
listmin(), listmax(), iscontinuous() and isintersecting() functions should all be of compatible atomic types, otherwise an xsd_error will be returned. Furthermore, the duration() function will return an xsd_error in the following cases:- Either of the arguments are not of type
xsd:dateTime - The sum of (duration(xsdDate1, xsdDateTime2) - duration(xsdDateTime2, xsdDate1)) will not be zero. This is because
xsdDateis defined to span 24 hours (for standard days), and it is assumed that the start time is at the beginning of the day, and the end time is at the end of the day
- The interval analytic functions do not fully support the
xsd:dateandxsd:timedata types and may return incorrect results; users should avoid these two types. - Comparisons of
xsd:dateandxsd:dateTimewithin the same day may return unexpected results.xsd:dateandxsd:dateTimecomparisons are supported outside of the 14 hour time zone range and the 24 hour day span ofxsd:date. xsd:dateresults are now included when filtering onxsd:dateTime(outside the same day) and vice versa (xsd:dateTimeresults when filter onxsd:date). If strictxsd:dateTimeresults (orxsd:dateresults) are required, the appropriate data type filter should be added.- The duration() function supports combinations of
xsd:dateandxsd:dateTime.If anxsd:dateresult is the start time, the duration will start at the beginning of the day. Similarly, if thexsd:dateresult is the end time, the duration will end at the end of the day.