Re: Joint Committee telecon today 22 July

From: Harold Boley (boley@informatik.uni-kl.de)
Date: 07/22/03

  • Next message: Said Tabet: "XML syntax examples for today's discussion"
    Hi Mike and All, 
    
     this is for today's Rules XML Syntax session 
     (inlined and attached). 
    
     Talk to you in 15 minutes, 
     Harold 
    
     ----------------------------------------------
    
    SEMANTIC WEB RULE LANGUAGE: DATA MODEL, SYNTACTIC LAWS, AND XML MARKUP
    
    Draft 22 July 03
    
    Harold Boley, Said Tabet, Gerd Wagner
    
    
    We give the rule syntax as a data model with algebraic laws in a graphical notation.
    For presentation purposes we begin with the positional syntax and then go into the
    object-oriented syntax. The algebraic laws, here tree equations, define equivalence
    classes that give us a higher level of abstraction than in ordinary abstract syntax.
    Data model trees can be easily transcribed into the XML markup. The PR shorthand and
    presentation syntax (http://www.ruleml.org/submission/ruleml-shortation.html), where
    given, can also be pasted into the parser linked from PR's 'Implementation' section.
    For an XML markup discussion see "Essential RuleML: The discount rulebase use case"
    (http://www.ruleml.org/submission/essentialruleml.html). Finally, we give an initial
    syntax for typing rule variables by URI-referencing RDFS or OWL classes.
    
    
    Positional Syntax
    =================
    
    Data Model
    ~~~~~~~~~
    
    Trees with two categories of arcs, XML-like positional arcs & RDF-like role arcs:
    
    Positional:         |
    
    Roles (system):     *
    
    
    Example (PR):
    
    discount(?customer,?product,percent5.0)  :-       
       premium(?customer), regular(?product).
    
    
    Example (normal):
    
     imp-------------------------------------------------
              *                                         *
         head *                                    body *
              *                                         *
            atom----------------------------           and----------------------
                 *       |       |         |                *                  *
             opr *       |       |         |                *                  *
                 *       |       |         |                *                  *        
                rel     var     var       ind             atom----------     atom----------
                 .       .       .          .                  *       |          *       |
                 .       .       .          .              opr *       |      opr *       |
                 .       .       .          .                  *       |          *       |
           discount   customer   product   5.0 percent        rel     var        rel     var
                                                               .       .          .       .
                                                               .       .          .       .
                                                               .       .          .       .
                                                           premium  customer    regular  product
    
    Example (expanded):
    
     imp-------------------------------------------------
              *                                         *
         head *                                    body *
              *                                         *
            atom------------------                     and----------------------
                 *               *                          *                  *
                 *           seq *                          *                  *
                 *               *                          *                  *
             opr *       -------------------                *                  *
                 *       |       |         |                *                  *        
                rel      |       |         |              atom----------     atom----------
                 .       |       |         |                   *       *          *       *
                 .      var     var       ind                  *   seq *          *   seq *
                 .       .       .          .                  *       *          *       *
                 .       .       .          .              opr *       -      opr *       -
                 .       .       .          .                  *       |          *       |
           discount   customer   product   5.0 percent        rel     var        rel     var
                                                               .       .          .       .
                                                               .       .          .       .
                                                               .       .          .       .
                                                           premium  customer    regular  product
    
    
    Example (considered option: role type, multiple body):
    
     imp------------------------------------------------------------------------
              *                                             *                  *
         head *                                       mbody *           mbody  *
              *                                             *                  *
            atom----------------------------                *                  *
                 *       |       |         |                *                  *
             opr *       |       |         |                *                  *
                 *       |       |         |                *                  *        
           discount     var     var       ind             atom----------     atom----------
                         .       .          .                  *       |          *       |
                         .       .          .              opr *       |      opr *       |
                         .       .          .                  *       |          *       |
                      customer   product   5.0 percent     premium    var       regular  var
                                                                       .                  .
                                                                       .                  .
                                                                       .                  .
                                                                     customer            product
    
    
    Example (preferred option: role type, branching body):
    
     imp---------------------------------------------------------------
              *                                                       *
         head *                                                 bodya *
              *                                                       * 
            atom----------------------------                          *
                 *       |       |         |                ********************
             opr *       |       |         |                *                  *
                 *       |       |         |                *                  *
           discount     var     var       ind             atom----------     atom----------
                         .       .          .                  *       |          *       |
                         .       .          .              opr *       |      opr *       |
                         .       .          .                  *       |          *       |
                      customer   product   5.0 percent     premium    var       regular  var
                                                                       .                  .
                                                                       .                  .
                                                                       .                  .
                                                                     customer            product
    
    
    Laws
    ~~~
    
    Commutativity for system roles:
    
    Specific:
    
     imp------------------                imp------------------
              *          *                         *          *
         head *     body *        =           body *     head *
              *          *                         *          *
            / x \      / y \                     / y \      / x \
    
    
    General:
    
     type-------------------------------------                 type-------------------------------------
                      *               *                                         *               * 
         . . .  rolej *  . . .  rolek *  . . .        =            . . .  rolek *  . . .  rolej *  . . .
                      *               *                                         *               *
                    / x \           / y \                                     / y \           / x \
    
    
    
    Sequence expansion/contraction:
    
    Specific:
    
     atom--------------------------             atom------------------
          *       |               |                  *               *
      opr *       |     . . .     |       =      opr *           seq *
          *       |               |                  *               *
         rel     arg1            argN                *       -----------------
          .                                          *       |               |
          .                                          *       |     . . .     |
          .                                          *       |               |
         pcd                                        rel     arg1            argN
                                                     .
                                                     .
                                                     .
                                                    pcd
    
    General (analogous)
    
    
    
    Role type:
    
    Specific (needed for Datalog):
    
     atom--------------------------             atom--------------------------
          *       |               |                  *       |               |
      opr *       |     . . .     |       =      opr *       |     . . .     |
          *       |               |                  *       |               |
         rel     arg1            argN               pcd     arg1            argN
          .
          .
          .
         pcd
    
    
    Specific (needed for Hornlog):
    
     cterm-------------------------             cterm-------------------------
          *       |               |                  *       |               |
      opc *       |     . . .     |       =      opc *       |     . . .     |
          *       |               |                  *       |               |
        ctor     arg1            argN               pcd     arg1            argN
          .
          .
          .
         pcd
    
    
    General (untyped PCDATA are regarded as being typed with 'any'):
    
    This corresponds to an RDFS-like range restriction or a
    description logic-like equivalence  Forall rolet.type  <=>  Forall rolea.any .
    When no ambiguity arises, 'rolet' and 'rolea' can be the same, like 'opr' above
    
     type0----------------------           type0----------------------
                       *                                     *
         . . .   rolet *   . . .       =         . . . rolea *   . . .
                       *                                     *
                     type                                   pcd
                       .
                       .
                       .
                      pcd
    
    
    
    Multiple body (considered option):
    
    General (the multiple-body role 'mbody' is non-functional, like, e.g., 'author' in Dublin Core):
    
     imp---------------------                           imp----------------------------------------
                    *                                                  *                  *
               body *                              =             mbody *            mbody *
        . . .       *   . . .                              . . .       *                  *   . . .
                   and----------------------                           *                  *
                        *                  *                           *                  *
                        *       . . .      *                           *       . . .      *
                        *                  *                           *                  *
                      / c1 \             / cM \                      / c1 \             / cM \
    
    
    
    Branching body (preferred option):
    
    General (the body-and role 'bodya' is syntactically functional, but has an implicit set value):
    
     imp---------------------                           imp----------------------------------------
                    *                                                           *
               body *                              =                      bodya *
        . . .       *   . . .                              . . .                *             . . .
                   and----------------------                           ********************
                        *                  *                           *                  *
                        *       . . .      *                           *       . . .      *
                        *                  *                           *                  *
                      / c1 \             / cM \                      / c1 \             / cM \
    
    
    
    
    
    Object-Oriented Syntax
    ======================
    
    Data Model
    ~~~~~~~~~
    
    Trees with two main categories and two subcategories of arcs:
    
    Positional:         |
    
    Roles (system):     *
    Roles (user):       #
    
    
    Example (PR):
    
    discount(cust->?customer;prod->?product;rebate->percent5.0) :-
       premium(cust->?customer), regular(prod->?product).
    
    
    Example (normal):
    
     imp----------------------------------------------------
              *                                            *
         head *                                       body *
              *                                            *
            atom-------------------------------           and-----------------------
                 *        #        #          #                *                   *
             opr *   cust #   prod #   rebate #                *                   *
                 *        #        #          #                *                   *        
                rel      var      var        ind             atom-----------     atom-----------
                 .        .        .           .                  *        #          *        #
                 .        .        .           .              opr *   cust #      opr *   prod #
                 .        .        .           .                  *        #          *        #
           discount    customer    product    5.0 percent        rel      var        rel      var
                                                                  .        .          .        .
                                                                  .        .          .        .
                                                                  .        .          .        .
                                                              premium   customer    regular   product
    
    
    Example (considered option: role type, multiple body):
    
     imp----------------------------------------------------------------------------
              *                                                *                   *
         head *                                          mbody *             mbody *
              *                                                *                   *
              *                                                *                   *
            atom-------------------------------                *                   *
                 *        #        #          #                *                   *
             opr *   cust #   prod #   rebate #                *                   *
                 *        #        #          #                *                   *        
           discount      var      var        ind             atom-----------     atom-----------
                          .        .           .                  *        #          *        #
                          .        .           .              opr *   cust #      opr *   prod #
                          .        .           .                  *        #          *        #
                       customer    product    5.0 percent     premium     var       regular   var
                                                                           .                   .
                                                                           .                   .
                                                                           .                   .
                                                                        customer              product
    
    
    Example (preferred option: role type, branching body):
    
     imp------------------------------------------------------------------
              *                                                          *
         head *                                                    bodya *
              *                                                          *
              *                                                          *
            atom-------------------------------                          *
                 *        #        #          #                *********************
             opr *   cust #   prod #   rebate #                *                   *
                 *        #        #          #                *                   *        
           discount      var      var        ind             atom-----------     atom-----------
                          .        .           .                  *        #          *        #
                          .        .           .              opr *   cust #      opr *   prod #
                          .        .           .                  *        #          *        #
                       customer    product    5.0 percent     premium     var       regular   var
                                                                           .                   .
                                                                           .                   .
                                                                           .                   .
                                                                        customer              product
    
    
    Laws
    ~~~
    
    Commutativity of roles: system-system (see above) as well as
                            user-user and system-user (analogous)
    
    The other laws are taken directly from the positional syntax
    
    
    
    
    
    Typing Syntax
    =============
    
    An initial XML syntax for typing can be based on the 'Typing' section of the
    PR syntax (http://www.ruleml.org/submission/ruleml-shortation.html), using
    QNames that URI-reference RDFS or OWL classes. While typing is sketched for
    the positional syntax here, it can be specified in the same manner for the
    object-oriented syntax.
    
    
    Example (PR):
    
    c:='http://e-biz.org/taxonomy#Custclass'.
    p:='http://e-biz.org/taxonomy#Prodclass'.
    
    discount(c:?customer,p:?product,percent5.0)  :-       
       premium(c:?customer), regular(p:?product).
    
    
    Example (normal, with URI declarations):
    
    c:='http://e-biz.org/taxonomy#Custclass'.
    p:='http://e-biz.org/taxonomy#Prodclass'.
    
     imp-------------------------------------------------
              *                                         *
         head *                                    body *
              *                                         *
            atom----------------------------           and----------------------
                 *       |       |         |                *                  *
             opr *       |       |         |                *                  *
                 *       |       |         |                *                  *        
                rel     var     var       ind             atom----------     atom----------
                 .       .       .          .                  *       |          *       |
                 .       .       .          .              opr *       |      opr *       |
                 .       .       .          .                  *       |          *       |
          discount  c:customer  p:product  5.0 percent        rel     var        rel     var
                                                               .       .          .       .
                                                               .       .          .       .
                                                               .       .          .       .
                                                         premium  c:customer  regular  p:product
    


    This archive was generated by hypermail 2.1.4 : 07/22/03 EST