Title: Rules 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. ## Usage Scenarios ### 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](enhancer.html), 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 [5] and have an associated image, a birth place and the instrument played. Any other entity not satisfying the constraints is discarded. ### Vocabulary harmonization 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](../ontologymanager/ontonet.html). 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. ## Features Stanbol allows to provide rules to other component, i.e., Stanbol Reasoners, or to third parties in three different formats. * __SWRL__ [1]. 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](reasoners.html); * __Jena Rules__ [2]. It enables compatibility with inference engines based on Jena inference and rule language. Internally, the [Stanbol Reasoners component](reasoners.html) provides a reasoning profile based on Jena inference; * __SPARQL__ [3]. 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](rules/refactor.html) 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 [4]. 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:
__if__ X is a person __then__ X has a father
and by means of predicate calculus as:
∀x∃y.Person(x) ⇒ hasFather(x, y)
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. ### Sub-Components - [Rule language](rules/language.html) - specifies the syntax used in Stanbol in order to represent rules. Stanbol rules can be as SWRL, Jema rules or SPARQL CONSTRUCT; - [Rule Store](rules/store.html) - allows to rules persistence. Rules in set called __recipies__, which are designed to aggregate rules by their functionality; - [Refactor](rules/refactor.html) - 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... ## References [1] SWRL
[2] Jena Rules
[3] SPARQL
[4] Linked Data
[5] DBpedia
____ _[Back to components](components.html)_