RE: GUIDE: Syntax query re parseType=

On Thu, 2002-08-29 at 13:18, Smith, Michael K wrote:
> 
> Ok.  I find the choice of keyword bizarre.  Mixing syntax
> and semantics in an odd way. 
> 
> So the difference between
> 
> 	<daml:oneOf rdf:parseType="daml:collection">
> 	  <rdf:li> <Person rdf:id="John" /> </rdf:li>
> 	  <rdf:li> <Person rdf:id="Bill" /> </rdf:li>
> 	</daml:oneOf>
> and
> 	<daml:oneOf>
> 	  <rdf:li> <Person rdf:id="John" /> </rdf:li>
> 	  <rdf:li> <Person rdf:id="Bill" /> </rdf:li>
> 	</daml:oneOf>
> 
> is that I can prove that the first one has exactly 2 elements?

nit: At most 2; the two expressions could denote the same thing.

> While I can't extend the second one (since I can't reference it), the
> semantics don't require that it be closed.  

It might help to understand if you look at the corresponding
formulas in a more familiar syntax.

Hmm... I don't think the above syntax is what you meant even in RDF/XML.
I think it'll be more clear if we make the subject of these
statements explicit.

The first one should, I presume, look like:

      <rdfs:Class rdf:ID="someFolks">
 	<daml:oneOf rdf:parseType="daml:collection">
 	  <Person rdf:id="John" />
 	  <Person rdf:id="Bill" />
 	</daml:oneOf>
      </rdfs:Class>

which, in, say, ACL2, looks like:

  (exists (?x ?y)
    (and
      (PropertyValue daml:oneOf someFolks ?x)
      (PropertyValue first ?x John)
      (PropertyValue rest ?x ?y)
      (PropertyValue first ?y Bill)
      (PropertyValue rest ?y nil)
    ) )

which is pretty much just:
      (PropertyValue daml:oneOf someFolks (list John Bill))

[oops... ACL2 doesn't have quantifiers, does it?
oh well, I think you get the idea.]

If you've got a language like newer KIF dialects or CycL
or HiLog, you can skip the PropertyValue gizmo and just write
  (daml:oneOf someFolks (list John Bill))

and I think CycL even allows functional relations to be
used like function symbols:
	(= someFolks (daml:oneOf (list John Bill)))


The point here is that daml:oneOf is just a property name.
The RDF parser doesn't treat it as special syntax; it
doesn't change parsing modes for the contents of the
oneOf element; the parseType="collection" is what tells
it to change parsing modes and make a list.

Now the other one, I presume, should look like this:

      <rdfs:Class rdf:ID="someFolks">
 	<daml:oneOf rdf:parseType="Resource">
 	  <rdf:li> <Person rdf:id="John" /> </rdf:li>
 	  <rdf:li> <Person rdf:id="Bill" /> </rdf:li>
 	</daml:oneOf>
      </rdfs>

which, according to the RDF/XML syntax, represents
a formula pretty much like this:

  (exists (?x)
    (and
      (PropertyValue daml:oneOf someFolks ?x)
      (PropertyValue rdf:_1 ?x John)
      (PropertyValue rdf:type John Person)
      (PropertyValue rdf:_2 ?x Bill)
      (PropertyValue rdf:type Bill Person)
    ) )

or, more colloquially:

  (= someFolks (daml:oneOf ?x))
  (first ?x John)
  (second ?x Bill)

At this point, I hope it's clear how the parseType="collection"
construct closes the list but the <li> construct doesn't.


-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/

Received on Friday, 30 August 2002 11:51:30 UTC