get_request()

Send a GET request to a SPARQL endpoint and retrieve JSON data.

Usage

Source

get_request(
    url,
    query,
    max_retries=None,
    base_delay=None,
    timeout=None,
)

Uses exponential backoff with jitter for retries. Falls back to QLever endpoint if the primary endpoint fails.

Parameters

url: str

URL.

query: str

SPARQL query string.

max_retries: int | None = None

None. Default is None.

base_delay: float | None = None

Base delay (seconds) for backoff. Uses config default if None. Default is None.

timeout: int | None = None
None. Default is None.

Returns

list[dict[str, str]]
List of dictionaries representing query results.

Raises

NetworkError
If the request fails after all retries.