Skip to main content

Module shape_source

Module shape_source 

Source
Expand description

Where a family’s shape table comes from.

By default it is the table cimgen generated. With the dynamic-shapes feature, a directory of SHACL TTL files can supply it instead, so a new profile version is a data load rather than a recompile.

Resolution order, highest first:

  1. [load_from] — an explicit call, for libraries and tests
  2. CIMOXIDE_PROFILES — for the CLI, the servers and the Python bindings. It lists directories, separated as in PATH, searched for profile files, which are sorted by what they declare ([cimschema::profile_file::Pool]): a family’s constraint files, manifests, PROF descriptors and vocabulary all come from it, and a family it holds no constraint files of keeps its generated table
  3. the generated table

CGMES classes are compiled structs, so a CGMES table loaded from another release can name classes this build cannot decode; shapes on those simply match nothing.

A directory that is missing or fails to parse falls back to the generated table with a warning. Silently validating against a stale profile because a path had a typo is the worst outcome available here.

This mirrors cimmodel::schema_source closely enough that the two should be read side by side. The one difference that matters: there, the generator and the loader build the table by separate code paths and a test compares them. Here both call cimschema::shacl::resolve, so there is no second implementation to drift — this module only turns the resolved model into the &'static form the interpreter needs.

Functions§

resolve
Resolve the shape table for a family.
resolve_profiles
Resolve the profile index for a bag family.