Translator
: R2ML to text visualization
for R2ML version 0.4
With this web Visualizator we give you the ability to test your R2ML markup and generate
textual visualization
.
Contact:
Adrian Giurca
,
Marco Pehla
and Jens Werner (jens.werner {at} tu-cottbus.de)
The text area below contains a sample R2ML-rulebaseset.
In order to visualize this rule baseset, click "visualize" button.
Form
Visualize
If X is the parent of Y and X is brother of Z then Z is the uncle of Y
uncle(Z,Y):-parent(X,Y),brother(X,Z).
Uncle definition
Adrian Giurca
Gerd Wagner
Sergey Lukichev
Uncle Rule
REWERSE I1 Rules Markup Language
2006-04-06
The successor of a natural number is a natural number
natural_number(succ(N)):-natural_number(N).
Defining natural numbers
Adrian Giurca
Gerd Wagner
Sergey Lukichev
Successor Rule
2006-04-06
A customer is premium if their spending has been min 5000 euro in the previous year.
premium
customer
spending
customer
min 5000 euro
previous year
Adrian Giurca
Premium customer
http://www.ruleml.org/papers/tutorial-ruleml-20050513.html
2006-04-05
The discount for a customer buying a product is 7.5 percent if the customer is premium and the product is luxury.
discount
customer
product
7.5 percent
premium
customer
luxury
product
RuleML example in R2ML
Adrian Giurca
Give discount
http://www.ruleml.org/papers/tutorial-ruleml-20050513.html
2006-04-05
FORALL X,Y,Z X[ancestor->>Y] - X[father->Z] AND Z[ancestor->>Y].
A rule from ancestor definition in F-Logic
Adrian Giurca
http://www.ontoprise.de/content/e2/e29/e30/e490/e600/F-Logic_Tutorial_eng.pdf
2006-05-05
SQL View as derivation rule
Adrian Giurca
Gerd Wagner
Sergey Lukichev
SQL View Example
2006-04-07
If rental car is stored at the branch and it is not assigned to a rental and it is not scheduled for service, then rental car is available at the branch.
context Branch::availableCar: RentalCar derive: self.storedCar -> select (c | not oclIsKindOf(RentalCarScheduledForService) and c.Rental --> isEmpty() )
Sergey Lukichev
Gerd Wagner
Adrian Giurca
2006-04-07
If a rental car has more than 90 days or more than 5000 km since the last service then rental car is a rental car scheduled for service.
context RentalCar:: isScheduledForService:Boolean derive: last_maintenance_date >=90 or service_reading>5000
Sergey Lukichev
Gerd Wagner
Gerd Wagner
2006-03-30
If a person is male and no bachelor then he is maried and a husband.
Marco Pehla
Gerd Wagner
2006-04-05
Any person who was some time in the last 2 months an employee of an organization which was some time in the last 2 months a W3C member may register.
Marco Pehla
Adrian Giurca
authentication
http://www.ruleml.org/0.9/exa/authenticate.ruleml
11-05-2006
may register
any
person
any
organization
org
employee in
any
org
last
month
2
member in
org
W3C
last
month
2
a simplified broker definition
Marco Pehla
Adrian Giurca
broker
http://www.ruleml.org/0.9/exa/broker.ruleml
24-05-2006
buy
broker
prod
want
customer-of-broker
prod
deal
prod
cost
prod
benefit-of-prod
A person owns an object if it buys the object from a merchant and the keeps it.
Marco Pehla
Adrian Giurca
own
http://www.ruleml.org/0.9/exa/own.ruleml
29-05-2006
own
person
object
buy
person
merchant
object
keep
person
object
If you want to review rule principles, you may have a look at the rule based system at http://www.cs.brandeis.edu .
Marco Pehla
Adrian Giurca
recommend
http://www.ruleml.org/0.9/exa/recommend.ruleml
30-05-2006
may look at
you
Rule-Based Systems
want to review
you
rule principles
want to review
fred
rule principles
Adrian Giurca
package org.drools.examples import org.drools.examples.TroubleTicketExample.Customer; import org.drools.examples.TroubleTicketExample.Ticket; rule "Platinum Priority" when customer : Customer( subscription == "Platinum" ) ticket : Ticket( customer == customer, status == "New" ) then; ticket.setStatus( "Escalate" ); modify( ticket ); end
If the order value is greater than 1000 and the customer type is not gold then give a 10% discount.
when { IlrContext() from ?context; evaluate(orderValue >=1000 and !(customerRating equals "Gold")); } then discount = 10
Sergey Lukichev
Gerd Wagner
2006-04-05
If the person age is less than 3 then send him a greeting.
(defrule welcome-toddlers "Give a special greeting to young children" (< ( age ?person) 3) => (printout ?person "Hello, little one!" crlf))
Give a special greeting to young children
Adrian Giurca
Gerd Wagner
Sergey Lukichev
welcome-toddlers
REWERSE I1 Rules Markup Language
2006-03-30
If a person has a male sibling and the sibling is older then the person, the person has an older brother.
(defrule aRule (Person (name ?x))(Man (name ?y)) (hasSibling ?x ?y)(hasAge ?x ?a1) (hasAge ?y ?a2)(test (> ?age2 ?age1)) => (assert (hasOlderBrother ?x ?y))
Adrian Giurca
http://www.med.univ-rennes1.fr/~cgolb/Protege2005/SWRLJessOConnor.pdf
2006-05-05
If reservation date of a rental is 5 days in advance then give rental a 10 % discount.
Adrian Giurca
Gerd Wagner
2006-04-05
On customer send a checkrequest, if the custumer the lineowner, check the line
on checkrequest(line, customer) if lineowner.equals(customer) do check(line)
Check a phoneline
Jens Werner
Adrian Giurca
CheckLine
REWERSE I1 Rules Markup Language
2006-10-01
RESERVE