You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add new attributes to an existing Temporal Entity within an NGSI-LD system
Example
importngsi_ld_clientfromngsi_ld_client.apiimporttemporal_apifromngsi_ld_client.model.entity_temporal_fragmentimportEntityTemporalFragmentfromngsi_ld_client.model.problem_detailsimportProblemDetailsfrompprintimportpprint# Defining the host is optional and defaults to http://localhost# See configuration.py for a list of all supported configuration parameters.configuration=ngsi_ld_client.Configuration(
host="http://localhost"
)
# Enter a context with an instance of the API clientwithngsi_ld_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=temporal_api.TemporalApi(api_client)
# example passing only required values which don't have defaults setpath_params= {
'entityId': "entityId_example",
}
body=EntityTemporalFragment(
context=LdContext(None),
location=[
GeoProperty(
type="GeoProperty",
value=GeoJSON(None),
observed_at="1970-01-01T00:00:00.00Z",
created_at="1970-01-01T00:00:00.00Z",
modified_at="1970-01-01T00:00:00.00Z",
dataset_id="dataset_id_example",
instance_id="instance_id_example",
)
],
observation_space=[],
operation_space=[],
id="id_example",
type=Name("_"),
created_at="1970-01-01T00:00:00.00Z",
modified_at="1970-01-01T00:00:00.00Z",
)
try:
api_response=api_instance.add_temporal_entity_attrs(
path_params=path_params,
body=body,
)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling TemporalApi->add_temporal_entity_attrs: %s\n"%e)
Selects the schema and serialization of the request body
accept_content_types
typing.Tuple[str]
default is ('application/json', 'application/ld+json', )
Tells the server the content type(s) that are accepted by the client
stream
bool
default is False
if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout
typing.Optional[typing.Union[int, typing.Tuple]]
default is None
the timeout used by the rest client
skip_deserialization
bool
default is False
when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Create or update temporal representation of an Entity within an NGSI-LD system
Example
importngsi_ld_clientfromngsi_ld_client.apiimporttemporal_apifromngsi_ld_client.model.entity_temporalimportEntityTemporalfromngsi_ld_client.model.problem_detailsimportProblemDetailsfrompprintimportpprint# Defining the host is optional and defaults to http://localhost# See configuration.py for a list of all supported configuration parameters.configuration=ngsi_ld_client.Configuration(
host="http://localhost"
)
# Enter a context with an instance of the API clientwithngsi_ld_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=temporal_api.TemporalApi(api_client)
# example passing only required values which don't have defaults setbody=EntityTemporal(None)
try:
api_response=api_instance.create_update_entity_temporal(
body=body,
)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling TemporalApi->create_update_entity_temporal: %s\n"%e)
Selects the schema and serialization of the request body
accept_content_types
typing.Tuple[str]
default is ('application/json', 'application/ld+json', )
Tells the server the content type(s) that are accepted by the client
stream
bool
default is False
if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout
typing.Optional[typing.Union[int, typing.Tuple]]
default is None
the timeout used by the rest client
skip_deserialization
bool
default is False
when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Allows modifying a specific Attribute (Property or Relationship) instance, identified by its instanceId, of a Temporal Representation of an Entity.
Example
importngsi_ld_clientfromngsi_ld_client.apiimporttemporal_apifromngsi_ld_client.model.nameimportNamefromngsi_ld_client.model.entity_temporal_fragmentimportEntityTemporalFragmentfromngsi_ld_client.model.problem_detailsimportProblemDetailsfrompprintimportpprint# Defining the host is optional and defaults to http://localhost# See configuration.py for a list of all supported configuration parameters.configuration=ngsi_ld_client.Configuration(
host="http://localhost"
)
# Enter a context with an instance of the API clientwithngsi_ld_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=temporal_api.TemporalApi(api_client)
# example passing only required values which don't have defaults setpath_params= {
'entityId': "entityId_example",
'attrId': Name("_"),
'instanceId': "instanceId_example",
}
body=EntityTemporalFragment(
context=LdContext(None),
location=[
GeoProperty(
type="GeoProperty",
value=GeoJSON(None),
observed_at="1970-01-01T00:00:00.00Z",
created_at="1970-01-01T00:00:00.00Z",
modified_at="1970-01-01T00:00:00.00Z",
dataset_id="dataset_id_example",
instance_id="instance_id_example",
)
],
observation_space=[],
operation_space=[],
id="id_example",
type=Name("_"),
created_at="1970-01-01T00:00:00.00Z",
modified_at="1970-01-01T00:00:00.00Z",
)
try:
api_response=api_instance.modify_entity_temporal_attr_instance(
path_params=path_params,
body=body,
)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling TemporalApi->modify_entity_temporal_attr_instance: %s\n"%e)
Selects the schema and serialization of the request body
accept_content_types
typing.Tuple[str]
default is ('application/json', 'application/ld+json', )
Tells the server the content type(s) that are accepted by the client
stream
bool
default is False
if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout
typing.Optional[typing.Union[int, typing.Tuple]]
default is None
the timeout used by the rest client
skip_deserialization
bool
default is False
when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Query temporal evolution of Entities from an NGSI-LD system
Example
importngsi_ld_clientfromngsi_ld_client.apiimporttemporal_apifromngsi_ld_client.model.coordinatesimportCoordinatesfromngsi_ld_client.model.nameimportNamefromngsi_ld_client.model.entity_temporal_listimportEntityTemporalListfromngsi_ld_client.model.geometryimportGeometryfromngsi_ld_client.model.georelimportGeorelfromngsi_ld_client.model.problem_detailsimportProblemDetailsfromngsi_ld_client.model.timerelimportTimerelfrompprintimportpprint# Defining the host is optional and defaults to http://localhost# See configuration.py for a list of all supported configuration parameters.configuration=ngsi_ld_client.Configuration(
host="http://localhost"
)
# Enter a context with an instance of the API clientwithngsi_ld_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=temporal_api.TemporalApi(api_client)
# example passing only optional valuesquery_params= {
'id': "id_example",
'idPattern': "idPattern_example",
'type': "type_example",
'attrs': "attrs_example",
'q': "q_example",
'georel': Georel(None),
'geometry': Geometry("Point"),
'coordinates': Coordinates(None),
'geoproperty': "geoproperty_example",
'timerel': Timerel("before"),
'timeproperty': Name("_"),
'time': "1970-01-01T00:00:00.00Z",
'endTime': "1970-01-01T00:00:00.00Z",
'csf': "csf_example",
'limit': 1,
'options': "temporalValues",
'lastN': 1,
}
try:
api_response=api_instance.query_temporal_entities(
query_params=query_params,
)
pprint(api_response)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling TemporalApi->query_temporal_entities: %s\n"%e)
Parameters
Name
Type
Description
Notes
query_params
RequestQueryParams
accept_content_types
typing.Tuple[str]
default is ('application/json', 'application/ld+json', )
Tells the server the content type(s) that are accepted by the client
stream
bool
default is False
if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout
typing.Optional[typing.Union[int, typing.Tuple]]
default is None
the timeout used by the rest client
skip_deserialization
bool
default is False
when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Attribute from Temporal Representation of Entity deletion
Example
importngsi_ld_clientfromngsi_ld_client.apiimporttemporal_apifromngsi_ld_client.model.nameimportNamefromngsi_ld_client.model.problem_detailsimportProblemDetailsfrompprintimportpprint# Defining the host is optional and defaults to http://localhost# See configuration.py for a list of all supported configuration parameters.configuration=ngsi_ld_client.Configuration(
host="http://localhost"
)
# Enter a context with an instance of the API clientwithngsi_ld_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=temporal_api.TemporalApi(api_client)
# example passing only required values which don't have defaults setpath_params= {
'entityId': "entityId_example",
'attrId': Name("_"),
}
try:
api_response=api_instance.remove_entity_temporal_attr(
path_params=path_params,
)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling TemporalApi->remove_entity_temporal_attr: %s\n"%e)
Parameters
Name
Type
Description
Notes
path_params
RequestPathParams
accept_content_types
typing.Tuple[str]
default is ('application/json', 'application/ld+json', )
Tells the server the content type(s) that are accepted by the client
stream
bool
default is False
if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout
typing.Optional[typing.Union[int, typing.Tuple]]
default is None
the timeout used by the rest client
skip_deserialization
bool
default is False
when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
importngsi_ld_clientfromngsi_ld_client.apiimporttemporal_apifromngsi_ld_client.model.nameimportNamefromngsi_ld_client.model.problem_detailsimportProblemDetailsfrompprintimportpprint# Defining the host is optional and defaults to http://localhost# See configuration.py for a list of all supported configuration parameters.configuration=ngsi_ld_client.Configuration(
host="http://localhost"
)
# Enter a context with an instance of the API clientwithngsi_ld_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=temporal_api.TemporalApi(api_client)
# example passing only required values which don't have defaults setpath_params= {
'entityId': "entityId_example",
'attrId': Name("_"),
'instanceId': "instanceId_example",
}
try:
api_response=api_instance.remove_entity_temporal_attr_instance(
path_params=path_params,
)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling TemporalApi->remove_entity_temporal_attr_instance: %s\n"%e)
Parameters
Name
Type
Description
Notes
path_params
RequestPathParams
accept_content_types
typing.Tuple[str]
default is ('application/json', 'application/ld+json', )
Tells the server the content type(s) that are accepted by the client
stream
bool
default is False
if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout
typing.Optional[typing.Union[int, typing.Tuple]]
default is None
the timeout used by the rest client
skip_deserialization
bool
default is False
when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Removes the temporal representation of an Entity from an NGSI-LD system
Example
importngsi_ld_clientfromngsi_ld_client.apiimporttemporal_apifromngsi_ld_client.model.nameimportNamefromngsi_ld_client.model.problem_detailsimportProblemDetailsfrompprintimportpprint# Defining the host is optional and defaults to http://localhost# See configuration.py for a list of all supported configuration parameters.configuration=ngsi_ld_client.Configuration(
host="http://localhost"
)
# Enter a context with an instance of the API clientwithngsi_ld_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=temporal_api.TemporalApi(api_client)
# example passing only required values which don't have defaults setpath_params= {
'entityId': "entityId_example",
}
query_params= {
}
try:
api_response=api_instance.remove_entity_temporal_by_id(
path_params=path_params,
query_params=query_params,
)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling TemporalApi->remove_entity_temporal_by_id: %s\n"%e)
# example passing only optional valuespath_params= {
'entityId': "entityId_example",
}
query_params= {
'type': Name("_"),
}
try:
api_response=api_instance.remove_entity_temporal_by_id(
path_params=path_params,
query_params=query_params,
)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling TemporalApi->remove_entity_temporal_by_id: %s\n"%e)
Parameters
Name
Type
Description
Notes
query_params
RequestQueryParams
path_params
RequestPathParams
accept_content_types
typing.Tuple[str]
default is ('application/json', 'application/ld+json', )
Tells the server the content type(s) that are accepted by the client
stream
bool
default is False
if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout
typing.Optional[typing.Union[int, typing.Tuple]]
default is None
the timeout used by the rest client
skip_deserialization
bool
default is False
when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned
Retrieve the temporal representation of an specific Entity from an NGSI-LD system. It's possible to specify the Entity attributes to be retrieved by using query parameters
Example
importngsi_ld_clientfromngsi_ld_client.apiimporttemporal_apifromngsi_ld_client.model.entity_temporalimportEntityTemporalfromngsi_ld_client.model.nameimportNamefromngsi_ld_client.model.problem_detailsimportProblemDetailsfromngsi_ld_client.model.timerelimportTimerelfrompprintimportpprint# Defining the host is optional and defaults to http://localhost# See configuration.py for a list of all supported configuration parameters.configuration=ngsi_ld_client.Configuration(
host="http://localhost"
)
# Enter a context with an instance of the API clientwithngsi_ld_client.ApiClient(configuration) asapi_client:
# Create an instance of the API classapi_instance=temporal_api.TemporalApi(api_client)
# example passing only required values which don't have defaults setpath_params= {
'entityId': "entityId_example",
}
query_params= {
}
try:
api_response=api_instance.retrieve_entity_temporal_by_id(
path_params=path_params,
query_params=query_params,
)
pprint(api_response)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling TemporalApi->retrieve_entity_temporal_by_id: %s\n"%e)
# example passing only optional valuespath_params= {
'entityId': "entityId_example",
}
query_params= {
'attrs': "attrs_example",
'type': Name("_"),
'options': "temporalValues",
'timerel': Timerel("before"),
'timeproperty': Name("_"),
'time': "1970-01-01T00:00:00.00Z",
'endTime': "1970-01-01T00:00:00.00Z",
'lastN': 1,
}
try:
api_response=api_instance.retrieve_entity_temporal_by_id(
path_params=path_params,
query_params=query_params,
)
pprint(api_response)
exceptngsi_ld_client.ApiExceptionase:
print("Exception when calling TemporalApi->retrieve_entity_temporal_by_id: %s\n"%e)
Parameters
Name
Type
Description
Notes
query_params
RequestQueryParams
path_params
RequestPathParams
accept_content_types
typing.Tuple[str]
default is ('application/json', 'application/ld+json', )
Tells the server the content type(s) that are accepted by the client
stream
bool
default is False
if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout
typing.Optional[typing.Union[int, typing.Tuple]]
default is None
the timeout used by the rest client
skip_deserialization
bool
default is False
when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned