The ottrecql query language

ottrecql is the small query language behind the advanced search on ottrec.ca. It allows you to create custom schedule pages by filtering every City of Ottawa drop-in recreation activity by name, facility, weekday, time, date, and location, combining conditions with and, or, and not. Type a query to search across all schedules.

Combine match functions with logical operators, evaluated against every activity time. Whitespace is insignificant and the schedule timezone (America/Toronto) is implied.

Examples

Reference

facility("name", ...)
Matches facility names against any of the quoted strings. Matching is fuzzy: each case-insensitive word of the query must be a prefix of a word in the facility name, in the same order, ignoring punctuation. For example, facility("st laurent") matches "St. Laurent Complex", and facility("rj kennedy") matches "R.J. Kennedy Community Centre and Arena".
activity("name", ...)
Like facility(), but matches activity names (both normalized and as written in the schedule). Names are normalized to the infinitive form, e.g., "skate" rather than "skating", so prefer prefixes like activity("skat") or activity("lane sw").
time([weekday...|date...] @ [time...|timerange...])
Matches activity weekdays and times. Days and times are each OR'd, and either side can be omitted (along with the @). Activities with unparseable times are not filtered out. Weekdays are two-letter, three-letter, or full names (mo, mon, monday). Dates are YYYY-MM-DD or today. Times are 24-hour HH:MM, 12-hour HH:MMam/HH:MMpm (or a/p), or now. Time ranges are two dash-separated times; an end time earlier than the start extends into the next day. For example: time(now), time(mo tu we th fr), time(sa su @ 12:00), time(mo @ 6:00a-10:00a 6:00p-9:00p).
schdate(date)
Matches schedule groups applicable on the date (YYYY-MM-DD or today), e.g., schdate(today) to show current schedules. Groups without a valid date range are not filtered out.
latlng(lat, lng, km)
Matches facilities within the radius (kilometers) of the coordinates, e.g., latlng(45.42620, -75.69205, 2) matches within 2km of Rideau station.
not · and · or · ( )
Logical operators, highest to lowest precedence: (...) grouping, not/! negation, and/&& conjunction, or/|| disjunction.

Keep name queries as minimal as possible (e.g., "lane sw" instead of "lane swim") so renamed activities aren't missed.