XML Schema for RIF (was Re: [Fwd: Re: MISMO APOCRIF])

I am attaching the RIF schema that I've been using.  I derived it very 
straightforwardly from Harold's DTD, using xsd:group where Harold uses 
XML entities.  It doesn't have arrow and boolean sorts, because neither 
the ASN nor the DTD have these sorts.  It is overly complex, because 
Harold's DTD supports both striped and unstriped variants in some cases 
(e.g. "if" and "then" wrapper elements are optional).

Christian de Sainte Marie wrote:

> Philippe, Gary,
>
> We would like to start discussing the XML syntax for RIF Core at the 
> next telecon, and I notice that the emails you exchanged on the 
> subject (some attached) where not on the RIF list: could you circulate 
> the syntaxes you use (Philippe) or propose (Gary), along with some 
> explanation (why you do/propose it that way) and a summary of your 
> exchange as soon as possible, so that I can refer to it in the agenda 
> and the group have some time to think about it before the telecon?
>
> Thanx,
>
> Christian
>
> ------------------------------------------------------------------------
>
> Subject:
> Re: MISMO APOCRIF
> From:
> Gary Hallmark <gary.hallmark@oracle.com>
> Date:
> Wed, 02 May 2007 14:32:33 -0700
> To:
> Philippe Bonnard <pbonnard@ilog.fr>
>
> To:
> Philippe Bonnard <pbonnard@ilog.fr>
> CC:
> Christian de Sainte Marie <csma@ilog.fr>, "Boley, Harold" 
> <Harold.Boley@nrc-cnrc.gc.ca>
>
>
> I should have been clearer. I was talking about a RIF POC, like 
> sending some simple "hello world" ruleset between multiple vendors 
> using the current core specification. I wonder if we could agree on a 
> RIF.xsd. I offer a simple one modeled directly on Harold Boley's DTD.
>
> Philippe Bonnard wrote:
>
>> Hi Gary,
>>
>> You will find attached the final schema used in MISMO POC.
>>
>> The test rules are currently built upon the schema mismo.xsd applied 
>> for testing. The final rules used for the demonstration will be 
>> authored in few days.
>>
>> I would be glad to work with you about an experimentation of rule 
>> inter-operability with Oracle.
>>
>> You will find additional information here 
>> http://wiki.mismo.org/MISMOWiki/Wiki.jsp?page=ProofOfConcept, 
>> although it may be better that we discuss on phone about the POC 
>> architecture. Furthermore, the source of the POC could be downloaded 
>> form this page. Its name is apocrif1.0.zip. I don’t attach it to that 
>> E-Mail because your mailing server seems to drop E-Mails with such an 
>> attachment.
>>
>> Regards. Philippe.
>>
>> ------------------------------------------------------------------------
>>
>> *From:* public-rif-wg-request@w3.org 
>> [mailto:public-rif-wg-request@w3.org] *On Behalf Of *Gary Hallmark
>> *Sent:* Friday, April 27, 2007 1:00 AM
>> *To:* Christian de Sainte Marie; RIF WG
>> *Subject:* [Suspected Spam]Re: [Admin] preparing to test demo sharing 
>> at telecon today
>>
>> Christian,
>>
>> If we had an XML schema defining RIF, I would build a POC for RIF and 
>> then we would have a really interesting POC -- interchange of rules 
>> between different members of the working group!
>>
>> Christian de Sainte Marie wrote:
>>
>>
>> All,
>>
>> During the telecon today, we will spend sometime testing the set-up 
>> for making a demo of a POC implementation of RIF (well, sort of RIF 
>> :-) at a later telecon. We will use Raindance, the system used at 
>> ILOG for Web seminars.
>>
>> Since it would be burdensome to invite each potential attendees 
>> individually, we will ask you to install a Raindance client.
>>
>> You will have to go to our Raindance meetings Web site:
>> http://ilog.on.raindance.com
>>
>> There, if you are on Windows, ask for a pre-meeting install. I tried 
>> it, but it seems to offer only the "full-service" option, which is 
>> for Windows plat-form, if I understood correctly.
>>
>> So, if it does not offer you the light option and you are not on 
>> Windows, try the "join an unscheduled meeting" option, and use our 
>> provisional meeting ID, which is 9250520, then follow the 
>> instructions to install the right client.
>>
>> During the telecon, we will try having everybody joining, and see if 
>> you see Philippe's screen... or check who cannot and try to find out 
>> why.
>>
>> Cheers,
>>
>> Christian
>>
>> -- 
>>
>>
>> Oracle <http://www.oracle.com>
>> Gary Hallmark | Architect | +1.503.525.8043
>> Oracle Server Technologies
>> 1211 SW 5th Avenue, Suite 800
>> Portland, OR 97204
>>
>
>------------------------------------------------------------------------
>
><?xml version="1.0" encoding="US-ASCII" ?>
><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>            xmlns="http://www.w3.org/RIF/2007"
>            targetNamespace="http://www.w3.org/RIF/2007"
>            elementFormDefault="qualified">
>  <xsd:element name="Ruleset">
>    <xsd:annotation>
>      <xsd:documentation>
>        A sample element
>      </xsd:documentation>
>    </xsd:annotation>
>    <xsd:complexType>
>      <xsd:sequence>
>        <xsd:group ref="RULE" maxOccurs="unbounded" minOccurs="0"/>
>      </xsd:sequence>
>    </xsd:complexType>
>  </xsd:element>
>  <xsd:group name="RULE">
>    <xsd:choice>
>      <xsd:element ref="Forall"/>
>    </xsd:choice>
>  </xsd:group>
>  <xsd:group name="CLAUSE">
>      <xsd:choice>
>        <xsd:element name="Implies">
>          <xsd:complexType>
>            <xsd:choice>
>              <xsd:sequence>
>                <xsd:element name="if">
>                <xsd:complexType>
>                  <xsd:group ref="CONDITION"/>
>                </xsd:complexType>
>              </xsd:element>
>                <xsd:element name="then">
>                <xsd:complexType>
>                  <xsd:group ref="ATOMIC"/>
>                </xsd:complexType>
>              </xsd:element>
>             </xsd:sequence>
>             <xsd:sequence>
>                <xsd:group ref="CONDITION"/>
>                <xsd:group ref="ATOMIC"/>
>             </xsd:sequence>
>          </xsd:choice>
>          </xsd:complexType>
>        </xsd:element>
>        <xsd:group ref="ATOMIC"/>
>      </xsd:choice>
>  </xsd:group>
>  <xsd:group name="ATOMIC">
>      <xsd:choice>
>        <xsd:element ref="Uniterm"/>
>        <xsd:element ref="Equal"/>
>      </xsd:choice>
>  </xsd:group>
>  <xsd:group name="TERM">
>       <xsd:choice>
>        <xsd:element ref="Const"/>
>        <xsd:element ref="Var"/>
>        <xsd:element ref="Uniterm"/>
>      </xsd:choice>
>  </xsd:group>
>  <xsd:group name="CONDITION">
>    <xsd:choice>
>      <xsd:element name="And" type="CONDITIONS"/>
>      <xsd:element name="Or" type="CONDITIONS"/>
>      <xsd:element ref="Exists"/>
>      <xsd:group ref="ATOMIC"/>
>    </xsd:choice>
>  </xsd:group>
>  <xsd:complexType name="CONDITIONS">
>    <xsd:sequence>
>      <xsd:group ref="CONDITION" maxOccurs="unbounded" minOccurs="0"/>
>    </xsd:sequence>
>  </xsd:complexType>
>  <xsd:element name="Forall">
>    <xsd:complexType>
>      <xsd:choice>
>        <xsd:sequence>
>          <xsd:element minOccurs="0" maxOccurs="unbounded" ref="declare"/>
>          <xsd:element name="formula">
>            <xsd:complexType>
>              <xsd:group ref="CLAUSE"/>
>            </xsd:complexType>
>          </xsd:element>
>        </xsd:sequence>
>        <xsd:sequence>
>          <xsd:element ref="Var" maxOccurs="unbounded" minOccurs="0"/>
>          <xsd:group ref="CLAUSE"/>
>        </xsd:sequence>
>      </xsd:choice>
>    </xsd:complexType>
>  </xsd:element>
>  <xsd:element name="declare">
>    <xsd:complexType>
>      <xsd:sequence>
>        <xsd:element ref="Var"/>
>      </xsd:sequence>
>    </xsd:complexType>
>  </xsd:element>
>  <xsd:element name="Exists">
>    <xsd:complexType>
>      <xsd:choice>
>        <xsd:sequence>
>          <xsd:element minOccurs="1" maxOccurs="unbounded"
>                       ref="declare"/>
>          <xsd:element name="formula">
>            <xsd:complexType>
>              <xsd:group ref="CONDITION"/>
>            </xsd:complexType>
>          </xsd:element>
>        </xsd:sequence>
>        <xsd:sequence>
>          <xsd:element ref="Var" maxOccurs="unbounded" minOccurs="1"/>
>          <xsd:group ref="CONDITION"/>
>        </xsd:sequence>
>      </xsd:choice>
>    </xsd:complexType>
>  </xsd:element>
>  <xsd:element name="Var">
>    <xsd:complexType>
>      <xsd:simpleContent>
>        <xsd:extension base="xsd:string">
>          <xsd:attribute name="uri"/>
>        </xsd:extension>
>      </xsd:simpleContent>
>    </xsd:complexType>
>  </xsd:element>
>  <xsd:element name="Const">
>    <xsd:complexType>
>      <xsd:simpleContent>
>        <xsd:extension base="xsd:string">
>          <xsd:attribute name="uri"/>
>        </xsd:extension>
>      </xsd:simpleContent>
>    </xsd:complexType>
>  </xsd:element>
>  <xsd:element name="Uniterm">
>    <xsd:complexType>
>      <xsd:sequence>
>        <xsd:element ref="Const"/>
>        <xsd:group ref="TERM" maxOccurs="unbounded" minOccurs="0"/>
>      </xsd:sequence>
>    </xsd:complexType>
>  </xsd:element>
>  <xsd:element name="Equal">
>    <xsd:complexType>
>      <xsd:sequence>
>        <xsd:group ref="TERM" maxOccurs="2" minOccurs="2"/>
>      </xsd:sequence>
>    </xsd:complexType>
>  </xsd:element>
></xsd:schema>
>  
>
>
> ------------------------------------------------------------------------
>
> Subject:
> RE: MISMO APOCRIF
> From:
> "Philippe Bonnard" <pbonnard@ilog.fr>
> Date:
> Fri, 4 May 2007 10:45:32 +0200
> To:
> "Gary Hallmark" <gary.hallmark@oracle.com>
>
> To:
> "Gary Hallmark" <gary.hallmark@oracle.com>
> CC:
> "Christian de Sainte Marie" <csma@ilog.fr>, "Boley, Harold" 
> <Harold.Boley@nrc-cnrc.gc.ca>
>
>
>Hi Hallmark,
>
>Actually, the POC (APOCRIF) presented Tuesday could be considered as an
>"hello world" ruleset test. Essentially, the proposed meta-model is
>closed to the RIF one. We introduce three main modifications in order to
>support the production rule needs. If we choose to use the current core
>specification and the XSD you sent, I'm afraid they will be some lacks
>to support the production rule "hello world" test. The extensions are
>listed and explained hereafter.
>
>1) rule and ruleset meta-model
>
>We add names in the rule and ruleset nodes. In fact, it should be
>supported later by RIF core since meta-properties of rules (ruleset?)
>must be introduced.
>
>
>2) Adding a constraint part for production rules
>
>As it is possible in the condition part to define a variable by an
>assignment, i.e. var ?x= a+1,  I found very convenient for coding the
>JRULES-RIF translator to declare the assignation apart from the standard
>condition where it might be declared by an "equal" atomic term. 
>With this constraint part, we are able to represent exactly 
>Var ?x = a+1
>and not
>(Var ?x ( equal (?x (a+1)) ) )
>
>
>3) Adding an insertion (modification) as a "then" instruction
>
>Since a production rule performs non-monotonic transformation of the
>engine working memory, we need a set of instructions to represent this
>modification (insert, update, retract). Hence, the meta-model has been
>extended to introduce the update instruction. In complement to those
>instructions, we introduce a 'set' operator to indicate which field of a
>complex type is modified.
>
>In fact, the schema you sent me is not refined enough to represent the
>"hello world" rules defined for MISMO POC. If we choose to use this
>schema without any modification, I will not be able to exchange my
>current simple rules.
>
>Regards. Philippe.
>
>
>
>-----Original Message-----
>From: Gary Hallmark [mailto:gary.hallmark@oracle.com] 
>Sent: Wednesday, May 02, 2007 11:33 PM
>To: Philippe Bonnard
>Cc: Christian de Sainte Marie; Boley, Harold
>Subject: Re: MISMO APOCRIF
>
>I should have been clearer. I was talking about a RIF POC, like sending 
>some simple "hello world" ruleset between multiple vendors using the 
>current core specification. I wonder if we could agree on a RIF.xsd. I 
>offer a simple one modeled directly on Harold Boley's DTD.
>
>Philippe Bonnard wrote:
>
>  
>
>>Hi Gary,
>>
>>You will find attached the final schema used in MISMO POC.
>>
>>The test rules are currently built upon the schema mismo.xsd applied 
>>for testing. The final rules used for the demonstration will be 
>>authored in few days.
>>
>>I would be glad to work with you about an experimentation of rule 
>>inter-operability with Oracle.
>>
>>You will find additional information here 
>>http://wiki.mismo.org/MISMOWiki/Wiki.jsp?page=ProofOfConcept, although
>>    
>>
>
>  
>
>>it may be better that we discuss on phone about the POC architecture. 
>>Furthermore, the source of the POC could be downloaded form this page.
>>    
>>
>
>  
>
>>Its name is apocrif1.0.zip. I don't attach it to that E-Mail because 
>>your mailing server seems to drop E-Mails with such an attachment.
>>
>>Regards. Philippe.
>>
>>
>>    
>>
>------------------------------------------------------------------------
>  
>
>>*From:* public-rif-wg-request@w3.org 
>>[mailto:public-rif-wg-request@w3.org] *On Behalf Of *Gary Hallmark
>>*Sent:* Friday, April 27, 2007 1:00 AM
>>*To:* Christian de Sainte Marie; RIF WG
>>*Subject:* [Suspected Spam]Re: [Admin] preparing to test demo sharing 
>>at telecon today
>>
>>Christian,
>>
>>If we had an XML schema defining RIF, I would build a POC for RIF and 
>>then we would have a really interesting POC -- interchange of rules 
>>between different members of the working group!
>>
>>Christian de Sainte Marie wrote:
>>
>>
>>All,
>>
>>During the telecon today, we will spend sometime testing the set-up 
>>for making a demo of a POC implementation of RIF (well, sort of RIF 
>>:-) at a later telecon. We will use Raindance, the system used at ILOG
>>    
>>
>
>  
>
>>for Web seminars.
>>
>>Since it would be burdensome to invite each potential attendees 
>>individually, we will ask you to install a Raindance client.
>>
>>You will have to go to our Raindance meetings Web site:
>>http://ilog.on.raindance.com
>>
>>There, if you are on Windows, ask for a pre-meeting install. I tried 
>>it, but it seems to offer only the "full-service" option, which is for
>>    
>>
>
>  
>
>>Windows plat-form, if I understood correctly.
>>
>>So, if it does not offer you the light option and you are not on 
>>Windows, try the "join an unscheduled meeting" option, and use our 
>>provisional meeting ID, which is 9250520, then follow the instructions
>>    
>>
>
>  
>
>>to install the right client.
>>
>>During the telecon, we will try having everybody joining, and see if 
>>you see Philippe's screen... or check who cannot and try to find out
>>    
>>
>why.
>  
>
>>Cheers,
>>
>>Christian
>>
>>-- 
>>
>>
>>Oracle <http://www.oracle.com>
>>Gary Hallmark | Architect | +1.503.525.8043
>>Oracle Server Technologies
>>1211 SW 5th Avenue, Suite 800
>>Portland, OR 97204
>>
>>    
>>
>
>  
>
>
> ------------------------------------------------------------------------
>
> Subject:
> Re: MISMO APOCRIF
> From:
> Gary Hallmark <gary.hallmark@oracle.com>
> Date:
> Fri, 04 May 2007 12:46:16 -0700
> To:
> Philippe Bonnard <pbonnard@ilog.fr>
>
> To:
> Philippe Bonnard <pbonnard@ilog.fr>
> CC:
> Christian de Sainte Marie <csma@ilog.fr>, "Boley, Harold" 
> <Harold.Boley@nrc-cnrc.gc.ca>
>
>
> No problem, Bonnard  ;-)
>
> Yes, I understand some of the difficulty of interchanging PR with the 
> CORE RIF in WD-1.  My .xsd file is what I believe to be the current 
> CORE (except for 2 typos which misname the "sort" attribute of Var and 
> Const as "uri".)
> However, there are many PRs we could interchange using only CORE.  The 
> rules can have only a single assert action, and this allows us to 
> treat the assert not as an action but rather as a conclusion.
> I think the most urgent things to allow a POC using RIF CORE are
> 1. agree on one xml schema document (in addition to an abstract syntax)
> 2. standardize some builtin functions like addition, less-than, etc.
>
> After RIF CORE, I would then like to use a PR Dialect of RIF to 
> exchange more production rules including the ones you mention.  The 
> problem, of course, is the semantics.  My modify / retract may have 
> subtle differences from yours.
>
> Philippe Bonnard wrote:
>
>> I apologize, Gary, for naming you by your last name in my last 
>> E-Mail. I don't remember the actual sequence of typing-copy-paste 
>> leading to
>> that, but it was not intentional!
>>
>> Regards. Philippe.
>>
>>
>>
>>
>> -----Original Message-----
>> From: Philippe Bonnard Sent: Friday, May 04, 2007 10:46 AM
>> To: 'Gary Hallmark'
>> Cc: Christian de Sainte Marie; Boley, Harold
>> Subject: RE: MISMO APOCRIF
>>
>> Hi Hallmark,
>>
>> Actually, the POC (APOCRIF) presented Tuesday could be considered as an
>> "hello world" ruleset test. Essentially, the proposed meta-model is
>> closed to the RIF one. We introduce three main modifications in order to
>> support the production rule needs. If we choose to use the current core
>> specification and the XSD you sent, I'm afraid they will be some lacks
>> to support the production rule "hello world" test. The extensions are
>> listed and explained hereafter.
>>
>> 1) rule and ruleset meta-model
>>
>> We add names in the rule and ruleset nodes. In fact, it should be
>> supported later by RIF core since meta-properties of rules (ruleset?)
>> must be introduced.
>>
>>
>> 2) Adding a constraint part for production rules
>>
>> As it is possible in the condition part to define a variable by an
>> assignment, i.e. var ?x= a+1,  I found very convenient for coding the
>> JRULES-RIF translator to declare the assignation apart from the standard
>> condition where it might be declared by an "equal" atomic term. With 
>> this constraint part, we are able to represent exactly Var ?x = a+1
>> and not
>> (Var ?x ( equal (?x (a+1)) ) )
>>
>>
>> 3) Adding an insertion (modification) as a "then" instruction
>>
>> Since a production rule performs non-monotonic transformation of the
>> engine working memory, we need a set of instructions to represent this
>> modification (insert, update, retract). Hence, the meta-model has been
>> extended to introduce the update instruction. In complement to those
>> instructions, we introduce a 'set' operator to indicate which field of a
>> complex type is modified.
>>
>> In fact, the schema you sent me is not refined enough to represent the
>> "hello world" rules defined for MISMO POC. If we choose to use this
>> schema without any modification, I will not be able to exchange my
>> current simple rules.
>>
>> Regards. Philippe.
>>
>>
>>
>> -----Original Message-----
>> From: Gary Hallmark [mailto:gary.hallmark@oracle.com] Sent: 
>> Wednesday, May 02, 2007 11:33 PM
>> To: Philippe Bonnard
>> Cc: Christian de Sainte Marie; Boley, Harold
>> Subject: Re: MISMO APOCRIF
>>
>> I should have been clearer. I was talking about a RIF POC, like 
>> sending some simple "hello world" ruleset between multiple vendors 
>> using the current core specification. I wonder if we could agree on a 
>> RIF.xsd. I offer a simple one modeled directly on Harold Boley's DTD.
>>
>> Philippe Bonnard wrote:
>>
>>  
>>
>>> Hi Gary,
>>>
>>> You will find attached the final schema used in MISMO POC.
>>>
>>> The test rules are currently built upon the schema mismo.xsd applied 
>>> for testing. The final rules used for the demonstration will be 
>>> authored in few days.
>>>
>>> I would be glad to work with you about an experimentation of rule 
>>> inter-operability with Oracle.
>>>
>>> You will find additional information here 
>>> http://wiki.mismo.org/MISMOWiki/Wiki.jsp?page=ProofOfConcept, although
>>>   
>>
>>
>>  
>>
>>> it may be better that we discuss on phone about the POC 
>>> architecture. Furthermore, the source of the POC could be downloaded 
>>> form this page.
>>>   
>>
>>
>>  
>>
>>> Its name is apocrif1.0.zip. I don't attach it to that E-Mail because 
>>> your mailing server seems to drop E-Mails with such an attachment.
>>>
>>> Regards. Philippe.
>>>
>>>
>>>   
>>
>> ------------------------------------------------------------------------
>>  
>>
>>> *From:* public-rif-wg-request@w3.org 
>>> [mailto:public-rif-wg-request@w3.org] *On Behalf Of *Gary Hallmark
>>> *Sent:* Friday, April 27, 2007 1:00 AM
>>> *To:* Christian de Sainte Marie; RIF WG
>>> *Subject:* [Suspected Spam]Re: [Admin] preparing to test demo 
>>> sharing at telecon today
>>>
>>> Christian,
>>>
>>> If we had an XML schema defining RIF, I would build a POC for RIF 
>>> and then we would have a really interesting POC -- interchange of 
>>> rules between different members of the working group!
>>>
>>> Christian de Sainte Marie wrote:
>>>
>>>
>>> All,
>>>
>>> During the telecon today, we will spend sometime testing the set-up 
>>> for making a demo of a POC implementation of RIF (well, sort of RIF 
>>> :-) at a later telecon. We will use Raindance, the system used at ILOG
>>>   
>>
>>
>>  
>>
>>> for Web seminars.
>>>
>>> Since it would be burdensome to invite each potential attendees 
>>> individually, we will ask you to install a Raindance client.
>>>
>>> You will have to go to our Raindance meetings Web site:
>>> http://ilog.on.raindance.com
>>>
>>> There, if you are on Windows, ask for a pre-meeting install. I tried 
>>> it, but it seems to offer only the "full-service" option, which is for
>>>   
>>
>>
>>  
>>
>>> Windows plat-form, if I understood correctly.
>>>
>>> So, if it does not offer you the light option and you are not on 
>>> Windows, try the "join an unscheduled meeting" option, and use our 
>>> provisional meeting ID, which is 9250520, then follow the instructions
>>>   
>>
>>
>>  
>>
>>> to install the right client.
>>>
>>> During the telecon, we will try having everybody joining, and see if 
>>> you see Philippe's screen... or check who cannot and try to find out
>>>   
>>
>> why.
>>  
>>
>>> Cheers,
>>>
>>> Christian
>>>
>>> -- 
>>>
>>>
>>> Oracle <http://www.oracle.com>
>>> Gary Hallmark | Architect | +1.503.525.8043
>>> Oracle Server Technologies
>>> 1211 SW 5th Avenue, Suite 800
>>> Portland, OR 97204
>>>
>>>   
>>
>>
>>  
>>
>

-- 


Oracle <http://www.oracle.com>
Gary Hallmark | Architect | +1.503.525.8043
Oracle Server Technologies
1211 SW 5th Avenue, Suite 800
Portland, OR 97204

Received on Thursday, 10 May 2007 16:20:11 UTC