W3C home > Mailing lists > Public > www-rdf-comments@w3.org > January to March 2003

Re: rdf:nodeID and rdf:parseType="Collection"

From: Dave Beckett <dave.beckett@bristol.ac.uk>
Date: Mon, 13 Jan 2003 11:55:12 +0000
To: Garret Wilson <garret@globalmentor.com>
cc: www-rdf-comments@w3.org
Message-ID: <19001.1042458912@hoth.ilrt.bris.ac.uk>

>>>Garret Wilson said:
> I earlier complained of having rdf:nodeID without a separate 
> rdf:nodeIDRef. I'm now trying to use rdf:nodeID with 
> rdf:parseType="Collection".

I've replied to that separately.

> The primer contains (I'll ignore rdf:resource versus rdf:about for 
> now---see my separate message):
> <rdf:Description rdf:about="http://example.edu/courses/6.001">
>    <s:students rdf:parseType="Collection" >
>      <s:student rdf:resource="http://example.edu/students/Amy"/>
>      <s:student rdf:resource="http://example.edu/students/Tim"/>
>      <s:student rdf:resource="http://example.edu/students/John"/>
>    </s:students>
> </rdf:Description>
> But what if the original description of each student is a blank node 
> identified by a nodeID? Can I do this?
> <rdf:Description rdf:about="http://example.edu/courses/6.001">
>    <s:students rdf:parseType="Collection" >
>      <s:student rdf:nodeID="amy"/>
>      <s:student rdf:nodeID="tim"/>
>      <s:student rdf:nodeID="john"/>
>    </s:students>
> </rdf:Description>

Yes.  The contents of an rdf:parseType are a sequence of Node
Elements so that any legal use of them is fine there.

The grammar details:

but the key thing is that the content is an nodeElementList
which is a list of nodeElement:

and these are the familiar <rdf:Description> or typed version like in

> And then what if I don't want them typed? Can I do this?
> <rdf:Description rdf:about="http://example.edu/courses/6.001">
>    <s:students rdf:parseType="Collection" >
>      <rdf:Description rdf:nodeID="amy"/>
>      <rdf:Description rdf:nodeID="tim"/>
>      <rdf:Description rdf:nodeID="john"/>
>    </s:students>
> </rdf:Description>


> My earlier question of whether this is rdf:about or rdf:resource brings 
> up my other earlier comment relating to the name of rdf:nodeID---I think 
> this should really be:
> <rdf:Description rdf:about="http://example.edu/courses/6.001">
>    <s:students rdf:parseType="Collection" >
>      <rdf:Description rdf:nodeIDRef="amy"/>
>      <rdf:Description rdf:nodeIDRef="tim"/>
>      <rdf:Description rdf:nodeIDRef="john"/>
>    </s:students>
> </rdf:Description>

Already replied to that.

I'm wondering if I should add explanation and examples of some of the
things brought up here to the syntax WD.  In particular it might help
to have:

1. An empty node element (as used here)

2. An example of the triples from rdf:parseType="collection" in
   long-form rdf/xml

For example, here is
written out.  (The latest drafts have the N-Triples outputs by the way).

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  <rdf:Description rdf:about="http://example.org/basket">
    <ex:hasFruit rdf:nodeID="genid1"/>

  <rdf:List rdf:nodeID="genid1">
    <rdf:first rdf:resource="http://example.org/banana"/>
    <rdf:rest rdf:nodeID="genid2"/>

  <rdf:List rdf:nodeID="genid2">
    <rdf:first rdf:resource="http://example.org/apple"/>
    <rdf:rest rdf:nodeID="genid3"/>

  <rdf:List rdf:nodeID="genid3">
    <rdf:first rdf:resource="http://example.org/pear"/>
    <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/>


If you think that would be useful, let me know.


Received on Monday, 13 January 2003 06:57:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 21 September 2012 14:16:31 GMT