Access to AO Platform Ontology from 3rd Party Products (Preview)

OData - Supported Functions and Expressions

Intended audience: Developers administrators

AO Platform: 5.0

Supported Functions and Expressions

This section summarizes what the cloudseer-odata layer translates today. It is derived from ODataCanonicalMethodSql, ODataComputeSupport, ODataToMsoQueryBuilder, ODataApplyToSemanticSql, and ODataSearchSql (not an exhaustive OData v4 conformance statement). Unsupported constructs typically return 501 Not Implemented or 400 Bad Request with an error payload.

$filter — canonical method functions

These OData v4 method-style functions are mapped to SQL fragments (Calcite-friendly) when used in $filter:

Category

Functions

String

concat (2+ args), contains, startswith, endswith, length, indexof, substring (2 or 3 args), tolower, toupper, trim

Date/time

year, month, day, hour, minute, second, fractionalseconds, totalseconds, date, time, totaloffsetminutes, now, mindatetime, maxdatetime

Math

round (1 or 2 args), floor, ceiling

Type

cast (2 args: value and 'Edm.*' type literal — see cast targets below)

Explicitly not supported in $filter (this build)

  • isof → 501

  • geo.distance, geo.length, and geo.intersects (all overloads) → 501 — use $select / $expand for geometry values, or raw semantic SQL / JDBC for ST_* predicates

  • Collection lambdas (any / all) → not translated (error from the filter visitor)

  • Any other MethodKind not listed above → 501 (“Unsupported $filter method”)

$filter expressions (non-methods): Comparisons, logical and / or / not, and a subset of arithmetic and unary operators are handled in ODataToMsoQueryBuilder’s filter visitor (see code for the exact subset).

$compute — functions and operators

$compute is parsed from the raw query string (Olingo 4.10 does not natively expose it). Supported pieces include:

  • Operators: infix add, sub, mul, div, mod; unary + / - (use infix sub for subtraction, not sub(...) as a function call).

  • Same named functions as $filter: concat, length, tolower, toupper, trim, startswith, endswith, contains, indexof, substring, year, month, day, hour, minute, second, fractionalseconds, totalseconds, date, time, totaloffsetminutes, now, mindatetime, maxdatetime, round, floor, ceiling, cast.

  • Property paths: single segment only (e.g. manufacturer); multi-segment paths are rejected.

  • Aliases must not collide with existing property or navigation names. $compute results require Accept: application/json for the custom JSON path when used with certain response shapes.

cast(..., 'Edm.Type') — mapped EDM types

cast in $filter and $compute maps OData type names to SQL types including: Edm.String, Edm.Guid, Edm.Boolean, Edm.Byte, Edm.SByte, Edm.Int16, Edm.Int32, Edm.Int64, Edm.Single, Edm.Double, Edm.Decimal, Edm.Date, Edm.TimeOfDay, Edm.DateTimeOffset, Edm.DateTime, Edm.Duration, Edm.Binary. Other types return 501 (“not mapped to SQL”).

$search

$search is turned into a SQL WHERE fragment combined with $filter. Terms are matched with OR across searchable scalar columns of the base entity (case-insensitive POSITION / substring style). AND, OR, NOT, and grouped expressions are supported at the level implemented in ODataSearchSql (not a full ABNF superset).

$apply (aggregation)

For supported $apply=groupby(..., aggregate(...)) shapes, standard aggregates include sum, min, max, average, countdistinct, and $count ( COUNT(*) where modeled). Custom aggregate methods, groupby rollup, and combining $apply with $expand or $compute are rejected (see ODataApplyToSemanticSql).

Geometry

  • Payloads: Geometry-typed properties in $metadata are serialized as OData geospatial JSON (JTS → Olingo) in entity and expanded payloads.

  • $filter: Canonical geo.* functions are not implemented (see above).







Contact App Orchid | Disclaimer