orchestracities/ngsi-timeseries-api

CrateDB InstanceID:

drypatrick opened this issue · 1 comments

The instance ID in the mt<FIWARE_SERVICE>.et<CONTEXTS_TYPE> table created in CrateDB by QuantumLeap starts with urn:ngsi-ld:*, also if i'm using NGSI-V2.
Since this is something that could lead to some confusion about the version of NGSI in use (LD o V2), can be added the possibility to chose how to form the URN?

Query:

curl -iX POST \
	'http://localhost:4200/_sql' \
	-H 'Content-Type: application/json' \
	-d '{"stmt":"SELECT * FROM mtopcua_car.etdevice ORDER BY time_index ASC LIMIT 3"}'

Answer:

{
	"cols": ["entity_id", "entity_type", "time_index", "fiware_servicepath", "__original_ngsi_entity__", "instanceid", "second"],
"rows": [
			["age01_Car", "Device", 1659188768727, "/demo", null, "urn:ngsi-ld:ecd573d6-c3f2-468c-bc48-4900864e629a", "9"],
			["age01_Car", "Device", 1659188770684, "/demo", null, "urn:ngsi-ld:c3557961-38f3-4da3-ae9c-86bc7c8536d4", "10"],
			["age01_Car", "Device", 1659188771499, "/demo", null, "urn:ngsi-ld:f3ef4766-d971-47d3-9331-5f7f335e4d26", "12"]
	],
	"rowcount": 3,
	"duration": 4.069
}

The instance ID in the mt<FIWARE_SERVICE>.et<CONTEXTS_TYPE> table created in CrateDB by QuantumLeap starts with urn:ngsi-ld:*, also if i'm using NGSI-V2. Since this is something that could lead to some confusion about the version of NGSI in use (LD o V2), can be added the possibility to chose how to form the URN?

Query:

curl -iX POST \
	'http://localhost:4200/_sql' \
	-H 'Content-Type: application/json' \
	-d '{"stmt":"SELECT * FROM mtopcua_car.etdevice ORDER BY time_index ASC LIMIT 3"}'

Answer:

{
	"cols": ["entity_id", "entity_type", "time_index", "fiware_servicepath", "__original_ngsi_entity__", "instanceid", "second"],
"rows": [
			["age01_Car", "Device", 1659188768727, "/demo", null, "urn:ngsi-ld:ecd573d6-c3f2-468c-bc48-4900864e629a", "9"],
			["age01_Car", "Device", 1659188770684, "/demo", null, "urn:ngsi-ld:c3557961-38f3-4da3-ae9c-86bc7c8536d4", "10"],
			["age01_Car", "Device", 1659188771499, "/demo", null, "urn:ngsi-ld:f3ef4766-d971-47d3-9331-5f7f335e4d26", "12"]
	],
	"rowcount": 3,
	"duration": 4.069
}

hi @drypatrick

the instanceid is just a way to identify a specific entry inside the timeseries db, it's not the entity id, also, it if you use APIs it's not even exposed at the time being. why having instance id in the schema? forward compatibility with ngsi-ld, and having a way to delete a specific row in the timeseries.