Re: Comment on rdf:parseType="Collection"

At 8:46 +0000 2/20/03, Dave Beckett wrote:
>Brian: please accept this as a last call issue for RDF Core on the
>RDF/XML Syntax specification 2002-01-23

apologies - I should have made that clear.  I also appreciate your 
fixing the errors in my example, I'm still not 100% up to speed on 
the details of the new RDF Core renderings

>
>>>>Jim Hendler said:
>>
>>  The RDF Core Working Group documents (particularly [1]) reflect a
>>  decision that rdf:parsetype="collection" must be a list if RDF node
>>  elements.  I believe the RDF Core WG is making a mistake by
>>  prohibiting this from being a list of literals, and to the best of my
>>  ability to deduce, there is no technical reason why a list of
>>  literals could not be supported.
>
>I'll demonstrate the technical issues with your example, below.
>
>
>>
>>  This decision has terrible ramifications for languages built on top
>>  of RDF (like OWL) which thus must use extremely ugly constructs for
>>  lists of literals (in fact, constructing the entire list using List,
>>  first, and rest).  For example, a natural thing to express in OWL (or
>>  RDFS for that matter) might be that the list of permissible scores in
>>  a game of tennis are 0, 15, 30, and 40.  However, instead of the
>>  construct
>>
>>  <owl:oneOf rdf:parsetype="collection">
>>    <score rdf:datatype="xsd:integer">0</score>
>>    <score rdf:datatype="xsd:integer">15</score>
>>    <score rdf:datatype="xsd:integer">30</score>
>>    <score rdf:datatype="xsd:integer">40</score>
>>  </owl:oneOf>
>>
>>  we must instead
>
>(minor error rdf:parseType="Collection")
>
>I'll complete your example to make it a full rdf/xml document,
>such that it could be sent to the W3C's RDF Validator, although it
>won't work since it doesn't support rdf:datatype at this date.
>
>(Aside, you are using qnames inside the rdf:datatype which is a minor
>error, I'm also correcting with entities).
>
>
>----------------------------------------------------------------------
><?xml version="1.0"?>
><!DOCTYPE rdf:RDF [
>   <!ENTITY xsd 'http://www.w3.org/2000/10/XMLSchema#'>
>   <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
>]>
><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>          xmlns:owl="http://www.w3.org/2002/07/owl#">
>
>    <rdf:Description rdf:about="http://example.org/">
>         <owl:oneOf>
>           <rdf:List>
>              <rdf:first rdf:datatype="&xsd;integer">0</rdf:first>
>              <rdf:rest>
>                <rdf:List>
>                  <rdf:first rdf:datatype="&xsd;integer">15</rdf:first>
>                  <rdf:rest>
>                    <rdf:List>
>                      <rdf:first rdf:datatype="&xsd;integer">30</rdf:first>
>                      <rdf:rest>
>                        <rdf:List>
>                          <rdf:first rdf:datatype="&xsd;integer">40</rdf:first>
>                          <rdf:rest rdf:resource="&rdf;nil" />
>                        </rdf:List>
>                      </rdf:rest>
>                    </rdf:List>
>                 </rdf:rest>
>               </rdf:List>
>             </rdf:rest>
>           </rdf:List>
>         </owl:oneOf>
>   </rdf:Description>
></rdf:RDF>
>----------------------------------------------------------------------
>
>So these potentially are the triples that OWL wants to use
>(made from my Rapper parser):
>
>_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
><http://www.w3.org/1999/02/22-rdf-syntax-ns#List> .
>_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> 
>"0"^^<http://www.w3.org/2000/10/XMLSchema#integer> .
>_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
><http://www.w3.org/1999/02/22-rdf-syntax-ns#List> .
>_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> 
>"15"^^<http://www.w3.org/2000/10/XMLSchema#integer> .
>_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
><http://www.w3.org/1999/02/22-rdf-syntax-ns#List> .
>_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> 
>"30"^^<http://www.w3.org/2000/10/XMLSchema#integer> .
>_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
><http://www.w3.org/1999/02/22-rdf-syntax-ns#List> .
>_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#first> 
>"40"^^<http://www.w3.org/2000/10/XMLSchema#integer> .
>_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> 
><http://www.w3.org/1999/02/22-rdf-syntax-ns#nil> .
>_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid4 .
>_:genid2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid3 .
>_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#rest> _:genid2 .
><http://example.org/> <http://www.w3.org/2002/07/owl#oneOf> _:genid1 .
>
>and this is thus the RDF you want out of it.
>
>Your suggestion:
>
>  <owl:oneOf rdf:parseType="Collection">
>    <score rdf:datatype="xsd:integer">0</score>
>    <score rdf:datatype="xsd:integer">15</score>
>    <score rdf:datatype="xsd:integer">30</score>
>    <score rdf:datatype="xsd:integer">40</score>
>  </owl:oneOf>
>
>doesn't seem to relate to the triples or the expanded RDF/XML at all.
>The 'score' item appears nowhere in the N-Triples.  Is this a crucial
>point?

The score item is there to provide for the striping required -- the 
DAML/OWL syntax for a oneOf requires that each element include an 
rdf:type, I invented "score" to make it easier.  It could also read

...
   <owl:thing rdf:datatype="&xsd:integer">30</owl:thing>
...

and the triples to be generated would be similar to the ones above.

>
>The historical background to rdf:parseType="Collection" is that it
>was designed to copy how DAML lists work
>(rdf:parseType="daml:Collection") and this list of literals short cut
>was never in that design, which was presented only in the form of an
>example.  DAML lists only ever used resource nodes (URIs) as the list
>contents so that limitation was carried forward.  We extended it to
>include bnodes since the contained node element.

yes, as you mention the DAML lists were underspecified -- however, in 
a number of DAML documents people did indeed create these collections 
of literals, and the Web Ont WG believes this is important to support.

>
>So it would be a new requirement to have literals objects of the
>rdf:first property which has not, to my knowledge, previously been
>asked of the RDF Core working group.

I don't know if it was specifically asked, but the archives of the 
RDF Core WG have numerous threads whcih discuss literals in the 
context of collection [1] and in the discussion leading up to your 
resolution on the issue of the syntax and semantics of rdf:collection 
[2]

That said, the problem with the design from the point of view of 
creating lists of datatype elements is one I realized lately, and 
felt compelled to raise at this time.  It occurs not just in DAML or 
OWL, but in any use of RDF/RDFS in which one needs a closed list 
datatyped elements.  Examples include creating forms (where one wants 
to specify a closed, ordered set of possible strings for a response), 
scraping RDF from non-RDF sources (i.e. being able to produce a list 
of the literals in the "age" field on a particular spreadsheet and 
express that those are the only ages found in that data) and other 
such cases -- the parsetype="Collection" is likely to be a widely 
used feature, but the limitation on using literals will be a problem 
for many applications

As far as being previously asked, it may not have been, but it is a 
potentially important feature for many applications that the MIND Lab 
is pursuing, and thus as AC I felt it important to raise it.  I 
should have been clearer that it is not just because of the ugliness 
it requires of a useful OWL feature, but much more generally is a 
concern in my organization's work on creating RDF data from non-RDF 
sources (c.f. [3],[4]).

>
>The technical issue of how to invent a new way to allow both the node
>elements and literal objects as the value of the rdf:first statement
>is something the WG can consider.  My immediate reaction is that it
>would require a new piece of rdf/xml syntax.

perhaps that is so -- but again the inability to express a closed 
list of datatyped elements seems to be an important one, and I can 
only apologize for my not realizing until I read the LC documents 
that your decision on collections didn't include this functionality.

>
>>  I believe the ability to express a collection of datatype values is a
>>  very important one, and believe it is a mistake for RDF Core to put
>>  this restriction on the use of rdf:parsetype="collection" without a
>>  stronger motivation than I can find in the current LC documents.
>>
>>    thanks
>>    Jim Hendler
>>    AC Member, MIND Laboratory
>>
>>  p.s. Please note this is an individual comment raised as AC member,
>>  not a consensus comment from the web ontology working group nor does
>>  it necessarily represent the opinion of any other group or
>>  organization with which I am affiliated.  I also apologize if this
>>  issue has been brought up before - if it has, just consider this a +1
>>  for the objection.
>>
>>  [1]
>>  http://www.w3.org/TR/rdf-syntax-grammar/#section-Syntax-parsetype-Collection
>>
>>
>>  --
>>  Professor James Hendler				  hendler@cs.umd.edu
>>  Director, Semantic Web and Agent Technologies	  301-405-2696
>>  Maryland Information and Network Dynamics Lab.	  301-405-6707 (Fax)
>>  Univ of Maryland, College Park, MD 20742	  240-731-3822 (Cell)
>>  http://www.cs.umd.edu/users/hendler
>
>Thanks for the comment Jim.
>
>Dave

[1] http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2001Jul/0090.html
[2] http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2002May/0159.html
[3] http://www.mindswap.org/~mhgrove/ConvertToRDF/
[4] http://www.mindswap.org/~aditkal/rdf.shtml

Received on Thursday, 20 February 2003 06:04:03 UTC