Stanbol Rules is a component that supports the construction and execution of inference rules. An inference rule, or transformation rule, is a syntactic rule or function which takes premises and returns a conclusion. Stanbol Rules allows to add a layer for expressing business logics by means of axioms, which encode the inference rules. These axioms can be organized into a container called recipe, which identifies a set of rules that share the same business logic and interpret them as a whole.
Integrity check from data fusion
With Stanbol Rules the administrator can define integrity checks for data fetched from heterogeneous and external sources in order to prevent unwanted formats or inconsistent data. In such a way the administrator is able to configure the CMS in order filter knowledge retrieved in Linked Data, e.g., via the Enhancer, that satisfies some integrity driven constraint. The constraint can be defined by means of Stanbol Rules. For instance in a CMS which collects core knowledge about musicians it might possible to define integrity check rules which keep only entities that are typed as Musicians in DBpedia  and have an associated image, a birth place and the instrument played. Any other entity not satisfying the constraints is discarded.
Supposing we want to use some dataset in Linked Data as external knowledge bases for a generic CMS enhanced with Stanbol. Now the problem how to use data from those datasets expressed with some external and heterogeneous vocabularies or ontologies within the CMS has. Furthermore the CMS has its own way to formalize knowledge, namely the its Ontology Network managed by Stanbol OntoNet. The solution is provided by Refactor which allows to interpret the rules of inference as refactoring rules in order harmonize external data to the Stanbol's ontologies.
Also, Stanbol Rules can be used to derive new knowledge or integrate information from different semantically enhanced contents.
Stanbol allows to provide rules to other component, i.e., Stanbol Reasoners, or to third parties in three different formats.
- SWRL . The Semantic Web Rule Language (SWRL) is a rule language which combines OWL DL with the Unary/Binary Datalog RuleML sublanguages of the Rule Markup Language and enables enables Horn-like rules to be combined with an OWL knowledge base. Providing Stanbol Rules as SWRL rules means that they can be interpreted in classical DL reasoning. That allows, for inantace, to use Stanbol Rules with any of the OWL 2 reasoners configured in the Stanbol Reasoners component;
- Jena Rules . It enables compatibility with inference engines based on Jena inference and rule language. Internally, the Stanbol Reasoner component provides a reasoning profile based on Jena inference;
- SPARQL . SPARQL is a W3C recommendation as a query language for RDF. A natural way to represent inference transformation rules in SPARQL is by using the CONSTRUCT query form. Stanbl Rules can be converted to SPARQL CONSTRUCTs and executed by any SPARQL engine. Stanbol provides a particular SPARQL engine, namely the Refactor which is supposed to perform transformation of RDF graphs based on transformation rules defined in Stanbol. The latter allows, for instance, the vocabulary harmonization of RDF graphs retrieved from different sources in Linked Data .
The rule pattern used for representing rules is the modus ponens, e.g. if condition then consequent . For example the axiom "every person has a father" can be expressed with the modus ponens in the following way:
and by means of predicate calculus as:
where Person and hasF ather are two predicates.
The Stanbol Rules component allows to add a layer which enables Stanbol to express business logics by means of axioms, i.e., rules. These axioms can be organized into a container called Recipe, which groups and identifies set of rules which share the same business logic and interprets them as a whole.
- Rule language - specifies the syntax used in Stanbol in order to represent rules. Stanbol rules can be as SWRL, Jema rules or SPARQL CONSTRUCT;
- Rule Store - allows to rules persistence. Rules in set called recipies, which are designed to aggregate rules by their functionality;
- Refactor - performs RDF graphs transformations to specific target vocabularies or ontologies by means of rules. This allows the harmonization and the alignment of RDF graphs expressed with different vocabularies, e.g., DBpedia, schema.org etc...