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.
Table 1. List of CGE-specific Interval Functions
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.
  • True when there is complete coverage from earliest starting time to latest end time, i.e. there are no gaps in the coverage.
  • False if there is any gap in the coverage
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:
  • True when there is an interval where all intervals are present.
  • False if there is no interval when all intervals are present
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.
The arguments provided to the 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 xsdDate is 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
When using the interval analytics functions:
  • The interval analytic functions do not fully support the xsd:date and xsd:time data types and may return incorrect results; users should avoid these two types.
  • Comparisons of  xsd:date and xsd:dateTime within the same day may return unexpected results. xsd:date and xsd:dateTime comparisons are supported outside of the 14 hour time zone range and the 24 hour day span of xsd:date.
  • xsd:date results are now included when filtering on xsd:dateTime (outside the same day) and vice versa (xsd:dateTime results when filter on xsd:date). If strict xsd:dateTime results (or xsd:date results) are required, the appropriate data type filter should be added.
  • The duration() function supports combinations of xsd:date and xsd:dateTime. If an xsd:date result is the start time, the duration will start at the beginning of the day. Similarly, if the xsd:date result is the end time, the duration will end at the end of the day.