-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support entities #152
Comments
* Warn if ODKC version too low * Modernised parsing of httr::content()
thank you @florianm for all the great work for this, I have an use case and I will be looking forward for it to try it out |
Oh that's great to hear, @roammi! I'm carving out some time for ruODK, so things are moving forward again. Do you feel your use case (if appropriate, simplified and de-identified) could be used in a vignette as an example to other ruODK users? |
* Downloaded CSV is named after Entity List name * Support ETag and $filter * Improve docs, link helpful resources * Improve submission_export: create local_dir if not exists * Add tests
Entity Lists are now supported, Entities coming soon. |
Yes I do, We will need to put it to work first, but it sounds great, I will be using the update entity function, I'll wait for the new release of ruodk to try it out, or is it a way to try [dataset_update] earlier? |
@roammi you can try out entitylist_update right now if you install the latest version of ruODK (see Readme) and update your ODKC_VERSION (see NEWS). In consultation with the core team ruODK uses the term entitylist for datasets. Are you saying that you would like to use https://docs.getodk.org/central-api-entity-management/#updating-an-entity ? I will work on that one next then so you can try it out right away. |
thank you @florianm I have the latest version and it worked succesfully! thank you for the hard work! I've used ruODK::entitylist_list(), ruODK::entitylist_detail() ruODK::entitylist_download() I also used bruno API and test it create, delete and update an entity succesfully so will be great to test it with ruODK. The challenge for update is the baseVersion, you have check the version and increase it by 1 each time making the update, it will be really great to do that natively in ruODK but it could be handled outside in R too |
You also have the option of using the force query parameter as described in https://docs.getodk.org/central-api-entity-management/#updating-an-entity If your updates are bringing in values from an external source of truth, it generally makes sense to force the update. baseVersion exists to detect parallel updates from multiple clients which is especially likely in an offline context. If you’re running a script that is online, it should also generally be appropriate to use the force flag. If your updates are based on the prior version of an entity, you should be able to pull the entity and then update it almost immediately meaning you don’t have to worry about conflicting updates between the two actions unless your context is extremely dynamic. If you intend to use baseVersion, you shouldn’t have to do any incrementing, you should be able to take the existing value for __version of the entity you want to update and use that as baseVersion for your update. If that’s what you plan on doing, I’d be interested in learning more about what you’re doing with the API and why forcing the update wouldn’t be appropriate for you. (I’m an ODK maintainer. We can also take this to the ODK forum, sorry about going a bit off topic, @florianm!) |
As always, the insight is highly appreciated, @lognaturel! I'll have to digest the above a bit. Maybe ruODK could default to use the force=true flag. |
https://github.com/ropensci/ruODK/releases/tag/v1.5.0 is out, pending support for the OData endpoints (after getting the naming right - see https://forum.getodk.org/t/ruodk-support-for-odata-entity-endpoints-naming/50037). |
Feature
Support all API endpoints relevant to entities.
Test data
ru_msg_abort
if the given ODKC_VERSION does not support the respective functionhttps://docs.getodk.org/central-api-dataset-management/
ruODK::entitylist_list()
ruODK::entitylist_detail()
ruODK::entitylist_update()
ruODK::entitylist_download()
https://docs.getodk.org/central-api-entity-management/
ruODK::entity_list()
ruODK::entity_create()
ruODK::entity_detail()
ruODK::entity_delete()
ruODK::entity_update()
ruODK::entity_versions()
ruODK::entity_changes()
ruODK::entity_audit()
OData endpoints
odata_entitylist_service_get
odata_entitylist_metadata_get
entity_list
function help) Data Document /v1/projects/{projectId}/datasets/{name}.svc/Entities asodata_entitylist_data_get
Small jobs
entity_detail
.yell_if_missing
to include optionally did (entity list / dataset ID) and eid (entity ID). Update all functions using did or eid.Discussion points
Approach: return a tibble if possible, keep unstructured = unpredictable data in list columns
The text was updated successfully, but these errors were encountered: