brainkb_ingest_upload
Ingest a file you staged with POST /upload into a named graph.
This is the route for a large local file: your HTTP client streams the bytes
straight to this server over HTTPS, then you name the resulting upload_id here. The
server reads its own staged copy and posts it to the ingest API internally, so
the RDF never passes through a model's context — nothing to transcribe, no
context-window ceiling, and no reason to split the document (splitting breaks
blank-node identity and silently detaches triples, permanently).
Stage a file with any HTTP client — the point is that the LIBRARY reads the file,
so the bytes never pass through a model:
import requests, hashlib, pathlib
f = pathlib.Path("review.ttl")
r = requests.post(
"https://mcp.brainkb.org/upload",
params={"filename": f.name,
"sha256": hashlib.sha256(f.read_bytes()).hexdigest()},
headers={"Authorization": f"Bearer {TOKEN}"},
data=f.open("rb"), # streamed — never loaded into memory
)
print(r.json()) # -> {"upload_id": "up_...", "state": "staged"}
It returns an upload_id and the sha256 the server computed — compare it with your
own before ingesting.
Returns a job_id; poll brainkb_job_status, then reconcile brainkb_delta(job_id)
against the triple count you expected. The staged copy is deleted once the
ingest API has accepted the bytes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| upload_id | Yes | ||
| named_graph_iri | Yes |