Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Save API calls by using lists #5

Open
mhucka opened this issue Mar 17, 2019 · 0 comments
Open

Save API calls by using lists #5

mhucka opened this issue Mar 17, 2019 · 0 comments
Labels
Coding: enhancement ✨ New feature or request

Comments

@mhucka
Copy link
Collaborator

mhucka commented Mar 17, 2019

Right now, filling in attribute values uses a one-call-one-item approach. However, I just realized today that it's possible to search for such things as researchers using a list syntax like this:

search publications where researchers.id in ["ur.015050223327.40", "ur.07402772253.38"] return researchers

This means that it would be possible to reduce the number of API calls in some situations by getting the results for multiple people at once. This would help avoid hitting the API rate limit as much.

The tricky part is figuring out in what situation you can group a call for data like this. In the current scheme of things, a fill operation is initiated when something accesses an attribute that has not yet been set, like the list of affiliations on a researcher. To do that for multiple researchers in one shot, you would need to know ahead of time that the user's code is going to access the fields on multiple objects, and know which specific objects they will be. That means some kind of predictive heuristic approach. This needs more thought.

@mhucka mhucka added the Coding: enhancement ✨ New feature or request label Mar 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Coding: enhancement ✨ New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant