Skip to content
Stable.owl@modelscript/owl2 24 diagnostic rules
Parser WASM GLR
Diagnostics 24 rules
DAE Arena AST Only
Simulation Co-sim / Export
Projections SPARQL, SysML v2
Live ExampleAvionicsSafetyOntology.owl

Avionics Fault-Containment & Redundancy Ontology

OWL 2 Functional-Style ontology defining flight-critical sensors, actuators, and object property assertions classified by the tableau reasoner.

Playground
Source (25 lines)
1Prefix(:=<http://modelscript.org/ontologies/avionics#>)
2Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
3 
4Ontology(<http://modelscript.org/ontologies/avionics>
5  Declaration(Class(:AvionicsLRU))
6  Declaration(Class(:FlightControlComputer))
7  Declaration(Class(:InertialSensor))
8  Declaration(Class(:ElectroHydrostaticActuator))
9  Declaration(ObjectProperty(:commandsActuator))
10  Declaration(ObjectProperty(:readsSensor))
11 
12  SubClassOf(:FlightControlComputer :AvionicsLRU)
13  SubClassOf(:InertialSensor :AvionicsLRU)
14  SubClassOf(:ElectroHydrostaticActuator :AvionicsLRU)
15 
16  Declaration(NamedIndividual(:FCC_Primary))
17  Declaration(NamedIndividual(:IMU_A))
18  Declaration(NamedIndividual(:EHA_AileronL))
19 
20  ClassAssertion(:FlightControlComputer :FCC_Primary)
21  ClassAssertion(:InertialSensor :IMU_A)
22  ClassAssertion(:ElectroHydrostaticActuator :EHA_AileronL)
23  ObjectPropertyAssertion(:readsSensor :FCC_Primary :IMU_A)
24  ObjectPropertyAssertion(:commandsActuator :FCC_Primary :EHA_AileronL)
25)
OWL 2 Classified Ontology & Axiom Graph
subClassOf subClassOf subClassOf rdf:type rdf:type rdf:type readsSensor commandsActuator «owl:class» AvionicsLRU «owl:class» FlightControlComputer «owl:class» InertialSensor «owl:class» ElectroHydrostaticActuator «owl:objectproperty» commandsActuator «owl:objectproperty» readsSensor «owl:namedindividual» FCC_Primary «owl:namedindividual» IMU_A «owl:namedindividual» EHA_AileronL
Drag to pan · Click % to reset

OWL2 Ontology (.owl, .owl2, .ofn, .ttl) ​

@modelscript/owl2 (languages/owl2) brings formal ontological engineering, Description Logic (SROIQ(D)) reasoning, and SPARQL / Leapfrog Triejoin graph querying directly into the ModelScript compiler.


Supported Extensions & Formats ​

ExtensionFormat
.owl, .owl2, .ofnW3C OWL 2 Functional-Style Syntax (Prefix(...), Ontology(...))
.ttlRDF Turtle / Ontological Triple Assertions

OWL 2 DL Axiom & Class Expression Lowering ​

lowerCstToAxioms(tree, sourceText) (languages/owl2/src/cst-lowering.ts) lowers the linear-memory CST into an arena-backed OntologyStore supporting over 35 OWL 2 DL axiom and class expression constructs:

CategorySupported OWL 2 Functional-Style Constructs
DeclarationsDeclaration(Class(...)), Declaration(ObjectProperty(...)), Declaration(DataProperty(...)), Declaration(NamedIndividual(...))
Class AxiomsSubClassOf, EquivalentClasses, DisjointClasses
Boolean & Nominal Class ExpressionsObjectIntersectionOf, ObjectUnionOf, ObjectComplementOf, ObjectOneOf
Object Property RestrictionsObjectSomeValuesFrom, ObjectAllValuesFrom, ObjectHasSelf, ObjectHasValue, ObjectMinCardinality, ObjectMaxCardinality, ObjectExactCardinality
Data Property RestrictionsDataSomeValuesFrom, DataAllValuesFrom, DataMinCardinality, DataMaxCardinality, DataExactCardinality
Property Hierarchy & InversionSubObjectPropertyOf, SubDataPropertyOf, InverseObjectProperties, DisjointObjectProperties
Property Domains & RangesObjectPropertyDomain, ObjectPropertyRange, DataPropertyDomain, DataPropertyRange
Property CharacteristicsFunctionalObjectProperty, InverseFunctionalObjectProperty, ReflexiveObjectProperty, IrreflexiveObjectProperty, SymmetricObjectProperty, AsymmetricObjectProperty, TransitiveObjectProperty, FunctionalDataProperty
ABox Individual AssertionsClassAssertion, ObjectPropertyAssertion, DataPropertyAssertion, NegativeObjectPropertyAssertion, NegativeDataPropertyAssertion, SameIndividual, DifferentIndividuals
lisp
Prefix(:=<http://example.org/spacecraft#>)
Ontology(<http://example.org/spacecraft>
  Declaration(Class(:Thruster))
  Declaration(Class(:Actuator))
  Declaration(ObjectProperty(:mountedOn))
  Declaration(DataProperty(:nominalThrustN))
  SubClassOf(:Thruster :Actuator)
  SubClassOf(:Thruster ObjectSomeValuesFrom(:mountedOn :ReactionControlPod))
  ClassAssertion(:Thruster :RCS_Thruster_A1)
  DataPropertyAssertion(:nominalThrustN :RCS_Thruster_A1 "22.0"^^xsd:double)
)

Description Logic Tableau Reasoner & Leapfrog Triejoin ​

@modelscript/owl2 includes an in-memory SROIQ(D) Tableau Reasoner (TableauReasoner in languages/owl2/src/reasoner/) and a worst-case optimal Leapfrog Triejoin engine (executeBGP in languages/owl2/src/query/leapfrog.ts):

  1. Consistency & Satisfiability Checking: Detects unsatisfiable classes (DisjointClasses violations, cardinality contradictions, irreflexive/asymmetric cycles, negative property assertion conflicts) and surfaces exact source diagnostics (OWL2001–OWL2005).
  2. Justification & Explanation Tracing: Computes minimal unsatisfiability justifications (explain_inference) explaining why a class or individual violates ontology axioms.
  3. SPARQL & Multi-Way BGP Joins: Evaluates conjunctive Basic Graph Patterns (BGPs) in O(AGM bound) worst-case optimal time without materializing intermediate Cartesian products.

Interactive 2D Ontology Diagram & Bidirectional Writeback ​

languages/owl2/src/diagram/ provides an interactive 2D graph visualization and editing surface for OWL 2 ontologies:

  • Visual Graph Projection: Renders Class nodes, NamedIndividual instances, SubClassOf inheritance hierarchies, and ObjectPropertyDomain/ObjectPropertyRange directed edges.
  • Bidirectional CST Writeback (owl2Language.writeback): Adding/deleting nodes or edges in the diagram (add_node, delete_node, add_edge, delete_edge, rename_node, update_parameter) patches the Functional-Style .owl source text directly—inserting or removing Declaration(...), SubClassOf(...), or DataPropertyAssertion(...) axioms in place.

Dedicated owl2-mcp Server Tools ​

The @modelscript/owl2 MCP server (languages/owl2/src/mcp/server.ts) exposes five specialized tools to AI agents:

MCP ToolDescription
validate_system_consistencyParses an OWL 2 Functional Syntax ontology, runs the SROIQ Tableau Reasoner, and returns consistency status, unsatisfiable classes, and inferred SubClassOf hierarchy
query_ontology_sparqlExecutes a SPARQL SELECT WHERE query over the ontology's inferred RDF triple graph
query_ontology_bgpEvaluates a conjunctive Basic Graph Pattern (BGP) using the worst-case optimal Leapfrog Triejoin algorithm
explain_inferenceComputes formal axiomatic justifications explaining why an entailment holds or why a class is unsatisfiable
trace_fault_propagationTraces transitive fault propagation (TransitiveObjectProperty / causal links) from a starting component individual across the system topology

Polyglot TGG Rules ​

@modelscript/owl2 defines 5 bidirectional Triple Graph Grammar (TGG) rules in languages/owl2/src/language.ts:

Rule NameSource (owl2)Target LanguageTarget Construct
OWL2ClassToSysML2PartDeclaration (Class)sysml2PartDef
OWL2SubClassToSysML2SpecializationSubClassOfsysml2Specialization (:>)
OWL2ObjectPropertyToSysML2PortDeclaration (ObjectProperty)sysml2PortUsage
OWL2DataPropertyToSysML2AttributeDeclaration (DataProperty)sysml2AttributeUsage
OWL2ClassToModelicaModelDeclaration (Class)modelicaClassDefinition (model)

Command Line Interface (msx polyglot) ​

OWL2 ontologies can be queried, projected, and validated using ModelScript's polyglot digital thread commands:

bash
# Project OWL 2 DL class hierarchies and axioms into formal SysML v2 part definitions
msx polyglot project SpacecraftOntology.ofn --target=sysml2 -o Spacecraft.sysml

# Cross-query ontology symbols and digital thread twins in the unified Salsa index
msx polyglot query Spacecraft::ReactionControlPod --domain=owl2

# Verify losslessness and critical pair confluence across OWL 2 TGG synchronization rules
msx polyglot verify --strict

Diagnostic Rules ​

24 rules16 error7 warning1 info Run with msx lint

CodeRuleSeverityMessage
O1001parse-errorerrorSyntax error near '<snippet>'.
O1002undeclared-prefixerrorPrefix '<prefix>:' used in abbreviated IRI '<iri>' is not declared.
O1003duplicate-prefixwarningPrefix '<prefix>:' is declared multiple times in the ontology header.
O1004invalid-irierrorInvalid or malformed IRI '<iri>'.
O1005insufficient-arityerrorOWL 2 construct '<construct>' requires at least <minArity> arguments, but got <actualArity>.
O2001undeclared-entitywarningEntity '<iri>' is used as a <role> without an explicit Declaration axiom.
O2002duplicate-declarationwarningDuplicate Declaration(<kind>(<iri>)) in ontology.
O2003reserved-vocabulary-declarationerrorCannot declare or redefine built-in OWL 2 / RDF / RDFS / XSD vocabulary IRI '<iri>'.
O3001illegal-property-punningerrorIllegal OWL 2 DL punning: '<iri>' is used as both '<kindA>' and '<kindB>' (ObjectProperty, DataProperty, and AnnotationProperty vocabularies must be disjoint).
O3002expected-object-propertyerrorExpected an ObjectProperty in '<construct>', but '<iri>' is declared as a DataProperty.
O3003expected-data-propertyerrorExpected a DataProperty in '<construct>', but '<iri>' is declared as an ObjectProperty.
O3004expected-class-expressionerrorExpected a Class expression in '<construct>', but '<iri>' is a Datatype.
O3005invalid-datatypewarningDatatype '<datatypeIri>' is not in the standard OWL 2 datatype map.
O3006datatype-literal-mismatcherrorLexical value '<literal>' is not a valid literal for datatype '<datatypeIri>'.
O4001non-simple-property-restrictionerrorOWL 2 DL global restriction violation: non-simple (transitive or composite) property '<propertyIri>' cannot be used in '<construct>'.
O4002contradictory-property-characteristicserrorObject property '<propertyIri>' has contradictory characteristics '<charA>' and '<charB>'.
O4003property-hierarchy-cyclewarningCycle detected in property hierarchy: '<cycle>'.
O4004class-hierarchy-cycleinfoSubClassOf cycle detected (equivalent classes): '<cycle>'.
O4005self-referential-axiomwarningRedundant or contradictory self-referential axiom '<axiomType>' on '<iri>'.
O5001functional-property-clasherrorFunctional/InverseFunctional property '<propertyIri>' violation: <detail>.
O5002negative-assertion-clasherrorNegative property assertion on '<propertyIri>' for '<subjectIri>' clashes with asserted or inferred value '<target>'.
O5003unsatisfiable-classerrorClass '<classIri>' is unsatisfiable (equivalent to owl:Nothing): <reason>.
O5004ontology-inconsistenterrorOntology is logically inconsistent: <explanation>
O6001profile-el-violationwarningConstruct '<construct>' is outside the OWL 2 EL profile.

Generated from languages/owl2/src/errors.ts. All languages →

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Trademark Policy