Proposal: Adopt ontology-query as an Ontology Access Layer tool for OSI
Summary
I propose that the OSI project adopt (or officially recommend) a lightweight reference tool called ontology-query as an Ontology Access Layer for OSI semantic models.
ontology-query loads an OSI YAML file, builds a small knowledge graph, materializes Datalog facts (deterministic reasoning), and exposes:
- a Python SDK for other agents/tools
- a CLI for interactive ontology interrogation
This is intended to support agent-to-agent architectures (Ontology Agent ↔ Data/Service Agent) by providing a rigorous, deterministic way to query and reason over the ontology (datasets/fields/relationships/metrics/behavior), without relying on NL→SQL.
Motivation
OSI standardizes semantic models, but many agent workflows need a consistent “ontology access” interface:
- Discoverability: list datasets/fields/metrics/actions
- Deterministic reasoning: relationship reachability / join-path discovery / impact analysis
- Attribution & planning support: determine which actions can change which fields (via
behavior.actions[].effects)
- Enable an Ontology Agent to request data from a Data/Service Agent using a stable, machine-readable query plan
While tools can implement this independently, a small reference implementation would accelerate adoption and reduce fragmentation.
Proposed scope (initial)
Supported OSI concepts
- datasets + fields
- relationships (transitive reachability)
- metrics (names; expressions are not interpreted by this tool)
- behavior layer:
- preferred:
semantic_model.behavior
- legacy: behavior embedded under
custom_extensions JSON
actions (preferred) + action_types (alias)
effects (impact annotations)
Example queries
- “List datasets”
- “List fields of suppliers”
- “Which actions can change suppliers.status?”
- “Show effects of suppliers/block”
- “Is dataset A reachable to dataset B through relationships?”
Repository
Reference implementation: https://github.com/zljie/ontology-query
Why Datalog (rigor)
The core requirement is rigorous logical inference with reproducible results. Datalog provides:
- deterministic evaluation
- transitive closure / rule-based derivations
- a foundation for explainability (proof-style traces can be added incrementally)
Suggested next steps
- If maintainers agree with the direction, we can:
- add
ontology-query under an OSI org repository (or list as an official companion tool)
- align naming/packaging and CI expectations
- Add a small “ontology access layer” section to OSI docs referencing the tool.
Questions
- Would OSI maintainers accept an official companion tool for ontology access?
- Preference: keep it as a separate repo under OSI org, or under
tools/ in the main repo?
- Any constraints on dependencies (e.g., allow
pyDatalog) or target Python versions?
Proposal: Adopt
ontology-queryas an Ontology Access Layer tool for OSISummary
I propose that the OSI project adopt (or officially recommend) a lightweight reference tool called
ontology-queryas an Ontology Access Layer for OSI semantic models.ontology-queryloads an OSI YAML file, builds a small knowledge graph, materializes Datalog facts (deterministic reasoning), and exposes:This is intended to support agent-to-agent architectures (Ontology Agent ↔ Data/Service Agent) by providing a rigorous, deterministic way to query and reason over the ontology (datasets/fields/relationships/metrics/behavior), without relying on NL→SQL.
Motivation
OSI standardizes semantic models, but many agent workflows need a consistent “ontology access” interface:
behavior.actions[].effects)While tools can implement this independently, a small reference implementation would accelerate adoption and reduce fragmentation.
Proposed scope (initial)
Supported OSI concepts
semantic_model.behaviorcustom_extensionsJSONactions(preferred) +action_types(alias)effects(impact annotations)Example queries
Repository
Reference implementation: https://github.com/zljie/ontology-query
Why Datalog (rigor)
The core requirement is rigorous logical inference with reproducible results. Datalog provides:
Suggested next steps
ontology-queryunder an OSI org repository (or list as an official companion tool)Questions
tools/in the main repo?pyDatalog) or target Python versions?