Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CrateDB InstanceID: #672

Open
drypatrick opened this issue Aug 2, 2022 · 1 comment
Open

CrateDB InstanceID: #672

drypatrick opened this issue Aug 2, 2022 · 1 comment
Assignees

Comments

@drypatrick
Copy link

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
}
@chicco785
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants