-
Notifications
You must be signed in to change notification settings - Fork 14
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
262 support entity creation with keyvalues #264
Conversation
@tstorek can you have a look at this? https://github.com/RWTH-EBC/FiLiP/blob/262-Support-entity-creation-with-keyvalues/examples/ngsi_v2/e12_ngsi_v2_use_case_models.py Here are some backgrounds of this implementation: In an ongoing research, I have faced the trade-off between the usability of the Pydantic models and the FIWARE- or Filip-compatibility. Therefore, I want to have a way to keep the Pydantic model simple, reusable, while FIWARE- or Filip-compatible. |
) for i in range(0, 1000)] | ||
client.update(entities=entities_keyvalues, | ||
update_format="keyValues", | ||
action_type=ActionType.APPEND) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djs0109 Is this intended by FIWARE or why can you create multiple entities with the same ID?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the IDs are different, from 0 to 1000. Or does it show something else in your test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djs0109 You can only see that if you look at each specific type separately in the GET request for the OCB endpoint, for example:
GET http://localhost:1026/v2/entities?limit=1000&type=filip:object:TypeA
and
GET http://localhost:1026/v2/entities?limit=1000&type=filip:object:TypeC
gives me entities with different types but with the same ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also use GET http://localhost:1026/v2/entities?limit=1000&id=0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RCX112 ok, I understand what you mean now. Yes, the IDs of different types are the same. It is fine here, but still thanks for pointing it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djs0109 I only have small comments :)
@RCX112 Thank you for the review, the code has been revised accordingly |
closes #262