IOntologyQuery
IOntologyQuery is the runtime query surface over a composed OntologyGraph. The source generator emits a concrete OntologyQueryService that implements every member; agents and dispatcher decorators inject IOntologyQuery to ask “what actions are valid here?”, “which properties does this action change?”, “what would I touch downstream if I edited X?” without re-parsing the ontology at every call site.
Namespace: Strategos.Ontology.Query. Source: src/Strategos.Ontology/Query/IOntologyQuery.cs.
Members
Section titled “Members”| Category | Member | Returns |
|---|---|---|
| Core | GetObjectTypes(string? domain, string? implementsInterface, bool includeSubtypes) | IReadOnlyList<ObjectTypeDescriptor> |
| Core | GetActions(string objectType) | IReadOnlyList<ActionDescriptor> |
| Core | GetLinks(string objectType) | IReadOnlyList<LinkDescriptor> |
| Core | GetImplementors(string interfaceName) | IReadOnlyList<ObjectTypeDescriptor> |
| Preconditions | GetCandidateActions(string objectType, ActionFacts? facts) | IReadOnlyList<ActionCandidateEvaluation> |
| Preconditions | GetCandidateActions(string domain, string objectType, ActionFacts? facts) | IReadOnlyList<ActionCandidateEvaluation> |
| Preconditions | GetCandidateActionsAsync(ActionPrincipal, domain, objectType, objectId, ActionFacts?, CancellationToken) | Task<IReadOnlyList<ActionCandidateEvaluation>> |
| Preconditions | GetValidActions(string objectType, ActionFacts? facts) | IReadOnlyList<ActionDescriptor> |
| Preconditions | GetValidActionsAsync(ActionPrincipal, domain, objectType, objectId, ActionFacts?, CancellationToken) | Task<IReadOnlyList<ActionDescriptor>> |
| Preconditions | GetActionConstraintReport(string objectType, ActionFacts? facts) | IReadOnlyList<ActionConstraintReport> |
| Preconditions | GetActionConstraintReport(string domain, string objectType, ActionFacts? facts) | IReadOnlyList<ActionConstraintReport> |
| Postconditions | TracePostconditions(string objectType, string actionName, int maxDepth) | IReadOnlyList<PostconditionTrace> |
| Lifecycle | GetActionsForState(string objectType, string stateName) | IReadOnlyList<ActionDescriptor> |
| Lifecycle | GetTransitionsFrom(string objectType, string stateName) | IReadOnlyList<LifecycleTransitionDescriptor> |
| Derivation | GetAffectedProperties(string objectType, string propertyName) | IReadOnlyList<AffectedProperty> |
| Derivation | GetDerivationChain(string objectType, string propertyName) | IReadOnlyList<DerivationSource> |
| Interface actions | GetInterfaceActions(string interfaceName) | IReadOnlyList<InterfaceActionDescriptor> |
| Interface actions | ResolveInterfaceAction(string objectType, string interfaceActionName) | ActionDescriptor? |
| Inverse links | GetInverseLinks(string objectType, string linkName) | IReadOnlyList<LinkDescriptor> |
| Extension points | GetExtensionPoints(string objectType) | IReadOnlyList<ExternalLinkExtensionPoint> |
| Extension points | GetIncomingCrossDomainLinks(string objectType) | IReadOnlyList<ResolvedCrossDomainLink> |
| Object sets | GetObjectSet<T>(string objectType) | ObjectSet<T> where T : class |
| Object sets | GetObjectTypeNames<T>() | IReadOnlyList<string> where T : class |
| Validation (2.5.0) | EstimateBlastRadius(IReadOnlyList<OntologyNodeRef> touchedNodes, BlastRadiusOptions? options) | BlastRadius |
| Validation (2.5.0) | DetectPatternViolations(IReadOnlyList<OntologyNodeRef> affectedNodes, DesignIntent intent) | IReadOnlyList<PatternViolation> |
Notes per member group
Section titled “Notes per member group”Core lookups
Section titled “Core lookups”GetObjectTypes returns every registered descriptor when called with no arguments. domain narrows to a single domain; implementsInterface narrows to types whose ImplementedInterfaces contains the named interface; includeSubtypes follows the IsA<TParent>() hierarchy when filtering by parent. The returned list preserves registration order.
GetActions, GetLinks, and GetImplementors resolve their target by simple name; pass the (domain, objectType) overload of GetActionConstraintReport instead when two domains register the same name.
Precondition evaluation
Section titled “Precondition evaluation”GetCandidateActions* evaluates immutable typed predicates against
ActionFacts. It returns results carrying ActionAvailability.Available or
Indeterminate, plus the hard and soft constraint evaluations; actions proven
Unavailable are excluded. A missing fact is indeterminate; explicit
PredicateLiteral.Null and link absence are known values.
GetValidActions* is the compatibility convenience: it excludes only actions
proven unavailable and therefore returns the same retained action set without
the evaluations. Use GetCandidateActions* when the caller must distinguish
known availability from incomplete information, and
GetActionConstraintReport* to inspect unavailable actions too. The async
forms supply the principal/target context needed by relation and custom evaluators.
Domain-qualified overloads are the recommended call site when multiple domains
may register the same object name. The default
GetActionConstraintReport(domain, objectType, facts) implementation falls
back to the simple-name overload only for compatibility with test doubles.
Postcondition tracing
Section titled “Postcondition tracing”TracePostconditions(objectType, actionName, maxDepth = 1) follows declared Modifies, CreatesLinked, and EmitsEvent postconditions; raising maxDepth follows derivation chains from the modified properties, surfacing transitive effects. The result is ordered by traversal depth.
Object sets
Section titled “Object sets”GetObjectSet<T>(string objectType) returns a typed ObjectSet<T> rooted at the named descriptor. GetObjectTypeNames<T>() returns every descriptor name T was registered under, in registration order; a single-registered type has a one-element list, and an unregistered type has an empty list. This lets consumers (e.g. Basileus) enumerate per-collection partitions of a shared content-carrier type without hardcoding descriptor names.
Blast radius and pattern violations (2.5.0)
Section titled “Blast radius and pattern violations (2.5.0)”EstimateBlastRadius walks links, derivation chains, postconditions, and cross-domain links from a seed set of OntologyNodeRef values until BlastRadiusOptions.MaxExpansionDegree is reached. The returned BlastRadius carries a deterministically ordered set of affected nodes, the cross-domain hops encountered, and a classified scope (single-type, single-domain, cross-domain).
DetectPatternViolations evaluates the supplied affectedNodes against the DesignIntent and returns any pattern fires (empty when the intent is satisfied). The signatures are declared on IOntologyQuery as default-throwing methods — concrete implementations such as OntologyQueryService override them. Test doubles that pre-date 2.5.0 throw NotSupportedException when called.
Type parameters and nullability
Section titled “Type parameters and nullability”Every where T : class constraint is on ObjectSet<T> and
GetObjectTypeNames<T>. ResolveInterfaceAction returns null when no
concrete action implements the named interface action on objectType.
ActionFacts is optional; passing null means every property and link fact
is unknown, not false.