ArticleslgStudy

science

Rule Interchange Format

Rule Interchange Format is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Rule Interchange Format rather than just read about it. In short: 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.

Key takeaways

  • Rule Interchange Format belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Rule Interchange Format to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Rule Interchange Format from memory before moving on to harder problems.

Reference excerpt

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. RIF includes three dialects, a Core dialect which is extended into a Basic Logic Dialect (BLD) and Production Rule Dialect (PRD).

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). RIF became a W3C Recommendation on June 22, 2010.

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.

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, XPath functions and rdf:PlainLiteral functions.

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.

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 )

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) 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) 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 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. 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 Ontology alignment R2ML Production Rule Representation - comparable to the dialect of RIF called Production Rule Dialect, although targeting modeling not run-time interchange.

References

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Rule Interchange Format

Start with the simplest possible case. Write down what Rule Interchange Format claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Rule Interchange Format before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Rule Interchange Format ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Rule Interchange Format

In research
Rule Interchange Format appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Rule Interchange Format in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Rule Interchange Format is common in secondary-school and first-year university syllabi. It links to neighbouring topics Knowledge representation languages, Semantic Web, so understanding it makes those chapters shorter.
In everyday life
Look for Rule Interchange Format outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Rule Interchange Format in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Rule Interchange Format means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Rule Interchange Format out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Rule Interchange Format in simple terms?

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.

Why does Rule Interchange Format matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Rule Interchange Format?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Rule Interchange Format.

Tags

  • Knowledge representation languages
  • Semantic Web

Keep exploring