How stardog-union/pellet works
Purpose and entry points
Pellet is a pure-Java OWL 2 DL reasoner. It loads ontologies, checks consistency and entailment, classifies class/property hierarchies, realizes individuals, explains inferences, and answers SPARQL-DL queries. Primary executable entry is the command dispatcher in cli/src/main/java/pellet/Pellet.java, invoked by pellet.sh or pellet.bat. Library users normally enter through Jena or OWLAPI reasoner factories.
Core knowledge-base model
The central in-memory boundary is KnowledgeBase, which owns the ontology’s assertional, terminological, and role structures: core/src/main/java/org/mindswap/pellet/KnowledgeBase.java, core/src/main/java/org/mindswap/pellet/ABox.java, core/src/main/java/org/mindswap/pellet/tbox/TBox.java. Loaders and adapters translate external RDF/OWL representations into Pellet terms and populate this model; inference engines operate on it rather than external graph APIs.
Tableau reasoning and datatype constraints
OWL DL satisfiability is driven by tableau completion strategies and rule queues. SROIQStrategy/SROIQIncStrategy expand ABox nodes, apply existential, universal, cardinality, disjunction, nominal, and datatype rules, and use branching, blocking, clash detection, and dependency tracking to terminate or backtrack. Key paths: core/src/main/java/org/mindswap/pellet/tableau/completion/SROIQStrategy.java, core/src/main/java/org/mindswap/pellet/tableau/completion/rule/, core/src/main/java/com/clarkparsia/pellet/datatypes/DatatypeReasonerImpl.java. Datatype validation is a distinct constraint-solving boundary integrated into completion.
Classification, realization, and incremental operation
After or alongside satisfiability checks, taxonomy builders organize subsumption results into class/property hierarchies and realization assigns individuals to inferred types. An EL-specific classifier provides a specialized route for eligible ontologies. Incremental tracking and dependency restoration support updates without necessarily rebuilding all inferences. Key paths: core/src/main/java/org/mindswap/pellet/taxonomy/TaxonomyBuilder.java, core/src/main/java/com/clarkparsia/pellet/el/ELClassifier.java, core/src/main/java/org/mindswap/pellet/tableau/completion/incremental/.
Rules and query execution
SWRL-style rules are represented as rule atoms, translated into Pellet terms, and evaluated using binding strategies and a Rete network; resulting assertions feed the knowledge base/tableau boundary. SPARQL-DL follows a separate pipeline: parse to query model, optimize/reorder a plan, execute against the ABox/KB, then adapt bindings to Jena result sets. Key paths: core/src/main/java/com/clarkparsia/pellet/rules/rete/Interpreter.java, query/src/main/java/com/clarkparsia/pellet/sparqldl/engine/CombinedQueryEngine.java, query/src/main/java/com/clarkparsia/pellet/sparqldl/jena/SparqlDLExecution.java.
Integration surfaces and outputs
The Jena adapter loads graphs into Pellet, exposes an inferred graph/reasoner, listens for graph changes, and extracts inferred triples/taxonomies. The OWLAPI adapter converts OWL axioms and exposes an OWLReasoner; its service descriptor enables factory discovery. Explanation support derives justifications and renders them in Manchester syntax or RDF/XML. Key paths: jena/src/main/java/org/mindswap/pellet/jena/PelletReasonerFactory.java, owlapi/src/main/java/com/clarkparsia/pellet/owlapiv3/PelletReasonerFactory.java, explanation/src/main/java/com/clarkparsia/owlapi/explanation/PelletExplanation.java.
Runtime and packaging
This is a multi-module Maven Java repository rooted at pom.xml, with core as the reasoning engine and CLI, Jena, OWLAPI, query, explanation, modularity, and distribution modules layered around it. Material external ecosystems are Apache Jena, OWLAPI, ANTLR-based query grammar, and ATerm-style internal term rendering; no server, database, or remote runtime is required by the core architecture. Distribution assembly lives in distribution/src/main/assembly/dist.xml.
Main entry points: KnowledgeBase.java Knowledge base · SROIQStrategy.java SROIQ completion · CombinedQueryEngine.java SPARQL-DL engine · dist.xml Distribution assembly
Components 17
Entry & APIs
- CLI dispatcher · Dispatches Pellet commands from shell launchers.
cli/src/main/java/pellet/Pellet.java - Jena adapter · Loads graphs and exposes inferred Jena views.
jena/src/main/java/org/mindswap/pellet/jena/PelletReasonerFactory.java - OWLAPI adapter · Converts OWL axioms and exposes an OWLReasoner.
owlapi/src/main/java/com/clarkparsia/pellet/owlapiv3/PelletReasonerFactory.java
Core Reasoning
- Knowledge base · Central boundary for ontology assertions, terminology, and roles.
core/src/main/java/org/mindswap/pellet/KnowledgeBase.java - ABox · Stores individuals and assertions used by completion.
core/src/main/java/org/mindswap/pellet/ABox.java - TBox · Stores class and property axioms.
core/src/main/java/org/mindswap/pellet/tbox/TBox.java - SROIQ completion · Expands ABox nodes and controls satisfiability reasoning.
core/src/main/java/org/mindswap/pellet/tableau/completion/SROIQStrategy.java - Completion rules · Applies OWL constructors, blocking, clashes, and dependencies.
core/src/main/java/org/mindswap/pellet/tableau/completion/rule/AbstractTableauRule.java - Datatype reasoner · Validates datatype constraints during completion.
core/src/main/java/com/clarkparsia/pellet/datatypes/DatatypeReasonerImpl.java - Incremental completion · Restores dependencies and reuses inferences after changes.
core/src/main/java/org/mindswap/pellet/tableau/completion/incremental/IncrementalRestore.java
Inference Services
- Taxonomy builder · Builds inferred class and property hierarchies.
core/src/main/java/org/mindswap/pellet/taxonomy/TaxonomyBuilder.java - EL classifier · Provides a fast classification route for eligible ontologies.
core/src/main/java/com/clarkparsia/pellet/el/ELClassifier.java - Rule interpreter · Evaluates translated SWRL-style rule atoms and bindings.
core/src/main/java/com/clarkparsia/pellet/rules/rete/Interpreter.java - SPARQL-DL engine · Optimizes and executes queries against the ABox and knowledge base.
query/src/main/java/com/clarkparsia/pellet/sparqldl/engine/CombinedQueryEngine.java - Jena query results · Adapts SPARQL-DL bindings to Jena result sets.
query/src/main/java/com/clarkparsia/pellet/sparqldl/jena/SparqlDLExecution.java
Integrations & Distribution
- Explanation service · Derives and renders inference justifications.
explanation/src/main/java/com/clarkparsia/owlapi/explanation/PelletExplanation.java - Distribution assembly · Builds the distributable Pellet package.
distribution/src/main/assembly/dist.xml
Connections 22
- CLI dispatcher → Knowledge base: loads and reasons over
- Jena adapter → Knowledge base: translates RDF/OWL
- OWLAPI adapter → Knowledge base: translates OWL axioms
- Knowledge base → ABox: owns
- Knowledge base → TBox: owns
- Knowledge base → SROIQ completion: drives satisfiability
- ABox → SROIQ completion: completion state
- TBox → SROIQ completion: axiom constraints
- SROIQ completion → Completion rules: applies
- SROIQ completion → Datatype reasoner: checks literals
- Incremental completion → SROIQ completion: restores completion state
- SROIQ completion → Taxonomy builder: subsumption results
- Knowledge base → EL classifier: eligible ontologies
- Rule interpreter → Knowledge base: adds rule assertions
- SPARQL-DL engine → Knowledge base: queries
- SPARQL-DL engine → ABox: evaluates assertions
- SPARQL-DL engine → Jena query results: produces bindings
- Knowledge base → Explanation service: inference justifications
- Taxonomy builder → Jena adapter: inferred triples and hierarchies
- Distribution assembly → CLI dispatcher: packages
- Distribution assembly → Jena adapter: packages
- Distribution assembly → OWLAPI adapter: packages