mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-17 19:35:13 +02:00
SPARQL service supports batching/streaming (#755)
This commit is contained in:
parent
d9dc4cbab5
commit
ee65d90fdd
5 changed files with 169 additions and 95 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue