This note provides documentation for the property listOfInstancesOf,
which is defined in Process.daml, and also describes some unresolved issues
about its use.
The range is a list of classes.
This property is defined similarly to DAML+OIL properties
having List
as range, such as daml:oneOf and daml:intersectionOf,
and is meant
to be used similarly, with parseType=collection.
"Class listOfInstancesOf X Y Z" (for example) is
used to indicate the class
of lists having an instance of class X as their
first member, an instance
of class Y as their second member, and an instance
of class Z as their
third member.
An instance of listOfInstancesOf represents an anonymous
class, as
explained here:
http://www.daml.org/services/daml-s/0.7/listOfInstancesOf.html.
Note that listOfInstancesOf is provided as "syntactic
sugar"; that is,
it isn't required to express the intended anonymous
class definition.
It is provided to allow for shorter, more readable
expressions in process
definitions.
We emphasize here that listOfInstancesOf isn't required in any process definition. That is, one can always give the longer form, expressed purely using DAML+OIL restrictions and list constructs, as explained below.
listOfInstancesOf is a valid DAML+OIL property, and an instance of it,
expressed with parseType=collection, will be parsed by any DAML+OIL parser.
However, there is some concern, due to the documentation of parseType=collection
in the DAML+OIL reference manual, that DAML+OIL parsers and tools are not
clearly guaranteed to maintain the order of the elements expressed in this
way. See Unresolved Issues, below, for additional
information on these points.
(A)
<daml:Class> <daml:listOfInstancesOf rdf:parseType="daml:collection"> <daml:Class rdf:about="#LocateBook"/> <daml:Class rdf:about="#CongoBuyBook"/> </daml:listOfInstancesOf> </daml:Class>A DAML+OIL parser would expand the listOfInstancesOf construct above, into the following, as mandated by the spec of DAML+OIL:
(B)
<daml:Class> <daml:listOfInstancesOf> <daml:List> <daml:first rdf:resource="#LocateBook"/> <daml:rest> <daml:List> <daml:first rdf:resource="#CongoBuyBook"/> <daml:rest rdf:resource="http://www.daml.org/2001/03/daml+oil#nil"/> </daml:List> </daml:rest> </daml:List> </daml:listOfInstancesOf> </daml:Class>
Any tool or component that processes DAML-S is required to further "expand" the above into the following:(C)
<daml:Class> <rdfs:subClassOf> <daml:Restriction> <daml:onProperty rdf:resource="&daml;#first"/> <daml:toClass rdf:resource="#LocateBook"/> </daml:Restriction> </rdfs:subClassOf> <rdfs:subClassOf> <daml:Restriction> <daml:onProperty rdf:resource="&daml;#rest"/> <daml:toClass> <daml:Class> <rdfs:subClassOf> <daml:Restriction> <daml:onProperty rdf:resource="&daml:#first"/> <daml:toClass rdf:resource="#CongoBuyBook"/> </daml:Restriction> </rdfs:subClassOf> <rdfs:subClassOf> <daml:Restriction> <daml:onProperty rdf:resource="&daml;rest"/> <daml:hasValue rdf:resource="&daml;nil"/> </daml:Restriction> </rdfs:subClassOf> </daml:Class> </daml:toClass> </daml:Restriction> </rdfs:subClassOf> </daml:Class>
Can I feel confident that a DAML+OIL-compliant parser or tool will maintain the order of elements given inside a parseType=collection construct, when it's used in specifying an instance of a user-defined property?
Because of the way parseType=collection is described in the DAML+OIL reference document, we do not feel that one can give a clear-cut affirmative answer to the above. (However, some members of the DAML-S coalition feel that one can answer "yes, for all practical purposes".)
Some discussion of this issue can be found on the www-rdf-logic mailing list archives, starting with this message:
http://lists.w3.org/Archives/Public/www-rdf-logic/2002Sep/0016.html
There is an ongoing discussion on the question of whether this particular expansion represents a reasonable requirement on a tool or component that processes DAML-S code (that is, the expansion that results in (C), above, from (B)).