Re: Collecting shared properties

Hi Mike,


At 18:06 12/12/2001 +0000, Mike Moran wrote:
>I'm currently trying to minimize

What sort of minimization are you trying to do?  Are you trying to minimize 
manual maintenance of the RDF/XML?  If so this trick will work.  If you are 
trying minimize the number of triples, it won't.  I think you are trying 
for the former.


>  some shared properties that will be the same between resources eg:
>
><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>          xmlns:dc="http://purl.org/dc/elements/1.1/">
>
>   <rdf:Description rdf:about="http://www.foo.com"
>    dc:title="Foo" dc:date="2001-12-07"/>
>   <rdf:Description rdf:about="http://www.bar.com"
>    dc:title="Bar" dc:date="2001-12-07"/>
></rdf:RDF>
>
>I want to do something like this:
>
><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>          xmlns:dc="http://purl.org/dc/elements/1.1/">
>
>   <rdf:Description rdf:aboutEach="#shared" dc:date="2001-12-07" />
>
>   <rdf:Bag rdf:ID="shared">
>    <rdf:li>
>     <rdf:Description rdf:about="http://www.foo.com" dc:title="Foo"/>
>    </rdf:li>
>    <rdf:li>
>     <rdf:Description rdf:about="http://www.bar.com"  dc:title="Bar" />
>    </rdf:li>
>   </rdf:Bag>
></rdf:RDF>


That looks right to me and the RDF validator at

   http://www.w3.org/RDF/Validator/

does what you would expect.

The RDFCore WG, which is revising the RDF specs, have decided to remove 
aboutEach from the spec.  The reasons for this decision are:

  - it is not used
  - it is not widely implemented
  - it has confusing interactions with bagID as recorded in
         http://www.w3.org/2000/03/rdf-tracking/#rdfms-abouteach
  - it does not scale as parsers have to save state
  - this is the wrong layer in which to implemenent such functionality

A recent request to the interest group found little support for it.  The WG 
would like to receive feedback on this decision.  Indications to date have 
been that this change is acceptable to the community.


>That is, define the shared attributes separately, and then have them be 
>merged in. However, this is not what happens (at least in cwm).
>
> From the perspective of the author, it would be nice to collect shared 
> attributes like this, but have them be equivalent to placing them on each 
> description, from the perspective of the processing application.
>
>Note that I am not saying that http://www.foo.com and http://www.bar.com 
>are the same class, or type, but rather that they happen to share lots of 
>properties which will change in sync. As such it is more of a syntactical 
>and maintainance convienience than a representational aspect.
>
>Is it possible to do this `optimization'? If so, how?

One solution would be to grab a version of the parser which is the basis of 
the validator.  This is part of the Jena toolkit which can be found at:

    http://www.hpl.hp.com/semweb/jena-top.html

You could read your RDF in with that and either process it with Jena or 
spit it out again, which will expand out the properties and read it into 
cwm for processing.  You needn't do any prgramming with Jena if you prefer 
to use cwm, there is an application jena.rdfcopy which will do the 
expansion for you.

This however, does not sound like a long term solution, though Jeremy might 
be tempted to keep aboutEach processing in, in legacy mode to cover 
situations like yours.  I'll suggest that to him.

Another solution would be to do some xslt to do the transform for you 
before RDF processing.  Any of you xslt experts want to suggest a standard 
way of doing it?

Brian

Received on Wednesday, 12 December 2001 15:55:31 UTC