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

262 support entity creation with keyvalues #264

Merged
merged 11 commits into from
Apr 24, 2024

Conversation

djs0109
Copy link
Contributor

@djs0109 djs0109 commented Mar 26, 2024

closes #262

@djs0109
Copy link
Contributor Author

djs0109 commented Mar 26, 2024

@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.

@djs0109 djs0109 requested review from tstorek and RCX112 March 26, 2024 14:07
) for i in range(0, 1000)]
client.update(entities=entities_keyvalues,
update_format="keyValues",
action_type=ActionType.APPEND)
Copy link
Collaborator

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?

Copy link
Contributor Author

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?

Copy link
Collaborator

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

Copy link
Collaborator

@RCX112 RCX112 Apr 23, 2024

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

Copy link
Contributor Author

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

Copy link
Collaborator

@RCX112 RCX112 left a 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 :)

@djs0109
Copy link
Contributor Author

djs0109 commented Apr 23, 2024

@RCX112 Thank you for the review, the code has been revised accordingly

@djs0109 djs0109 merged commit bad7f87 into master Apr 24, 2024
1 check passed
@djs0109 djs0109 deleted the 262-Support-entity-creation-with-keyvalues branch April 24, 2024 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support entity creation with keyvalues
2 participants