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
Returns the expansion as a valid SensorThings API query string, eg "$expand=Observations($orderby=phenomenonTime desc;$top=10)".
Returns the target child entity which should be expanded.
Returns an expansion definition for the specified
entity
type, populated with reasonable defaults which make sense for that entity type.Returns the the string filter to filter expanded child entities by.
Returns a
QgsSensorThingsExpansionDefinition
from a string representation.Returns
True
if the definition is valid.Returns the limit on the number of child features to fetch.
Returns the field name to order the expanded child entities by.
Sets the target child
entity
which should be expanded.Returns the the string
filter
to filter expanded child entities by.Sets the
limit
on the number of child features to fetch.Sets the
field
name to order the expanded child entities by.Sets the sort order for the expanded child entities.
Returns the sort order for the expanded child entities.
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:
parentEntityType (Qgis.SensorThingsEntity)
additionalOptions (Iterable[Optional[str]] = [])
- Return type:
str
- childEntity(self) Qgis.SensorThingsEntity ¶
Returns the target child entity which should be expanded.
See also
- Return type:
- 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:
- filter(self) str ¶
Returns the the string filter to filter expanded child entities by.
See also
- Return type:
str
- fromString(string: str | None) QgsSensorThingsExpansionDefinition ¶
Returns a
QgsSensorThingsExpansionDefinition
from a string representation.See also
- Parameters:
string (Optional[str])
- Return type:
- 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
- Return type:
int
- orderBy(self) str ¶
Returns the field name to order the expanded child entities by.
See also
See also
- Return type:
str
- setChildEntity(self, entity: Qgis.SensorThingsEntity)¶
Sets the target child
entity
which should be expanded.See also
- Parameters:
entity (Qgis.SensorThingsEntity)
- setFilter(self, filter: str | None)¶
Returns the the string
filter
to filter expanded child entities by.See also
- 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
- Parameters:
limit (int)
- setOrderBy(self, field: str | None)¶
Sets the
field
name to order the expanded child entities by.See also
See also
- Parameters:
field (Optional[str])
- setSortOrder(self, order: Qt.SortOrder)¶
Sets the sort order for the expanded child entities.
See also
See also
- Parameters:
order (Qt.SortOrder)
- sortOrder(self) Qt.SortOrder ¶
Returns the sort order for the expanded child entities.
See also
See also
- Return type:
Qt.SortOrder
- toString(self) str ¶
Returns a string encapsulation of the expansion definition.
See also
- Return type:
str