Skip to main content

Module libs

Module libs 

Source
Expand description

Library and spec management endpoints.

§Overview

These endpoints manage Xeto-based ontology libraries at runtime: listing specs, inspecting individual specs, loading/unloading libraries, exporting library source, and validating entities against the ontology.

§Endpoints

  • POST /api/specs — list specs, optionally filtered by lib (Str). Response: qname, name, lib, base, doc, abstract.
  • POST /api/spec — get single spec by qname (Str). Response: qname, name, lib, base, doc, abstract, slots.
  • POST /api/loadLib — load library from name (Str) and source (Str). Response: loaded, specs.
  • POST /api/unloadLib — unload library by name (Str). Response: unloaded.
  • POST /api/exportLib — export library by name (Str) to Xeto source. Response: name, source.
  • POST /api/validate — validate entity rows against the ontology. Response: entity, issueType, detail.

§Errors

  • 400 Bad Request — missing required columns, spec not found, load/unload error, or request decode failure.
  • 500 Internal Server Error — encoding error.

Functions§

handle_export_lib
POST /api/exportLib — export a library to Xeto source text.
handle_load_lib
POST /api/loadLib — load a library from Xeto source text.
handle_spec
POST /api/spec — get a single spec by qualified name.
handle_specs
POST /api/specs — list specs, optionally filtered by library.
handle_unload_lib
POST /api/unloadLib — unload a library by name.
handle_validate
POST /api/validate — validate entities against the ontology.