W3C home > Mailing lists > Public > www-rdf-interest@w3.org > April 2003

Re: A couple question, Equivalent for rdf:resource

From: Dave Beckett <dave.beckett@bristol.ac.uk>
Date: Mon, 07 Apr 2003 11:55:11 +0100
To: jimbobbs <jimbobbs@hotmail.com>
cc: www-rdf-interest <www-rdf-interest@w3.org>
Message-ID: <29360.1049712911@hoth.ilrt.bris.ac.uk>

>>>Jimmy Cerra said:
> 
> I'm trying to figure out a way to simplify the syntax for RDF/XML so I
> can transform it easily with a style sheet.  It seems that there are a
> lot of different ways to represent the same graph in RDF/XML - some of
> them more verbose than others.  

Certainly there are is way more than one way to do it in RDF/XML.
(Hmm. That sounds just like Perl)


> ... For instance, is...
> 
> <rdf:Description rdf:about="http://www.foo.com#car">
> <jfc:property rdf:resource="http://www.foo.com#bar" />
> </rdf:Description>
> 
> ...the same as...
> 
> <rdf:Description rdf:about="http://www.foo.com#car">
> <jfc:property>
> <rdf:Description rdf:about="http://www.foo.com#bar" />
> </jfc:property>
> </rdf:Description>

Yes.  You could also use xml:base to make the URLs shorter, but I
think that works even worse with XSLT.

> 
> I'm thinking that the second form would be easier to process with an
> XSLT style sheet (despite being more verbose) because there is a
> "symetry" between the two nodes #car and #bar contained as properties of
> rdf:Description.

See the definitive work on XSLT and RDF/XML:

  Snail - Excruciatingly Slow RDF Parsing, Jeremy Carroll
  www-uk.hpl.hp.com/people/jjc/snail/


> 
> Also, I was wondering why rdf:about, rdf:nodeID, rdf:ID and other XML
> properties ... 

You mean XML attributes.

Calling them XML properties is wrong and will also be confused with
RDF properties, which is what you use in the rest of the sentence:


> ...of the rdf:Description element aren't themselves defined as
> RDF properties.  They can be represented as XML properties using the
> abbrivated syntax in either case.  However, if they were defined as RDF
> properties as well, then they can be extended as in:
> 
> <rdf:Property rdf:about="http://www.foo.com#href">
> <rdfs:subPropertyOf
>   rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#about" />
> <rdfs:domain
>   rdf:resource="http://www.w3.org/2000/01/rdf-schema#Resource" />
> <rdfs:range
>   rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal" />
> <rdfs:comment>
>   Subject is identified by the web site at the object,
>   and it is not machine-readable.
> </rdfs:comment>
> </rdf:Property>


Yuck.  I'd say this is a terrible idea - confusing and mixing the
abstract syntax (RDF triples) terms with the concrete syntax
(RDF/XML) terms.


> 
> Finally, is rdf:Description an instance of rdfs:Resource?  Then why
> isn't it defined in a schema, as in:

No, it's a bit of RDF/XML syntax used to tell you when you are
describing a resource.  It is an XML element that gives you a place
to put either the URI, short ID or blank node identifier of the
resource.

It is not part of the RDF graph.

All resources in RDF are implicitly of rdf:type rdfs:Resource
but you don't state that.

> 
> <rdfs:Resource
>   rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#Description">
> <rdfs:comment>
>   A node, the subject of a statement.
> </rdfs:comment>
> </rdfs:Resource>

Nope.

I recommend you take a look at the RDF Concepts and Abstract Syntax
working draft that shows you the RDF model - triples.  Then you can
see how the parts of RDF/XML that relate only to writing it in XML
don't have anything to do with the graph.

RDF is all just triples:
  RDF Concepts and Abstract Syntax
  http://www.w3.org/TR/rdf-concepts/

There's a way to write the triples in XML:
  RDF/XML Syntax Specification (Revised)
  http://www.w3.org/TR/rdf-syntax-grammar/

The RDF/XML grammar tells you what are RDF/XML syntax terms, what are
terms that go in the graph:
  http://www.w3.org/TR/rdf-syntax-grammar/#section-grammar-summary

Cheers!

Dave
Received on Monday, 7 April 2003 06:57:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:51:58 GMT