Expand description
§OxiRS Rule Engine
Status: Alpha Release (v0.1.0-alpha.2) ⚠️ APIs may change. Not recommended for production use.
Forward/backward rule engine for RDFS, OWL, and SWRL reasoning with RETE optimization. Provides Jena-compatible rule-based inference for knowledge graphs.
§Features
- Forward Chaining - Data-driven rule inference
- Backward Chaining - Goal-driven query answering
- RETE Algorithm - Efficient pattern matching
- RDFS/OWL Support - Standard ontology reasoning
- SWRL Integration - Semantic Web Rule Language
- Rule Composition - Complex multi-step reasoning
§Quick Start
use oxirs_rule::{RuleEngine, Rule, RuleAtom, Term};
let mut engine = RuleEngine::new();
// Define rule: parent(X,Y) → ancestor(X,Y)
engine.add_rule(Rule {
name: "ancestor".to_string(),
body: vec![RuleAtom::Triple {
subject: Term::Variable("X".to_string()),
predicate: Term::Constant("parent".to_string()),
object: Term::Variable("Y".to_string()),
}],
head: vec![RuleAtom::Triple {
subject: Term::Variable("X".to_string()),
predicate: Term::Constant("ancestor".to_string()),
object: Term::Variable("Y".to_string()),
}],
});
// Add facts and infer
let facts = vec![RuleAtom::Triple {
subject: Term::Constant("john".to_string()),
predicate: Term::Constant("parent".to_string()),
object: Term::Constant("mary".to_string()),
}];
let results = engine.forward_chain(&facts)?;
§See Also
oxirs-core
- RDF data modeloxirs-arq
- SPARQL query engine
Modules§
- backward
- Backward Chaining Inference Engine
- cache
- Advanced Caching System for Rule Engines
- comprehensive_
tutorial - Comprehensive OxiRS Rule Engine Tutorial
- debug
- Rule Engine Debugging Tools
- forward
- Forward Chaining Inference Engine
- getting_
started - Getting Started with OxiRS Rule Engine
- integration
- Integration Bridge with OxiRS Core
- owl
- OWL Reasoning Engine
- performance
- Performance analysis and profiling utilities for the rule engine
- rdf_
integration - RDF Integration Module for OxiRS Rule Engine
- rdf_
processing_ simple - Simplified RDF Data Processing Module
- rdfs
- RDFS Reasoning Engine
- rete
- RETE Pattern Matching Network
- rete_
enhanced - Enhanced RETE Pattern Matching Network
- swrl
- SWRL (Semantic Web Rule Language) Implementation
Structs§
- Rule
- Rule representation
- Rule
Engine - Integrated rule engine combining all reasoning modes