SPARQL service supports batching/streaming (#755)

This commit is contained in:
cybermaggedon 2026-04-02 17:54:07 +01:00 committed by GitHub
parent d9dc4cbab5
commit ee65d90fdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 169 additions and 95 deletions

View file

@ -20,6 +20,8 @@ class SparqlQueryRequest:
collection: str = ""
query: str = "" # SPARQL query string
limit: int = 10000 # Safety limit on results
streaming: bool = False # Enable streaming mode
batch_size: int = 20 # Bindings per batch in streaming mode
@dataclass
class SparqlQueryResponse:
@ -36,5 +38,7 @@ class SparqlQueryResponse:
# For CONSTRUCT/DESCRIBE queries
triples: list[Triple] = field(default_factory=list)
is_final: bool = True # False for intermediate batches in streaming
sparql_query_request_queue = queue('sparql-query', cls='request')
sparql_query_response_queue = queue('sparql-query', cls='response')