- From: Boley, Harold <Harold.Boley@nrc-cnrc.gc.ca>
- Date: Mon, 28 May 2007 17:53:19 -0400
- To: "Gary Hallmark" <gary.hallmark@oracle.com>, <public-rif-wg@w3.org>
Gary wrote just now: I haven't received many comments on my proposed simple rules to derive an XML schema.from the ASN06, the resulting schema, or the resulting instance document. (Harold, you may want to post the comments you sent to the group) . . . Fine, see our stripe-skipping discussion below, Harold Gary had written to me: >I'm now coming back to the RIF XML syntax, was glad to see your >http://lists.w3.org/Archives/Public/public-rif-wg/2007May/0024.html, >and wonder if we could also talk about your recent stripe-skipping >work (e.g., could you confine it to 'role'-stripe-skipping? > Why do you prefer to skip the role rather than the type tags? I think you can do either with schema, but skipping the role seems to make the xml more "vague" and only works if the role isn't needed for disambiguation. E.g. the ASN06 class Person property mother : Person property father: Person I propose to make Person a complexType: complexType name="Person" sequence element name="name" type="xsd:string" element name="mother" type="Person" minOccurs="0" element name="father" type="Person" minOccurs="0" element name="Person" type="Person" // need this for document root This skips the "type stripe": <Person> <name>Gary</name> <mother><name>Dorothy</name></mother> <father><name>Henry</name></father> <Person> A different proposal would be to make Person a global element and use element refs for properties: element name="Person" sequence element name="name" type="xsd:string" element ref="Person" minOccurs="0" maxOccurs="2" The latter would skip the role stripes, but it loses information -- which person is the mother and which is the father?: <Person> <name>Gary</name> <Person><name>Dorothy</name></Person> <Person><name>Henry</name></Person> <Person> I think the advantage of using complexType is that it works without loss and is easy to describe. I had responded to Gary: You are right, role skipping loses information; this can partly be reconstructed by positional information (e.g., the mother in Ith position, the father in (I+1)st position), and partly by signature information (e.g., that the role names of fillers in the Ith and (I+1)st positions are 'mother' and 'father', respectively). Some of the stripe-modeling issues can be visualized graph-theoretically: http://www.dfki.uni-kl.de/~boley/xmlrdf.html The XSD notion of complex type is slightly different from what I meant in the distinction of role and type stripes/tags. With such a differentiation of complex type Person and type tag Human, your instance <Person> <name>Gary</name> <Person><name>Dorothy</name></Person> <Person><name>Henry</name></Person> <Person> could be written as <Person> <oid><Const iri="Gary"/></oid> <Human>Dorothy</Human> <Human>Henry</Human> <Person> I know, in this example we lose the recursive structure. It is still relevant to explain my (simpler) skipping notion: >From this role-skipped positional <Person> <oid><Const iri="Gary"/></oid> <Human>Dorothy</Human> <Human>Henry</Human> <Person> we can reconstruct the roles, as in <Person> <oid><Const iri="Gary"/></oid> <mother><Human>Dorothy</Human></mother> <father><Human>Henry</Human></father> <Person> if we remember positions 2 and 3 hold the mother and father roles, respectively. On the other hand, if we omitted a type like <Human>, as in <Person> <oid><Const iri="Gary"/></oid> <mother>Dorothy</mother> <father>Henry</father> <Person> we could only reconstruct it based on global declarations. Without those, the type could have been more specific: <Person> <oid><Const iri="Gary"/></oid> <mother><Woman>Dorothy</Woman></mother> <father><Man>Henry</Man></father> <Person> or more general: <Person> <oid><Const iri="Gary"/></oid> <mother><Being>Dorothy</Being></mother> <father><Being>Henry</Being></father> <Person> Especially if we were to allow for local/polymorphic roles, a role name would not uniquely reconstruct its filler type. (Of course, a type name even less uniquely reconstructs its role name, but there is the positional information.) Gary had then responded to me: Why skip the role stripe when it loses information? The "type skipping" that occurs when you use complexType loses nothing, really, because the type information is still recoverable from the PSVI. I think you can even use xpath2.0 as follows to ask for my parents using the "skipped" Person stripe: /Person[@name="Gary"]/*[. instance of element of type Person]
Received on Monday, 28 May 2007 21:53:32 UTC