Rule Interchange Format

Last updated

The Rule Interchange Format (RIF) is a W3C Recommendation. RIF is part of the infrastructure for the semantic web, along with (principally) SPARQL, RDF and OWL. Although originally envisioned by many as a "rules layer" for the semantic web, in reality the design of RIF is based on the observation that there are many "rules languages" in existence, and what is needed is to exchange rules between them. [1]

Contents

RIF includes three dialects, a Core dialect which is extended into a Basic Logic Dialect (BLD) and Production Rule Dialect (PRD). [2]

History

The RIF working group was chartered in late 2005. Among its goals was drawing in members of the commercial rules marketplace. The working group started with more than 50 members and two chairs drawn from industry, Christian de Sainte Marie of ILOG, and Chris Welty of IBM. The charter, to develop an interchange format between existing rule systems was influenced by a workshop in the spring of 2005 in which it was clear that one rule language would not serve the needs of all interested parties (Dr. Welty described the outcome of the workshop as Nash Equilibrium [3] ).

RIF became a W3C Recommendation on June 22, 2010. [4]

Rules and rule systems

A rule is perhaps one of the simplest notions in computer science: it is an IF - THEN construct. If some condition (the IF part) that is checkable in some dataset holds, then the conclusion (the THEN part) is processed. Deriving somewhat from its roots in logic, rule systems use a notion of predicates that hold or not of some data object or objects. For example, the fact that two people are married might be represented with predicates as:

MARRIED(LISA,JOHN)

MARRIED is a predicate that can be said to hold between LISA and JOHN. Adding the notion of variables, a rule could be something like:

IF MARRIED(?x, ?y) THEN LOVES(?x, ?y)

We would expect that for every pair of ?x and ?y (e.g. LISA and JOHN) for which the MARRIED predicate holds, some computer system that could understand this rule would conclude that the LOVES predicate holds for that pair as well.

Rules are a simple way of encoding knowledge, and are a drastic simplification of first order logic, for which it is relatively easy to implement inference engines that can process the conditions and draw the right conclusions. A rule system is an implementation of a particular syntax and semantics of rules, which may extend the simple notion described above to include existential quantification, disjunction, logical conjunction, negation, functions, non monotonicity, and many other features. Rule systems have been implemented and studied since the mid-1970s and saw significant uptake in the 1980s during the height of so-called Expert Systems.

Standard RIF dialects

The standard RIF dialects are Core, BLD and PRD. These dialects depend on an extensive list of datatypes with builtin functions and predicates on those datatypes.

Relations of various RIF dialects are shown in the following Venn diagram. [5]

DTB

Datatypes and Built-Ins (DTB) specifies a list of datatypes, built-in functions and built-in predicates expected to be supported by RIF dialects. Some of the datatypes are adapted from XML Schema Datatypes, [6] XPath functions [7] and rdf:PlainLiteral functions. [8]

Core

The Core dialect comprises a common subset of most rule dialect. RIF-Core is a subset of both RIF-BLD and RIF-PRD.

FLD

Framework for Logic Dialects (FLD) describes mechanisms for specifying the syntax and semantics of logic RIF dialects, including the RIF-BLD and RIF-Core, but not RIF-PRD which is not a logic-based RIF dialect.

BLD

The Basic Logic Dialect (BLD) adds features to the Core dialect that are not directly available such as: logic functions, equality in the then-part and named arguments. RIF BLD corresponds to positive datalogs, that is, logic programs without functions or negations.

RIF-BLD has a model-theoretic semantics.

The frame syntax of RIF BLD is based on F-logic, but RIF BLD doesn't have the non-monotonic reasoning features of F-logic. [9]

PRD

The Production Rules Dialect (PRD) can be used to model production rules. Features that are notably in PRD but not BLD include negation and retraction of facts (thus, PRD is not monotonic). PRD rules are order dependent, hence conflict resolution strategies are needed when multiple rules can be fired. The PRD specification defines one such resolution strategy based on forward chaining reasoning.

RIF-PRD has an operational semantics, whereas the condition formulas also have a model-theoretic semantics.

Example (Example 1.2 in [10] )

Prefix(ex <http://example.com/2008/prd1#>) (* ex:rule_1 *) Forall ?customer ?purchasesYTD (  If   And( ?customer#ex:Customer            ?customer[ex:purchasesYTD->?purchasesYTD]            External(pred:numeric-greater-than(?purchasesYTD 5000)) )  Then Do( Modify(?customer[ex:status->"Gold"]) ) ) 

Non-standard RIF dialects

Several other RIF dialects exist. None of them are officially endorsed by W3C and they are not part of the RIF specification.

CASPD

The Core Answer Set Programming Dialect (CASPD) [11] is based on answer set programming, that is, declarative logic programming based on the answer set semantics (stable model semantics).

Example:

Document(       Prefix(ex <http://example.com/concepts#>)        Group (           Forall ?S (               ex:afraid(?S ex:Math) :- And ( ?S#ex:Student (Naf Neg ex:afraid(?S ex:Math)) )    )           Forall ?S (        Neg ex:afraid(?S ex:Math) :- And ( ?S#ex:Student ?S[ex:majors -> ex:Math] )    )       ) 

URD

The Uncertainty Rule Dialect (URD) [12] supports a direct representation of uncertain knowledge.

Example:

Document(    Import (<http://example.org/fuzzy/membershipfunction >)    Group    (      Forall ?x ?y(          cheapFlight(?x ?y) :- affordableFlight(?x ?y)      )  / 0.4      Forall ?x ?y(affordableFlight(?x ?y))  / left_shoulder0k4k1k3k(?y)    )    )  

SILK

RIF-SILK [13] can be used to model default logic. It is based on declarative logic programming with the well-founded semantics. RIF-SILK also includes a number of other features present in more sophisticated declarative logic programming languages such as SILK. [14]

Example

Document {       Prefix(foaf http://xmlns.com/foaf/0.1/)       Prefix(pub http://example.org/pub#)       Prefix(silk http://TBD/silk#)       Group {         (* r1 *) Forall ?a1 ?a2 ?paper                   (?a1[foaf:knows->?a2]                    :- ?paper # pub:Publication[pub:author->?a1,              pub:author->?a2}])         (* r2 *) Forall ?a1 ?a2                  (neg ?a1[foaf:knows->?a2]                    :- ?a1[hasNeverMet->?a2])         silk:overrides(r2, r1)       } } 

See also

Related Research Articles

First-order logic—also known as predicate logic, quantificational logic, and first-order predicate calculus—is a collection of formal systems used in mathematics, philosophy, linguistics, and computer science. First-order logic uses quantified variables over non-logical objects, and allows the use of sentences that contain variables, so that rather than propositions such as "Socrates is a man", one can have expressions in the form "there exists x such that x is Socrates and x is a man", where "there exists" is a quantifier, while x is a variable. This distinguishes it from propositional logic, which does not use quantifiers or relations; in this sense, propositional logic is the foundation of first-order logic.

<span class="mw-page-title-main">Semantic Web</span> Extension of the Web to facilitate data exchange

The Semantic Web, sometimes known as Web 3.0, is an extension of the World Wide Web through standards set by the World Wide Web Consortium (W3C). The goal of the Semantic Web is to make Internet data machine-readable.

The Resource Description Framework (RDF) is a World Wide Web Consortium (W3C) standard originally designed as a data model for metadata. It has come to be used as a general method for description and exchange of graph data. RDF provides a variety of syntax notations and data serialization formats, with Turtle currently being the most widely used notation.

The Web Ontology Language (OWL) is a family of knowledge representation languages for authoring ontologies. Ontologies are a formal way to describe taxonomies and classification networks, essentially defining the structure of knowledge for various domains: the nouns representing classes of objects and the verbs representing relations between the objects.

In logic and mathematics, second-order logic is an extension of first-order logic, which itself is an extension of propositional logic. Second-order logic is in turn extended by higher-order logic and type theory.

<span class="mw-page-title-main">Conceptual graph</span>

A conceptual graph (CG) is a formalism for knowledge representation. In the first published paper on CGs, John F. Sowa used them to represent the conceptual schemas used in database systems. The first book on CGs applied them to a wide range of topics in artificial intelligence, computer science, and cognitive science.

Predicate transformer semantics were introduced by Edsger Dijkstra in his seminal paper "Guarded commands, nondeterminacy and formal derivation of programs". They define the semantics of an imperative programming paradigm by assigning to each statement in this language a corresponding predicate transformer: a total function between two predicates on the state space of the statement. In this sense, predicate transformer semantics are a kind of denotational semantics. Actually, in guarded commands, Dijkstra uses only one kind of predicate transformer: the well-known weakest preconditions.

RDF Schema (Resource Description Framework Schema, variously abbreviated as RDFS, RDF(S), RDF-S, or RDF/S) is a set of classes with certain properties using the RDF extensible knowledge representation data model, providing basic elements for the description of ontologies. It uses various forms of RDF vocabularies, intended to structure RDF resources. RDF and RDFS can be saved in a triplestore, then one can extract some knowledge from them using a query language, like SPARQL.

Answer set programming (ASP) is a form of declarative programming oriented towards difficult search problems. It is based on the stable model semantics of logic programming. In ASP, search problems are reduced to computing stable models, and answer set solvers—programs for generating stable models—are used to perform search. The computational process employed in the design of many answer set solvers is an enhancement of the DPLL algorithm and, in principle, it always terminates.

SPARQL is an RDF query language—that is, a semantic query language for databases—able to retrieve and manipulate data stored in Resource Description Framework (RDF) format. It was made a standard by the RDF Data Access Working Group (DAWG) of the World Wide Web Consortium, and is recognized as one of the key technologies of the semantic web. On 15 January 2008, SPARQL 1.0 was acknowledged by W3C as an official recommendation, and SPARQL 1.1 in March, 2013.

RDFa or Resource Description Framework in Attributes is a W3C Recommendation that adds a set of attribute-level extensions to HTML, XHTML and various XML-based document types for embedding rich metadata within Web documents. The Resource Description Framework (RDF) data-model mapping enables its use for embedding RDF subject-predicate-object expressions within XHTML documents. It also enables the extraction of RDF model triples by compliant user agents.

F-logic is a knowledge representation and ontology language. F-logic combines the advantages of conceptual modeling with object-oriented, frame-based languages and offers a declarative, compact and simple syntax, as well as the well-defined semantics of a logic-based language.

A semantic reasoner, reasoning engine, rules engine, or simply a reasoner, is a piece of software able to infer logical consequences from a set of asserted facts or axioms. The notion of a semantic reasoner generalizes that of an inference engine, by providing a richer set of mechanisms to work with. The inference rules are commonly specified by means of an ontology language, and often a description logic language. Many reasoners use first-order predicate logic to perform reasoning; inference commonly proceeds by forward chaining and backward chaining. There are also examples of probabilistic reasoners, including non-axiomatic reasoning systems, and probabilistic logic networks.

N-Triples is a format for storing and transmitting data. It is a line-based, plain text serialisation format for RDF graphs, and a subset of the Turtle format. N-Triples should not be confused with Notation3 which is a superset of Turtle. N-Triples was primarily developed by Dave Beckett at the University of Bristol and Art Barstow at the World Wide Web Consortium (W3C).

Donkey sentences are sentences that contain a pronoun with clear meaning but whose syntactical role in the sentence poses challenges to grammarians. Such sentences defy straightforward attempts to generate their formal language equivalents. The difficulty is with understanding how English speakers parse such sentences.

<span class="mw-page-title-main">Ontology engineering</span> Field that studies the methods and methodologies for building ontologies

In computer science, information science and systems engineering, ontology engineering is a field which studies the methods and methodologies for building ontologies, which encompasses a representation, formal naming and definition of the categories, properties and relations between the concepts, data and entities of a given domain of interest. In a broader sense, this field also includes a knowledge construction of the domain using formal ontology representations such as OWL/RDF. A large-scale representation of abstract concepts such as actions, time, physical objects and beliefs would be an example of ontological engineering. Ontology engineering is one of the areas of applied ontology, and can be seen as an application of philosophical ontology. Core ideas and objectives of ontology engineering are also central in conceptual modeling.

<span class="mw-page-title-main">Named graph</span> Extension of the RDF data model

Named graphs are a key concept of Semantic Web architecture in which a set of Resource Description Framework statements are identified using a URI, allowing descriptions to be made of that set of statements such as context, provenance information or other such metadata.

HiLog is a programming logic with higher-order syntax, which allows arbitrary terms to appear in predicate and function positions. However, the model theory of HiLog is first-order. Although syntactically HiLog strictly extends first order logic, HiLog can be embedded into this logic.

In logic, a quantifier is an operator that specifies how many individuals in the domain of discourse satisfy an open formula. For instance, the universal quantifier in the first order formula expresses that everything in the domain satisfies the property denoted by . On the other hand, the existential quantifier in the formula expresses that there exists something in the domain which satisfies that property. A formula where a quantifier takes widest scope is called a quantified formula. A quantified formula must contain a bound variable and a subformula specifying a property of the referent of that variable.

Rulelog is an expressive semantic rule-based knowledge representation and reasoning (KRR) language. It underlies knowledge representation languages used in systems such as Flora-2, SILK and others. It extends well-founded declarative logic programs with features for higher-order syntax, frame syntax, defeasibility, general quantified expressions both in the bodies of the rules and their heads, user-defined functions, and restraint bounded rationality.

References

  1. Kifer, Michael (2008). "Rule Interchange Format: The Framework". in: Web Reasoning and Rule Systems. Lecture Notes in Computer Science
  2. RIF Overview
  3. Welty, Chris (2009). "Rule Interchange Format". Invited presentation to the NY Semantic Web Meetup.
  4. RIF Core Dialect
  5. RIF Use Cases and Requirements
  6. XML Schema Datatypes
  7. XPath-Functions
  8. rdf:PlainLiteral: A Datatype for RDF Plain Literals
  9. M. Krötzsch (October 2010). Description Logic Rules. IOS Press. p. 10. ISBN   978-1-61499-342-1.
  10. RIF-PRD specification
  11. RIF Core Answer Set Programming Dialect
  12. Zhao & Boley. Uncertainty Treatment in the Rule Interchange Format: From Encoding to Extension. In The 4th International Workshop on Uncertainty Reasoning for the Semantic Web (URSW), 2008.
  13. RIF SILK dialect
  14. The SILK Language, Benjamin Grosof, Michael Kifer, Mike Dean. Vulcan Inc., 2009.