W3C home > Mailing lists > Public > public-ws-semann@w3.org > June 2006

Re: why distinguish between simple and complex types? (issue 11)

From: Jacek Kopecky <jacek.kopecky@deri.org>
Date: Tue, 06 Jun 2006 15:05:09 +0200
To: Rama Akkiraju <akkiraju@us.ibm.com>
Cc: kunal.verma1@gmail.com, SAWSDL public list <public-ws-semann@w3.org>, verma@cs.uga.edu
Message-Id: <1149599109.18792.18.camel@localhost>

Hi Rama,

in addition to your example below, there is also an example with unit
conversion:

<element name="temp" type="xs:decimal"/>

If the ontology has a property "hasTemperature", the modelReference from
the element would go to that property. However, if the schema uses
fahrenheit and the ontology uses centigrade, while the meaning of the
element temp is indeed the same as hasTemperature, the actual value
needs to be mapped using the appropriate conversion function. In this
case the result could be:

<element name="temp" type="xs:decimal"
   sawsdl:modelReference="ontology#hasTemperature"
   sawsdl:schemaMapping="temperatureMapping.xsl"/>

Since we cannot easily say anything about the values for complex types,
we should also eschew talking about the values of simple types (in this
case that the actual number that's in the element would be the number
that would be the value of hasTemperature) and leave all such mappings
(even trivial) to the schemaMapping construct.

Hope it helps,

Jacek

On Mon, 2006-06-05 at 18:46 -0400, Rama Akkiraju wrote:
> Well, may be we don't need to distinguish simple and complex types after
> all. I sent that previous note too soon. :-). Here is a counter example
> where a simple type may also need a schema mapping (not necessarily for
> discovery but to support invocation)
> 
> 
> <element name="fullName" type=xsd:string />
> 
> Say that in the ontology, there is a class called 'FullName' with two
> subparts 'FirstName' and 'LastName'. Then this simple type can be annotated
> in mulitple ways.
> 
> <element name="fullName" type=xsd:string
> sawsdl:modelReference="ontology#FullName" />
> 
> or
> 
> <element name="fullName" type=xsd:string
> sawsdl:modelReference="ontology#FullName"
> sawsdl:modelReference="ontology#FirstName"
> sawsdl:modelReference="ontology#LastName"/>
> 
> Both these above options are useful in discovery but may not be useful in
> invocation if the service interface to be matched with has elements
> 'firstName' and 'lastName')
> 
> or
> 
> <element name="fullName" type=xsd:string
> sawsdl:modelReference="ontology#FullName"
> sawsdl:modelReference="ontology#FirstName"
> sawsdl:modelReference="ontology#LastName"
> sawsdl:schemaMapping="URI#FullNameTokenizationLogicToMapToFirstNameAndLastName"/>
> 
> This one has all the modelReferences that could aid in discovery and also
> has a string tokenization transformation function that provides explicit
> mappings to first name and last name.
> 
> Regards
> Rama Akkiraju
> 
> Rama Akkiraju/Watson/IBM wrote on 06/05/2006 05:59:03 PM:
> 
> > Kunal,
> >
> > Were you referring to precedence issues on these two examples?
> > because if so, these examples don't really present such issue. In
> > example 1, complex type annotaton doesn't really say anything about
> > what annotations apply to leaf node elements. So, there is no conflict.
> >
> > I think when you mention conflicts you are talking about in the
> > context where a schema mapping is specified at a complex type in
> > addition to model references on the contained elements. If so, if I
> > understand you correctly you are making two independent points in
> > this e-mail. Is that correct?
> >
> > So, here is a summary of  why we need to distinguish between simple
> > and complex types based on all the discussions.
> >
> > a simple type can only have model references and no schema mappings
> > where as a complex type can have both model references and schema
> > mappings. These schema mappings specified at a complex type can have
> > an implication on the model references of simple types contained in
> > a complex type. That's why we need to differentiate simple and complex
> types.
> >
> > Regards
> > Rama Akkiraju
> >
> 
> > kunal.verma1@gmail.com wrote on 06/05/2006 05:25:13 PM:
> >
> > > Jacek,
> > >
> > > From our point of view, it would be nice to be able to annotate
> > > complexTypes, elements and simpleTypes. Jacek's example illustrates
> > > the first two (note, we changed the outer element to complexType).
> > > The second example illustrates the use of a simpleType.
> > >
> > > Example 1:
> > >
> > > <complexType name="Name" sawsdl:modelReference="ontology#name">
> > >    <sequence>
> > >       <element name="Title" sawsdl:modelReference="ontology#title"/>
> > >       <element name="First"
> sawsdl:modelReference="ontology#firstName"/>
> > >       <element name="Last"
> sawsdl:modelReference="ontology#familyName"/>
> > >    </sequence>
> > > </complexType>
> > >
> > > Example 2:
> > >
> > > <xs:simpleType name="fahrenheitWaterTemp"
> > >    sawsdl:modelReference="ontology#FahrenheitWaterTemperature">
> > >    <xs:restriction base="xs:number">
> > >       <xs:fractionDigits value="2"/>
> > >       <xs:minExclusive value="0.00"/>
> > >       <xs:maxExclusive value="100.00"/>
> > >    </xs:restriction>
> > > </xs:simpleType>
> > >
> > > Finally, allowing annotations for both elements and complexTypes
> > > begs the question of which takes precedence when used together. As
> > > pointed out by Laurent in http://lists.w3.org/Archives/P
> > > ublic/public-ws-semann/2006May/ 0043, the approach of giving the
> > > element annotation precedence over the type annotation seems like
> > > the way to go.
> > >
> > > "If some internal annotation exists for a complex type as well, any
> > > "where used" annotation takes precedence over the internal one."
> > >
> > >
> > > Thanks,
> > > John Miller and Kunal Verma
> > >
> > >
> > > On 6/5/06, Jacek Kopecky <jacek.kopecky@deri.org > wrote:
> > > >
> > > > Hi all,
> > > >
> > > > below is an excerpt from Rama's analysis of the relation of
> > > > modelReference and schemaMapping. The quoted part restricts
> > > > modelReferences to be allowed only on schema leaf elements.
> > > >
> > > > On Sun, 2006-06-04 at 13:40 -0400, Rama Akkiraju wrote:
> > > > > Definition of Simple modelReference:
> > > > > ModelReferences that point to a single concept in the ontology via
> > > > > one-to-one association. Simple modelReferences are specified
> > at the level
> > > > > of individual (leaf) elements in an XSD.
> > > >
> > > > Rama, I wonder why you have the restriction?
> > > >
> > > > Using the common structured name example, one could have something
> like
> > > > this:
> > > >
> > > > <element name="Name" sawsdl:modelReference="ontology#name">
> > > >   <sequence>
> > > >     <element name="Title" sawsdl:modelReference="ontology#title"/>
> > > >     <element name="First"
> sawsdl:modelReference="ontology#firstName"/>
> > > >     <element name="Last"
> sawsdl:modelReference="ontology#familyName"/>
> > > >   </sequence>
> > > > </element>
> > > >
> > > > Basically, there is a trivial one-to-one correspondence between the
> > > > element Name and the ontology class "name". Do you think that
> expressing
> > > > this correspondence with modelReference may be harmful?
> > > >
> > > > Best regards,
> > > >
> > > > Jacek
> > > >
> > > >
> > > >
> > >
> 
> 
Received on Tuesday, 6 June 2006 13:32:00 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:58:45 UTC