Class: QgsSensorThingsExpansionDefinition

class qgis.core.QgsSensorThingsExpansionDefinition

Bases: sip.wrapper

Encapsulates information about how relationships in a SensorThings API service should be expanded.

Added in version 3.38.

QgsSensorThingsExpansionDefinition(childEntity: Qgis.SensorThingsEntity = Qgis.SensorThingsEntity.Invalid, orderBy: Optional[str] = ‘’, sortOrder: Qt.SortOrder = Qt.SortOrder.AscendingOrder, limit: int = QgsSensorThingsUtils.DEFAULT_EXPANSION_LIMIT, filter: Optional[str] = ‘’) Constructor for QgsSensorThingsExpansionDefinition, targeting the specified child entity type.

QgsSensorThingsExpansionDefinition(a0: QgsSensorThingsExpansionDefinition)

Methods

asQueryString

Returns the expansion as a valid SensorThings API query string, eg "$expand=Observations($orderby=phenomenonTime desc;$top=10)".

childEntity

Returns the target child entity which should be expanded.

defaultDefinitionForEntity

Returns an expansion definition for the specified entity type, populated with reasonable defaults which make sense for that entity type.

filter

Returns the the string filter to filter expanded child entities by.

fromString

Returns a QgsSensorThingsExpansionDefinition from a string representation.

isValid

Returns True if the definition is valid.

limit

Returns the limit on the number of child features to fetch.

orderBy

Returns the field name to order the expanded child entities by.

setChildEntity

Sets the target child entity which should be expanded.

setFilter

Returns the the string filter to filter expanded child entities by.

setLimit

Sets the limit on the number of child features to fetch.

setOrderBy

Sets the field name to order the expanded child entities by.

setSortOrder

Sets the sort order for the expanded child entities.

sortOrder

Returns the sort order for the expanded child entities.

toString

Returns a string encapsulation of the expansion definition.

asQueryString(self, parentEntityType: Qgis.SensorThingsEntity, additionalOptions: Iterable[str | None] = []) str

Returns the expansion as a valid SensorThings API query string, eg “$expand=Observations($orderby=phenomenonTime desc;$top=10)”.

The parent entity type for the expansion must be specified.

Optionally a list of additional query options can be specified for the expansion.

Parameters:
Return type:

str

childEntity(self) Qgis.SensorThingsEntity

Returns the target child entity which should be expanded.

See also

setChildEntity()

Return type:

Qgis.SensorThingsEntity

defaultDefinitionForEntity(entity: Qgis.SensorThingsEntity) QgsSensorThingsExpansionDefinition

Returns an expansion definition for the specified entity type, populated with reasonable defaults which make sense for that entity type.

Parameters:

entity (Qgis.SensorThingsEntity)

Return type:

QgsSensorThingsExpansionDefinition

filter(self) str

Returns the the string filter to filter expanded child entities by.

See also

setFilter()

Return type:

str

fromString(string: str | None) QgsSensorThingsExpansionDefinition

Returns a QgsSensorThingsExpansionDefinition from a string representation.

See also

toString()

Parameters:

string (Optional[str])

Return type:

QgsSensorThingsExpansionDefinition

isValid(self) bool

Returns True if the definition is valid.

Return type:

bool

limit(self) int

Returns the limit on the number of child features to fetch.

Returns -1 if no limit is defined.

See also

setLimit()

Return type:

int

orderBy(self) str

Returns the field name to order the expanded child entities by.

See also

sortOrder()

See also

setOrderBy()

Return type:

str

setChildEntity(self, entity: Qgis.SensorThingsEntity)

Sets the target child entity which should be expanded.

See also

childEntity()

Parameters:

entity (Qgis.SensorThingsEntity)

setFilter(self, filter: str | None)

Returns the the string filter to filter expanded child entities by.

See also

filter()

Parameters:

filter (Optional[str])

setLimit(self, limit: int)

Sets the limit on the number of child features to fetch.

Set to -1 if no limit is desired.

See also

limit()

Parameters:

limit (int)

setOrderBy(self, field: str | None)

Sets the field name to order the expanded child entities by.

See also

orderBy()

See also

setSortOrder()

Parameters:

field (Optional[str])

setSortOrder(self, order: Qt.SortOrder)

Sets the sort order for the expanded child entities.

See also

setOrderBy()

See also

sortOrder()

Parameters:

order (Qt.SortOrder)

sortOrder(self) Qt.SortOrder

Returns the sort order for the expanded child entities.

See also

orderBy()

See also

setSortOrder()

Return type:

Qt.SortOrder

toString(self) str

Returns a string encapsulation of the expansion definition.

See also

fromString()

Return type:

str