Ontologies and shapes¶
Ontologies and versions¶
The ontologies of a project are versioned. A job that renders an ontology either creates one or extends one by writing a new version; a version names the versions it derives from. A head is a version nothing newer derives from. An ontology with several heads has diverged: a job cannot extend it, but an upload or an edit merges it, since a new version from a file derives from every head.
GET /ontologies?project=…: the project's ontologies with their heads. A job infixed_single_ontologymode takes anontology_idfrom here.GET /ontologies/{id}: the version history, with the job or upload each version came from.GET /ontologies/{id}/versions/{key}/turtle: one version;GET /ontologies/{id}/diff?from=&to=: the terms added, removed or changed between two versions (by default, a head against the version it derives from).POST /ontologies(multipartfile, optionalname): upload an ontology. Turtle, N-Triples, JSON-LD and RDF/XML are read. A file whose ontology IRI is new starts a new ontology (namesets its id: nevercd,doc,facts,ocorontocast, and a standard prefix such asprovonly for the ontology in that prefix's namespace); one whose IRI the project holds becomes that ontology's next version. The answer'screatedsays which:ontology,version, orunchangedwhen the content equals the head's and nothing was stored.POST /ontologies/{id}/versions(body: the whole ontology astext/turtle): save an edit as the next version, under the same rules.POST /ontologies/{id}/previewtakes the same body and answers what saving it would store (its label and its changes against the head) without writing anything.- A new version's label is the file's
owl:versionInfowhen it is higher than every head's; otherwise the highest head's label with the minor part bumped. It keeps the ontology's IRI and id. DELETE /ontologies/{id}deletes an ontology;DELETE /ontologies/{id}/versions/{key}removes an older version's content and keeps its place in the history. A head cannot be removed alone.
Only one writer changes a project's ontologies at a time: while a job renders an ontology, changes through the API answer 409 ontology_writer_running. Facts-only jobs run alongside.
Ontology gallery¶
The gallery holds curated public ontologies you can add to a project in one call.
GET /gallery?project=…: the entries, grouped by domain, each with its licence and attribution, its class, property and triple counts,fits_plan(your plan takes an ontology that size) andin_project(the project already holds its ontology IRI).POST /ontologies/gallery/{id}?project=…: add an entry as a new ontology, named by the entry's id. It answers201with what an upload answers. The gallery accepts files up to its own size cap (10 MB), so an entry may be larger than a file you can upload; the triple limits still apply, the server's and your plan's (409plan_limit). An entry the project already holds answers409ontology_exists; to add a version, upload the file instead.
Shapes¶
SHACL shapes validate a project's facts. POST /shapes (multipart file, optional name) uploads a shapes document; an upload under the same name replaces it. GET /shapes lists them, GET /shapes/turtle?graph=… downloads one and DELETE /shapes?graph=… deletes one.