semantique.interval

Contents

semantique.interval#

semantique.interval(a, b)[source]#

Interval of numerical or ordinal values.

Object representing a set of values that fall inside the given bounds of an interval. The interval is closed at both sides, meaning that both of its bounds belong to the set. By definition, the given bounds should be ordinal or numerical values, and the lower bound should be smaller than or equal to the upper bound.

Parameters:
  • a (int or float) – The lower bound of the interval.

  • b (int or float) – The upper bound of the interval.

Returns:

dict – JSON-serializable object that contains the bounds of the interval, and can be understood by the query processor as such.

Examples

>>> import semantique as sq
>>> sq.interval(21, 24)