opendatabio / opendatabio-r

R package for interacting with OpenDataBio
https://opendatabio.gitlab.io/
GNU General Public License v3.0
3 stars 2 forks source link

Returning IDS after importation #15

Closed betovicentini closed 6 years ago

betovicentini commented 6 years ago

Missing aspect from #12:

For returning the IDs, I can set the server to add log messages such as "Location Cananéia successfully imported with ID 14", would this be enough?

I don't think so. I would be nice for each Job to get the ids of all locations imported in the job in a tabular format. If data is spatial, then a single id would be needed (if new or found in the database). If a data.frame is submitted with many locations, then we need the id for each line submitted in the same order.

One option would be to have the log file contain a chunk with the ids (found or created) for each record submitted, and this table can be extracted in R from the log file by a new function with Job ID. So, the upload function returns a job id, which can be used to get the ids of the imported objects from a chunk in the log file.

andrechalom commented 6 years ago

Right... then the best approach here is to add a field to the API response with "affected ids". Then a client function can be written such as

> odb_affected_ids(job_id)
[1] 1267 1268 1269 1270