Re: GUIDE: Syntax query re parseType=

From: "Smith, Michael K" <michael.smith@eds.com>
Subject: GUIDE: Syntax query re parseType=
Date: Thu, 29 Aug 2002 09:25:04 -0500

> 
> Help.  I'm trying to explain some syntax in the Guide document.
> 
> Why do we have rdfs:parseType tacked onto the various set operators?
> Obviously, we inherited it from DAML+OIL, but I don't understand the need
> for it there, either.
> 
> As far as I can tell, it is completely redundant in the XML syntax.  That
> is, there is no other possible interpretion of the children of oneOf,
> unionOf, and intersectionOf.
> 
> What am I missing?
> 
> - Mike

The reason for rdf:parseType="daml:collection" is to allow for a convenient
way of supplying lists.  The problem is that a construct like

	<daml:oneOf rdf:id="MySet">
	  <rdf:li> <Person rdf:id="John" /> </rdf:li>
	  <rdf:li> <Person rdf:id="Bill" /> </rdf:li>
	</daml:oneOf>

is not closed.  Anyone can do something like

	<daml:oneOf rdf:id="peter:MySet">
	  <rdf:li> <Person rdf:id="Susan" /> </rdf:li>
	</daml:oneOf>

to add another element of the set.

There are very bad consequences of a construct like this.

To get around this inadequacy of RDF, DAML+OIL has a list construct and

	<daml:oneOf rdf:parseType="daml:collection">
		<Person rdf:id="John" />
		<Person rdf:id="Bill" />
	</daml:oneOf>
which expands to

	<daml:oneOf>
		<daml:List>
			<daml:first>
				<Person rdf:id="John" />
			</daml:first>
			<daml:rest>
				<daml:List>
					<daml:first>
						<Person rdf:id="Bill" />
					</daml:first>
					<daml:rest>
						<daml:list rdf:id="daml:nil">
					</daml:rest>
				</daml:List>
			</daml:rest>
		</daml:List>
	</daml:oneOf>

and cannot be non-monotonically messed with.

(I may have some of the details wrong, but you should be able to get the
idea.)

peter

Received on Thursday, 29 August 2002 10:37:16 UTC