eBusiness Technologies (ebTech) Introduction to visual rules modeling Adrian Giurca, eBusiness Technologies, Craiova, March 2009 Dr. Adrian Giurca Brandenburg University of Technology Cottbus, Germany
Rules in "real life" IF the customer is a gold customer and its current shopping cart is more than 150 EUR THEN set a 5% discount to the shopping cart. IF the customer is a platinum customer and its current shopping cart is more than 500 EUR THEN set a 15% discount to the shopping cart. All platinum customers are gold customers.  Adrian Giurca, eBusiness Technologies, Craiova, March 2009
Real rules are based on vocabularies Classes Customer Shopping cart Properties discount customerName Adrian Giurca, eBusiness Technologies, Craiova, March 2009 Q:  How we discover them?   A: As in Software Engineering Design
Vocabularies (1) Software engineers represents vocabularies with the help of UML class diagrams Different constraints are expressed with OCL Adrian Giurca, eBusiness Technologies, Craiova, March 2009
Vocabularies (2) Semantic Web community represents vocabularies with RDFS and/or OWL Adrian Giurca, eBusiness Technologies, Craiova, March 2009 <rdf:RDF xmlns:rdf=&quot;...&quot; xmlns:rdfs=&quot;...&quot;> <rdfs:Class rdf:ID=&quot;ex:Customer&quot;/>  <rdfs:Class rdf:ID=&quot;ex:GoldCustomer&quot;> <rdfs:subclassOf rdf:resource=&quot;ex:Customer&quot;/> </rdfs:Class> <rdf:Property rdf:ID=&quot;yearSpending&quot;> <rdfs:domain rdf:resource=&quot;ex:Customer&quot;/> <rdfs:range rdf:datatype=&quot;xs:double&quot;/> </rdf:Property> </rdf:RDF>
A Short Comparison UML provides a visual notation but a more complex XML serialization (XMI) RDFS/OWL provides XML syntax but no visual notation. The XML syntax is not based on XML Schema/RelaxNG therefore special validators are necessary UML provides support for packaging  RDFS/OWL use XML namespaces Adrian Giurca, eBusiness Technologies, Craiova, March 2009
Modeling Rules Q:  Why to use a modeling language for rules? A:  Simply because natural language is sometimes ambiguous and we don't know how to encode the rule Remember also the logic controversy... Do you remember it? Adrian Giurca, eBusiness Technologies, Craiova, March 2009
Vocabularies and rules Adrian Giurca, eBusiness Technologies, Craiova, March 2009 Rule: If rental car is stored at the branch and rental car is not assigned to any rental and it is not a rental car scheduled for service then rental car is available at the branch.
UML-based Rule Modeling Language Any person being a male and is not a husband is a bachelor .  Adrian Giurca, eBusiness Technologies, Craiova, March 2009 bachelor(X):- male(X), not(husband(X)).
If-Then-Else Rule Adrian Giurca, eBusiness Technologies, Craiova, March 2009 If the order value is less than 1000 give a discount of 3% otherwise give 6%.
Derived Association Rule Example Adrian Giurca, eBusiness Technologies, Craiova, March 2009
Your knowledge on rules Do you know rule languages? Adrian Giurca, eBusiness Technologies, Craiova, March 2009 Drools? Do you use rule languages? Drools?   What rule-based applications you built? Have you finished your first  Drools  example? I will not work for you
Do you like rule-based applications? Adrian Giurca, eBusiness Technologies, Craiova, March 2009 Tower of Babel - Pieter Bruegel (1563)

Introduction to visual rules modeling

  • 1.
    eBusiness Technologies (ebTech)Introduction to visual rules modeling Adrian Giurca, eBusiness Technologies, Craiova, March 2009 Dr. Adrian Giurca Brandenburg University of Technology Cottbus, Germany
  • 2.
    Rules in &quot;reallife&quot; IF the customer is a gold customer and its current shopping cart is more than 150 EUR THEN set a 5% discount to the shopping cart. IF the customer is a platinum customer and its current shopping cart is more than 500 EUR THEN set a 15% discount to the shopping cart. All platinum customers are gold customers. Adrian Giurca, eBusiness Technologies, Craiova, March 2009
  • 3.
    Real rules arebased on vocabularies Classes Customer Shopping cart Properties discount customerName Adrian Giurca, eBusiness Technologies, Craiova, March 2009 Q: How we discover them? A: As in Software Engineering Design
  • 4.
    Vocabularies (1) Softwareengineers represents vocabularies with the help of UML class diagrams Different constraints are expressed with OCL Adrian Giurca, eBusiness Technologies, Craiova, March 2009
  • 5.
    Vocabularies (2) SemanticWeb community represents vocabularies with RDFS and/or OWL Adrian Giurca, eBusiness Technologies, Craiova, March 2009 <rdf:RDF xmlns:rdf=&quot;...&quot; xmlns:rdfs=&quot;...&quot;> <rdfs:Class rdf:ID=&quot;ex:Customer&quot;/> <rdfs:Class rdf:ID=&quot;ex:GoldCustomer&quot;> <rdfs:subclassOf rdf:resource=&quot;ex:Customer&quot;/> </rdfs:Class> <rdf:Property rdf:ID=&quot;yearSpending&quot;> <rdfs:domain rdf:resource=&quot;ex:Customer&quot;/> <rdfs:range rdf:datatype=&quot;xs:double&quot;/> </rdf:Property> </rdf:RDF>
  • 6.
    A Short ComparisonUML provides a visual notation but a more complex XML serialization (XMI) RDFS/OWL provides XML syntax but no visual notation. The XML syntax is not based on XML Schema/RelaxNG therefore special validators are necessary UML provides support for packaging RDFS/OWL use XML namespaces Adrian Giurca, eBusiness Technologies, Craiova, March 2009
  • 7.
    Modeling Rules Q: Why to use a modeling language for rules? A: Simply because natural language is sometimes ambiguous and we don't know how to encode the rule Remember also the logic controversy... Do you remember it? Adrian Giurca, eBusiness Technologies, Craiova, March 2009
  • 8.
    Vocabularies and rulesAdrian Giurca, eBusiness Technologies, Craiova, March 2009 Rule: If rental car is stored at the branch and rental car is not assigned to any rental and it is not a rental car scheduled for service then rental car is available at the branch.
  • 9.
    UML-based Rule ModelingLanguage Any person being a male and is not a husband is a bachelor . Adrian Giurca, eBusiness Technologies, Craiova, March 2009 bachelor(X):- male(X), not(husband(X)).
  • 10.
    If-Then-Else Rule AdrianGiurca, eBusiness Technologies, Craiova, March 2009 If the order value is less than 1000 give a discount of 3% otherwise give 6%.
  • 11.
    Derived Association RuleExample Adrian Giurca, eBusiness Technologies, Craiova, March 2009
  • 12.
    Your knowledge onrules Do you know rule languages? Adrian Giurca, eBusiness Technologies, Craiova, March 2009 Drools? Do you use rule languages? Drools? What rule-based applications you built? Have you finished your first Drools example? I will not work for you
  • 13.
    Do you likerule-based applications? Adrian Giurca, eBusiness Technologies, Craiova, March 2009 Tower of Babel - Pieter Bruegel (1563)