Skip to content

Reasoner

OWL-SDA can apply an OWL or RDFS reasoner to the input ontology before generating SHACL shapes. Reasoning infers implicit subclass relationships and property restrictions that are not explicit in the ontology, producing richer shapes for the worker agents.

Configuration

yaml
reasoner:
  reasoner-type: "owl"          # owl | rdfs | transitive (default: owl)
  rules-file: ""                # optional path to a Jena rules file
  reasoner-timeout-ms: 0        # 0 = no timeout
  inferred-output-path: ""      # optional path to save the inferred model
KeyTypeDefaultDescription
reasoner-typestringowlBuilt-in reasoner to use when no custom rules file is specified.
rules-filestring""Path to a Jena rules file. When set this takes precedence over reasoner-type.
reasoner-timeout-mslong0Timeout for the reasoning step in milliseconds. 0 disables the timeout.
inferred-output-pathstring""If set, the inferred model is serialised to this file. On subsequent runs with the same path the file is loaded directly, skipping re-inference.

Reasoner Types

ValueApache Jena ReasonerNotes
owlOWLMicroReasonerHandles most OWL axioms; recommended for standard ontologies.
rdfsRDFSReasonerFaster and lighter; handles rdfs:subClassOf, rdfs:domain, rdfs:range only.
transitiveTransitiveReasonerOnly transitive closure; useful for deeply nested class hierarchies.

Custom Rules

For fine-grained control you can supply a Jena forward-chaining rules file:

yaml
reasoner:
  rules-file: "rules/my-rules.jena"

Example rule:

[rule1: (?x rdf:type ex:Employee) -> (?x rdf:type ex:Person)]

Refer to the Jena rules documentation for the full syntax.

Caching Inferred Models

Reasoning can be slow for large ontologies. Set inferred-output-path to persist the result:

yaml
reasoner:
  reasoner-type: "owl"
  inferred-output-path: "target/inferred.ttl"

On the first run OWL-SDA performs inference and writes the result to target/inferred.ttl. On subsequent runs it detects the file and skips re-inference. Delete the file to force re-inference.

Released under the GNU General Public License v3.0.