From 5b30f7f489a4a5daa324cbd9f5ea5d245150c4d8 Mon Sep 17 00:00:00 2001 From: Prathamesh Hukkeri Date: Tue, 28 Jul 2026 10:58:52 +0530 Subject: [PATCH 1/2] fix(api): use SPARQLWrapper.setMethod() for POST requests The SPARQLWrapper library does not expose .method as a settable public attribute. Direct assignment (sparql.method = 'POST') is silently ignored, causing all SPARQL queries to use GET instead of POST. This fix uses the correct API: sparql.setMethod('POST'). Fixes #69 --- databusclient/api/download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/databusclient/api/download.py b/databusclient/api/download.py index ad7d76e..eef4db9 100644 --- a/databusclient/api/download.py +++ b/databusclient/api/download.py @@ -595,7 +595,7 @@ def _query_sparql_endpoint(endpoint_url, query, databus_key=None) -> dict: Dictionary containing the query results. """ sparql = SPARQLWrapper(endpoint_url) - sparql.method = "POST" + sparql.setMethod("POST") sparql.setQuery(query) sparql.setReturnFormat(JSON) if databus_key is not None: From 0542f4b9b9ea423566a0b71029eb86bda83004ba Mon Sep 17 00:00:00 2001 From: Prathamesh Hukkeri Date: Wed, 29 Jul 2026 17:11:31 +0530 Subject: [PATCH 2/2] fix tests: add setMethod to DummySPARQL mock --- tests/conftest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 5f4c0a2..9f522c8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,6 +10,9 @@ class DummySPARQL: def __init__(self, *args, **kwargs): pass + def setMethod(self, m): + self._method = m + def setQuery(self, q): self._q = q