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

Make SPARQLModelAdapter.query asynchronous #49

Open
lu-pl opened this issue Aug 8, 2024 · 2 comments
Open

Make SPARQLModelAdapter.query asynchronous #49

lu-pl opened this issue Aug 8, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@lu-pl
Copy link
Contributor

lu-pl commented Aug 8, 2024

SPARQLModelAdapter.query should be asynchronous.

Especially SPARQLModelAdapter._query_paginate_grouped and SPARQLModelAdapter._query_paginate_ungrouped should support async; currently those methods execute the main query and the counter query synchronously.

@lu-pl lu-pl self-assigned this Aug 17, 2024
@lu-pl lu-pl added the enhancement New feature or request label Aug 17, 2024
@lu-pl
Copy link
Contributor Author

lu-pl commented Jan 2, 2025

Update: Since SPARQLModelAdapter uses strategies for SPARQL query execution now (defaulting to HttpxStrategy), making SPARQLModelAdapter query execution asynchronous would either mean specialcasing the SPARQLWrapperStrategy which cannot be made async, or dropping support for SPARQLWrapper entirely and moving to httpx for SPARQL query execution.

Clearly, moving to httpx entirely is the better option.

@lu-pl
Copy link
Contributor Author

lu-pl commented Jan 2, 2025

httpx uses an httpx.AsyncClient context for asynchronous calls, its interface is widely identical to the httpx.post callable used for running SPARQL queries, so moving to async query execution should not be too complicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant