Upload Ontology
Upload a single ontology file for later use in cognify operations.
Request Parameters
- ontology_key (str): Unique, user-defined identifier for the ontology (plain string — values starting with ’[’ or ’{’ are rejected; duplicate keys return 400). Use this key later as the
ontology_keyparameter in /api/v1/cognify or /api/v1/remember. - ontology_file (UploadFile): Single ontology file in any RDF serialization rdflib parses (RDF/XML, Turtle, N3, JSON-LD, N-Triples, N-Quads, TriG). The accepted filename extensions and, for filenames without one of them, the accepted Content-Types are listed on the parameter itself; both come from
EXTENSION_FORMATS/CONTENT_TYPE_FORMATSinRDFLibOntologyResolver. - description (Optional[str]): Optional description for the ontology (plain string; values starting with ’[’ or ’{’ are rejected).
Response
Returns metadata about the uploaded ontology including key, filename, size, and upload timestamp.
Error Codes
- 400 Bad Request: Unsupported file format (the message lists accepted extensions and content types), duplicate key, multiple files uploaded
- 500 Internal Server Error: File system or processing errors
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Unique, user-defined identifier for this ontology. Reference it later via the ontology_key parameter of the cognify/remember endpoints.
"medical_ontology"
Single ontology file in any RDF serialization rdflib parses. The format is taken from the filename extension (.owl, .rdf, .xml, .ttl, .n3, .jsonld, .nt, .nq, .trig), or - when the extension is not one of these - from the part's Content-Type (application/ld+json, application/n-quads, application/n-triples, application/rdf+xml, application/trig, application/x-turtle, application/xml, text/n3, text/turtle, text/xml). Files matching neither are rejected with 400. Exactly one file per request.
Optional human-readable description (plain string; values starting with '[' or '{' are rejected).
"OWL ontology of medical conditions and treatments"
Response
Successful Response
The response is of type Response Upload Ontology Api V1 Ontologies Post · object.