Re: Datamodel Strawman (ACTION-298)

Gary,

Gary Hallmark wrote:

> The statement for this action reads "Show how to use XML Schema for App 
> Data Model".
> This begs the question: what is an "App Data Model"?  I believe that we 
> must define such a thing in RIF, and only then can we define a mapping 
> between XML Schema (or relational databases, or OWL, or RDFS, etc.) and 
> this RIF Data Model (RDM).

During F2F6, in Innsbruck, there seemed to be broad agreement that RIF 
should not invent its own data model/schema language, as Dave and Paul 
point out.

The action to "show how to use an XML schema for ADM" was seen as 
necessary because it was felt that, although several participants 
(including myself) contented that being able to use a data model 
specified in an XML Schema (or DTD) was a requirement, nobody seemed to 
have a precise idea of what it meant.

As I understand it, there are basically two places where we may need the 
reference to an external, or application data model:

1. when specifying the type of a variable beyond the builtin types (and 
of a slot if we decide that RIF should allow type checking);

2. when navigating a data source, that is, to specify data accessors.

As regards case 1, I suppose that a QName is all we need (in addition to 
  the metadata that will tell us what this ruleset requires, e.g. a data 
model represented by an XML schema, the URI of that schema etc).

As regards case 2, as I understand it, it is the 'op' property of an 
UNITERM that specifies the path to the data to be accessed, where the 
'args' give the context.

E.g., suppose that the data model is specified by the XML Schema in [1], 
and that there is a rule that says (informally) (taken from the MISMO 
POC [2]:

Forall ?R: Root()
If ?R.division="wholesale" and ?R.occupancy="Investors"
Then r.occupancyAdjustment = 0.95d

The RIF XML could be (probably not compliant with Sandro's proposed 
rules, but that is not the purpose):

<Ruleset xmlns:mismo="(the URL in [1]">
...
   <Rule>
      <Forall>
         <declare>
            <Var>
               <name>?R</name>
               <type>mismo:root</type>
            </Var>
         </declare>
      <if>
         <And>
            <Equal>
               <side>
                  (*) Here we would like something like an XPath expr 
selecting the "division" element where the value of ?R is the context
               </side>
               <side>"wholesale"</side>
  ...

(*) E.g. <Uniterm><op>mismo:division</op><arg>?R</arg></Uniterm>, where 
the arg could itself be another uniterm if we needed to navigate deeper; 
or a single 'op' could be a complete XPath expression; etc. The slotted 
syntax may be more appropriate for that case, btw.

The question is: if there is a standard way, associated to the data 
model, to navigate the source - e.g. XPath if the data model is an DTD 
or XML Schema,etc -, should that be the syntax for accessors (and thus 
the syntax for accessor 'op's or slots may vary depending on the data 
model? Or does RIF need to define a RIF "data source navigation 
language" that works for, e.g., XML-S, RDF-S OWL, etc?

Christian

[1] 
http://anonsvn.labs.jboss.com/labs/jbossrules/contrib/apocrif/jrules/src/test/resources/xsd/mismo.xsd
[2] 
http://anonsvn.labs.jboss.com/labs/jbossrules/contrib/apocrif/jrules/src/test/resources/irl/mismo2.irl

Received on Tuesday, 17 July 2007 13:27:10 UTC