W3C home > Mailing lists > Public > www-rdf-logic@w3.org > October 2000

Re: DAML-ONT: RDF syntax

From: Pierre-Antoine CHAMPIN <champin@bat710.univ-lyon1.fr>
Date: Wed, 25 Oct 2000 16:08:14 +0200
Message-ID: <39F6E94E.1226E09E@bat710.univ-lyon1.fr>
To: Dan Connolly <connolly@w3.org>
CC: Sergey Melnik <melnik@db.stanford.edu>, www-rdf-logic@w3.org
Dan Connolly wrote:
> Sergey Melnik wrote:
> > Original definition:
> >
> >         <Property ID="subClassOf">
> >           <equivalentTo
> > resource="http://www.w3.org/2000/01/rdf-schema#subClassOf"/>
> >         </Property>
> >
> >         Deficiencies:
> >           - invalid RDF syntax: attributes "ID" and 
> >             "resource" are not qualified and
> >             won't be recognized by all RDF parsers.
> 
> The spec doesn't require ID and resource to be qualified;
> in fact, as written, it doesn't allow them to be qualified:
> 
>   [6.6] idAttr         ::= ' ID="' IDsymbol '"'
>  [6.18] resourceAttr   ::= ' resource="' URI-reference '"'
> http://www.w3.org/TR/1999/REC-rdf-syntax-19990222/#grammar
> 
> So it looks to me like the bug is in your tools[1],
> not in the DAML schema.

Neither. The bug is in the spec :-P
Seriously, I think that issue has already been raised on www-rdf-interest@w3.rdf .
Namespace qualification (that is "rdf:ID" and "rdf:resource") *are* needed since the element name can be anything, and does not belong to any well known DTD.

The only case where "ID" and "resource" are tolerated by some parsers is when the element name belongs to the rdf: namespace, which is IMHO no right either: unqualified attributes do not inherit the element namespace, according to "XML Names".

> >           - the definition is location-dependent. If the 
> >             DAML/RDF file is moved to another location
> >             (e.g. stored on a local disk), it will break.
> 
> In general, if you take a document from one
> part of the web and copy its contents to some other
> part of the web, you've created another document.
> If the resulting document doesn't do what you expect,
> it doesn't mean there's something broken/wrong with the 
> original document.

agreed.
Anyway, a solution to make an XML document more "location-proof" is to use xml:base. That attribute contains the base URL used to resolve relative URIs. An adendum to the RDF spec. should be done to specify clearly how RDF parsers must use xml:base, shouldn't it ?

> > Better definition:
> >
> >         <Property rdf:ID="&daml-o;subClassOf">
> >           <equivalentTo rdf:resource="&rdfs;subClassOf"/>
> >         </Property>
> >
> >         This definition requires declaration of 
> >         corresponding XML entities on the top of the 
> >         document
> >         (see appended daml-o.rdf specification).
> 
> I prefer not to rely on XML entity declaration syntax.

As far as I'm concerned, I like using entities instead of wrinting lots of long URIs. I find it much more readable, and less time-consuming and error-prone, as Sergey mentionned.
But anyway, this is a question of style and taste, not a syntactical issue ; any XML parser will validate entities as well as developed URIs.

I see a syntactical bug, on the other hand :
putting a full URI in the rdf:ID attribute is not right.
It will result in something like :

http://www.daml.org/2000/10/daml-ont#http://www.daml.org/2000/10/daml-ont#subClassOf

  Pierre-Antoine
Received on Wednesday, 25 October 2000 10:54:49 GMT

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