iudx.rs package¶
Submodules¶
iudx.rs.ResourceQuery module¶
Module doc string. Leave empty for now.
ResourceQuery.py
-
class
iudx.rs.ResourceQuery.ResourceQuery[source]¶ Bases:
objectAbstract class for Resource Query. Helps to create a modular interface for the API to construct query in Python.
-
add_entity(iid: str) → T[source]¶ Method to add ids to the entity list.
- Parameters
iid (String) – Resource Id for a resource.
-
add_filters(filters: Optional[List[str]] = None) → T[source]¶ Method to instantiate query for filter based search.
- Parameters
filters (List[str]) – Filters to be applied to query for search.
-
during_search(start_time: Optional[str] = None, end_time: Optional[str] = None) → T[source]¶ Method to instantiate query for temporal based search.
- Parameters
start_time (String) – The starting timestamp for the search.
end_time (String) – The ending timestamp for the search.
-
geo_search(geoproperty: Optional[str] = None, geometry: Optional[str] = None, georel: Optional[str] = None, max_distance: Optional[int] = None, coordinates: Optional[List[Any]] = None) → T[source]¶ - Method to instantiate query for geo based search.
TODO: Need to validate input params here.
- Parameters
geoproperty (String) – Which geoproperty to query.
geometry (String) – GeoJson geometries.
georel (String) – Geo-relationship.
max_distance (Integer) – Radius from the center in meters.
coordinates (List[Any]) – The Coordinates of the geometry.
-
get_query() → str[source]¶ Method to build query for geo, temporal, propery and add filter.
- Returns
options as a string for the generated query.
- Return type
opts (String)
-
latest_search() → str[source]¶ - Method to instantiate query for latest resource search
based on the resource entities (Ids).
- Returns
query string for latest resource.
- Return type
latest_opts (String)
-
property_search(key: Optional[str] = None, value: Optional[str_or_float] = None, operation: Optional[str] = None) → T[source]¶ Method to instantiate query for property based search.
- Parameters
key (String) – Property key to query.
value (str/float) – Values for the comparision with the key.
operation (String) – Operation to be performed between key and value.
-
iudx.rs.ResourceServer module¶
Module doc string. Leave empty for now.
ResourceServer.py
-
class
iudx.rs.ResourceServer.ResourceServer(rs_url: Optional[str] = None, token: Optional[str] = None, headers: Optional[Dict[str, str]] = None)[source]¶ Bases:
objectAbstract class for Resource Server. Helps to create a modular interface for the API to implement queries.
-
get_data(queries: List[iudx.rs.ResourceQuery.ResourceQuery]) → List[iudx.rs.ResourceResult.ResourceResult][source]¶ - Method to post the request for geo, temporal, property, add filters
and make complex query.
- Parameters
queries (List[ResourceQuery]) – A list of query objects of
class. (ResourceQuery) –
- Returns
- returns a list of
ResourceResult object.
- Return type
rs_results (List[ResourceResult])
-
get_latest(queries: List[iudx.rs.ResourceQuery.ResourceQuery]) → List[iudx.rs.ResourceResult.ResourceResult][source]¶ Method to get the request for latest resource data.
- Parameters
query (ResourceQuery) – A query object of ResourceQuery class.
- Returns
returns a ResourceResult object.
- Return type
rs_result (ResourceResult)
-