[go: nahoru, domu]

Jump to content

Rule Interchange Format: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
MOS:HEAD
 
(97 intermediate revisions by 56 users not shown)
Line 1: Line 1:
{{Unreferenced|date=April 2008}}
{{primary sources|date=February 2014}}
The '''Rule Interchange Format''' ('''RIF''') is a [[W3C Recommendation]]. RIF is part of the infrastructure for the [[semantic web]], along with (principally) [[SPARQL]], [[Resource Description Framework|RDF]] and [[Web Ontology Language|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.<ref>Kifer, Michael (2008). "[https://doi.org/10.1007%2F978-3-540-88737-9_1 Rule Interchange Format: The Framework]". in: Web Reasoning and Rule Systems. ''[[Lecture Notes in Computer Science]]''</ref>
{{context}}
{{Semantic Web}}


RIF includes three dialects, a Core dialect which is extended into a Basic Logic Dialect (BLD) and Production Rule Dialect (PRD).<ref>[http://www.w3.org/TR/2010/NOTE-rif-overview-20100622/ RIF Overview<!-- Bot generated title -->]</ref>
The '''Rule Interchange Format''' (RIF) is a [[W3C]] recommendation-track effort to develop a format for interchange of rules in rule-based systems on the semantic web. The goal is to create an interchange format for different rule languages and [[inference engine]]s. The RIF initiative is closely related to [[Ontology (computer science)|Ontologies]]. Whereas ontologies describe distributed information objects in a computer executable manner, rules in this sense combine such information and derive new information on top of ontologies.


== History ==
== 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 Saint-Marie of [[ILOG]], and [[Chris Welty]] of [[IBM]].
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]]<ref>Welty, Chris (2009). "[http://www.w3.org/2005/rules/wiki/images/b/b0/W3C_RIF-CW-9-09.pdf Rule Interchange Format]". Invited presentation to the NY Semantic Web Meetup.</ref>).


RIF became a [[W3C Recommendation]] on June 22, 2010.<ref>[http://www.w3.org/TR/2010/REC-rif-core-20100622/ RIF Core Dialect<!-- Bot generated title -->]</ref>
== See also ==


== Rules and rule systems ==
* [[Semantic web]]

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]], [[function (mathematics)|functions]], [[Non-monotonic logic|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 system|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.<ref>[http://www.w3.org/TR/rif-ucr/#Structure_of_RIF RIF Use Cases and Requirements]</ref>

===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 (W3C)|XML Schema]] Datatypes,<ref>[http://www.w3.org/TR/2009/CR-xmlschema11-2-20090430/ XML Schema Datatypes]</ref> [[XPath]] functions<ref>[http://www.w3.org/TR/xpath-functions/ XPath-Functions]</ref> and rdf:PlainLiteral functions.<ref>[http://www.w3.org/TR/rdf-plain-literal/ rdf:PlainLiteral: A Datatype for RDF Plain Literals]</ref>

===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 (data structure)|frame]] syntax of RIF BLD is based on [[F-logic]], but RIF BLD doesn't have the [[non-monotonic reasoning]] features of F-logic.<ref name="Krötzsch2010">{{cite book|author=M. Krötzsch|title=Description Logic Rules|url=https://books.google.com/books?id=Z8h7AgAAQBAJ&pg=PA10|date=October 2010|publisher=IOS Press|isbn=978-1-61499-342-1|page=10}}</ref>

===PRD===
The Production Rules Dialect (PRD) can be used to model [[Production (computer science)|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 <ref>[http://www.w3.org/TR/rif-prd RIF-PRD specification]</ref>)
<syntaxhighlight lang="text">
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"]) ) )
</syntaxhighlight>

==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)<ref>[http://ruleml.org/rif/RIF-CASPD.html RIF Core Answer Set Programming Dialect]</ref> is based on [[answer set programming]], that is, declarative logic programming based on the answer set semantics ([[stable model semantics]]).

Example:
<pre>
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] )
)
)
</pre>

===URD===

The Uncertainty Rule Dialect (URD)<ref>[http://c4i.gmu.edu/ursw/2008/papers/URSW2008_F9_ZhaoBoley.pdf 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.]</ref> supports a direct representation of uncertain knowledge.

Example:
<pre>
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)
) )
</pre>

===SILK===

RIF-SILK<ref>[http://silk.semwebcentral.org/RIF-SILK.html RIF SILK dialect]</ref> 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.<ref>[http://www.stanford.edu/class/cs227/Readings/20100426-SILK-specification.pdf The SILK Language, Benjamin Grosof, Michael Kifer, Mike Dean. Vulcan Inc., 2009.]</ref>

Example
<pre>
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)
}
}
</pre>

== See also ==
* [[Ontology alignment]]
* [[Ontology alignment]]
* [[R2ML]]
* [[Production Rule Representation]] - comparable to the dialect of RIF called Production Rule Dialect, although targeting modeling not run-time interchange.

== References ==
<references/>


== External links ==
== External links ==
* [http://www.w3.org/2005/rules/wg RIF Working Group]
* [http://www.w3.org/2005/rules/wiki/RIF_Working_Group RIF Working Group]
* [http://hydrogen.informatik.tu-cottbus.de/wiki/index.php/Portal:RIF RIF Examples]
* [http://www.w3.org/2005/rules/wiki/RIF_FAQ RIF FAQ]


{{W3C standards}}
[[Category:Semantic Web]]
{{Semantic Web}}
[[Category:World Wide Web]]


[[Category:Semantic Web]]
{{web-stub}}
[[Category:Knowledge representation languages]]

Latest revision as of 13:14, 4 December 2023

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]

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

History[edit]

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[edit]

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[edit]

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[edit]

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[edit]

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

FLD[edit]

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[edit]

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[edit]

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[edit]

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

CASPD[edit]

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[edit]

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[edit]

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[edit]

References[edit]

  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.

External links[edit]