Difference between revisions of "Rules"

From BC$ MobileTV Wiki
Jump to: navigation, search
Line 119: Line 119:
== External Links ==
== External Links ==
* [[wikipedia: Rule]]
* [[wikipedia: Business rule]]
* [[wikipedia: Business rule]]
* [[wikipedia: Ethics]]
* [[wikipedia: Normative ethics]]
* [[wikipedia: Deontological ethics]]
* [[wikipedia: Virtue ethics]]
* [[wikipedia: Consequentialism]]
* [[wikipedia: Ethics of care]]
* [[wikipedia: Pragmatic ethics]]
* Rules and Norms - Requirements for Rule Interchange Languages in the Legal Domain: http://www.springerlink.com/content/v81q672j251ln864/
* Rules and Norms - Requirements for Rule Interchange Languages in the Legal Domain: http://www.springerlink.com/content/v81q672j251ln864/

Revision as of 14:17, 1 November 2012

Rule Inference process

Rules are logical limitations or conditional cases placed upon a set of data or transfer of data.



The mission of the Rule Interchange Format (RIF) Working Group is to produce W3C Recommendations for rules interchange, which could support each of its predecessor languages: SWRL, RuleML, POSL and other derivaties such as Drools Business Rules, BPML or BPEL.


A Semantic Web Rule Language combining OWL and  RuleML (SWRL)

Father of RIF standards, RuleML was an early XML syntax for representing POSL rulebases more efficiently than their slightly verbose syntax.

"Rules in (and for) the Web have become a mainstream topic since inference rules were marked up for E-Commerce and were identified as a Design Issue of the Semantic Web, and since transformation rules were put to practice for document generation from a central XML repository (as used here). Moreover, rules have continued to play an important role in AI shells for knowledge-based systems and in Intelligent Agents, today both needing a Web interchange format, and such XML/RDF-standardized rules are now also usable for the declarative specification of Web Services."


POSL is the grandfather of the RIF standard and started as a research initiative into Rule Engines at NRC-IIT (in Canada).


Inference is what happens when a rule base or logic set is triggered (i.e. run in the backend) to evaluate outcomes against some incoming inputs. An example is that you have a rule base representing a patient (i.e. vital signs) and you want to check whether their blood pressure exceeded a specific threshold (i.e. 150/80 where "150" is the systolic blood pressure measurement and we don't want it going any higher than 150, and, "80" is diastolic blood pressure measurement and we don't want it going any lower than 80), and if so, send a warning message to their nurse, doctor or other healthcare providers of interest.

The (raw) input would look as follows:

blood_pressure = 150/80

The Rule Engine parses the blood pressure measurement and produces actionable inputs:

blood_pressure = 150/80
blood_pressure_systolic = 150
blood_pressure_diastolic = 80

The rule-base might look as follows:

IF blood_pressure_systolic > 150
   blood_pressure_diastolic < 80
  notify Nurse ==> blood_pressure, patient_name

The Nurse object would correspond to some data or query built into the system, such as the SQL statement:

SELECT nurse_name,nurse_email,nurse_phone FROM patient_nurses LEFT JOIN nurses ON patient_nurses.nid=nurses.nurse_id WHERE patient.patient_id=12345;

(although it wouldn't necessarily need to be SQL, and data or object persistence system could be interacted with to do the inference).

The inference would then occur according to the definition of the action which was to "notify" the Nurse (in a specific programming language, i.e. Java):

import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
Properties props = System.getProperties();
  props.put("mail.host", host);
  props.put("mail.transport.protocol", "smtp");
Session session = Session.getDefaultInstance(props, null);
try {
  Message msg = new MimeMessage(session);   // Instantiate new MimeMessage and fill with required information
  msg.setFrom(new InternetAddress(from));
  InternetAddress[] address = {new InternetAddress(to)};
    msg.setRecipients(Message.RecipientType.TO, address);
    msg.setSentDate(new Date());
  Transport.send(msg);    // Hand message to the default transport service for delivery
catch (MessagingException mex) {



External Links

See Also

Rule Engine | Description Logic