Skip to content

gds_interchange.owl.ontology

OWL class hierarchy (TBox) -- core schema definitions.

GDS core ontology — OWL class hierarchy and property definitions (TBox).

Builds the GDS ontology programmatically as an rdflib Graph. This defines the schema (classes, properties, domain/range) — not instance data.

build_core_ontology()

Build the complete GDS core ontology as an OWL graph (TBox).

Returns an rdflib Graph containing all OWL class declarations, object properties, and datatype properties for the GDS ecosystem.

This is the schema — use the export functions to produce instance data (ABox).

Source code in packages/gds-interchange/gds_interchange/owl/ontology.py
def build_core_ontology() -> Graph:
    """Build the complete GDS core ontology as an OWL graph (TBox).

    Returns an rdflib Graph containing all OWL class declarations,
    object properties, and datatype properties for the GDS ecosystem.

    This is the schema — use the export functions to produce instance data (ABox).
    """
    g = Graph()
    _bind_prefixes(g)

    # Ontology metadata
    g.add((GDS["ontology"], RDF.type, OWL.Ontology))
    g.add(
        (
            GDS["ontology"],
            RDFS.label,
            Literal("Generalized Dynamical Systems Ontology"),
        )
    )
    g.add(
        (
            GDS["ontology"],
            RDFS.comment,
            Literal(
                "OWL ontology for typed compositional specifications "
                "of complex systems, grounded in GDS theory."
            ),
        )
    )

    _build_composition_algebra(g)
    _build_spec_framework(g)
    _build_ir_classes(g)
    _build_verification_classes(g)

    return g