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

Re: [closed] RDF Core LC issue xmlsch-08

From: Dave Beckett <dave.beckett@bristol.ac.uk>
Date: Mon, 6 Oct 2003 12:13:24 +0100
To: "C. M. Sperberg-McQueen" <cmsmcq@acm.org>
Cc: w3c-xml-schema-ig@w3.org, www-rdf-comments@w3.org
Message-Id: <20031006121324.610313be.dave.beckett@bristol.ac.uk>

On 03 Oct 2003 22:19:13 +0200
"C. M. Sperberg-McQueen" <cmsmcq@acm.org> wrote:

> Colleagues,
> 
> thank you for your response to our comment.  A full account
> of our formal responses to your responses is attached to
> http://lists.w3.org/Archives/Public/www-rdf-comments/2003OctDec/0011.html
> For the sake of those who are trying to track this particular issue
> using the email archives, our response on this topic is given 
> below.
> 
> -C. M. Sperberg-McQueen
>  for the XML Schema WG
> 
> On Thu, 2003-03-27 at 12:27, Dave Beckett wrote:
> > Colleagues, 
> > 
> > The RDF Core WG has considered your last call comment captured in
> > 
> >    http://www.w3.org/2001/sw/RDFCore/20030123-issues/#xmlsch-08
> > 
> > (raised in section "4.1. Manifest typing in the instance (policy)" of
> > http://lists.w3.org/Archives/Public/www-rdf-comments/2003JanMar/0489.html )
> > 
> > and decided
> > 
> >    http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2003Mar/0124.html
> > 
> > to accept it.
> > 
> > The RDF Core WG agrees that there are good reasons for not using
> > rdf:datatype rather than xsi:type.
> > 
> > We agree with the XML Schema WG that one reason is that RDF is not
> > restricted to using datatypes defined by XML Schema, but allows other
> > datatypes conforming to the XML Schema model for datatypes.
> > 
> > Another reason is that no other RDF/XML attribute takes QNames as
> > arguments.  Allowing this in one specific case is also likely to
> > cause confusion.
> > 
> > Whilst RDF Core would have preferred to not to introduce a different
> > attribute, it's judgement was that the solution proposed in the last
> > call drafts is the best of the options available.
> > 
> > To minimise any confusion, RDF Core has carefully described the
> > correct syntax in both the primer and the RDF/XML syntax documents.
> > We further note that incorrect use of xsi:type where rdf:datatype
> > should be used will be recognised as a syntax error by RDF/XML parsers.
> > 
> > Please reply, copying www-rdf-comments@w3.org whether this response
> > is an acceptable disposition of your comment.
> > 
> > 
> > Further, more detailed, informal explanation is given below.  We
> > assume familiarity with XML Schema datatypes :)
> > 
> > ------------------------------------------------------------
> > 
> > RDF Datatypes in instance documents are described in general terms in
> > the section
> >    Typed Literals - rdf:datatype
> >    http://www.w3.org/TR/rdf-syntax-grammar/#section-Syntax-datatyped-literals
> > 
> > RDF datatypes are identified by URI-references and thus to indicate
> > that a piece of RDF/XML is a datatyped literal, you need to give the
> > URI somewhere.  Existing (untyped) literals are used like this:
> > 
> > As element content:
> >     <ex:prop>foo</ex:prop>
> > 
> > As attribute content:
> >     <ex:Node ... ex:prop="foo" ... />
> > 
> > The latter can be considered as an abbreviation of the former form.
> > The other things that can apply to RDF literals are the in-scope XML
> > language:
> > 
> > As element content:
> >     <ex:prop xml:lang="en">foo</ex:prop>
> > 
> > As attribute content:
> >     <ex:Node ... ex:prop="foo" xml:lang="en" ... />
> > 
> > (of course xml:lang can be on any outer element)
> > 
> > So it was natural to allow datatypes by creating an extra attribute
> > in the property element form.  Using it in the attribute form would
> > have meant all the attributes values were of the same datatype (not
> > so useful) and wasn't proposed.  Thus a datatyped RDF literal is
> > used in the instance data in the element form with a new rdf:datatype
> > attribute:
> > 
> >     <ex:prop xml:lang="en" rdf:datatype="http://example.org/dt">foo</ex:prop>
> >     <ex:prop rdf:datatype="http://example.org/dt">foo</ex:prop>
> > 
> > (Note, whether xml:lang values applies to such datatypes/is involved
> > in the datatype mapping is another issue, please don't get
> > distracted!)
> > 
> > The above didn't use an XML schema datatype URI in the example above
> > since any datatype is be allowed (identified by a URI).
> > 
> > Not in any particular order or necessarily complete, but here is a
> > summary of some issues that RDF Core considered for the RDF/XML
> > syntax on encoding datatypes using xsi:type and why the rdf:datatype
> > solution was decided.
> > 
> > 1. xsi:type content is an XML Qname not a URI
> > 
> > Thus cannot indicate any arbitrary datatype URI reference, so another
> > attribute would be needed for that case (like rdf:datatypeURI) -
> > adding two attributes would be worse than adding one.
> > 
> > 2. XML Qname attribute content in RDF/XML
> > 
> > This would be the first attribute in RDF/XML to take a XML Qname
> > value (a big step).  This would require extra explanation so that
> > existing users wouldn't confuse them with those that took URIs.
> > 
> > 3. Namespace declarations, prefixes
> > 
> > It would also require instance documents to declare the xsi namespace
> > prefix and have to also check for any namespaces declared inside such
> > xsi:type values and declare those too - again new implementations and
> > explanation needed.
> > 
> > 4. xsi:type would be confused with rdf:type
> > 
> > Since the former takes Qnames and the latter URI references, it would
> > be possible to get the name wrong and be confused at the errors.
> > Although xsi:type wouldn't be legal everywhere rdf:type was, rdf:type
> > would have been allowed on elements that took xsi:type.
> > 
> > 5. confusing URIs and Qnames
> > 
> > A bad choice of namespace prefixes might make cause other problems in
> > xsi:type values, confusing them for URIs.  It would also be more than
> > likely that people would try to use Qnames in rdf:type attribute values.
> > 
> > 6. xsi:type is illegal in RDF/XML now, unlikely to be used accidently
> > 
> > If somebody was tempted to use xsi:type, it would likely cause the
> > parsing to fail.  It is only ever used as an attribute in XML Schema
> > documents and to use it on a literal in RDF/XML would be something
> > like this:
> > 
> >       <ex:prop xsi:type="xsd:string">foo</ex:prop>
> > 
> > which is forbidden by grammar production
> >  
> > http://www.w3.org/TR/2003/WD-rdf-syntax-grammar-20030123/#literalPropertyElt
> 
> Thank you for your response; we regret to report that we are slightly
> confused by it.
> 
> Is `The RDF Core WG agrees that there are good reasons for not using
> rdf:datatype rather than xsi:type' a typo for `The RDF Core WG agrees
> that there are good reasons for [DEL: not :DEL] using rdf:datatype
> rather than xsi:type'?  If so, then the rest of the reply makes more
> sense.

Yes that was the original intention; sorry for that.

I'm taking your reply as an accept to our response (accept) of this
issue xmlsch-08, although you don't mention this.

> We are concerned, however, by point 6 in your informal response. It
> seems problematic to us to make xsi:type illegal in XML-encoded RDF
> documents.  Among other things, this would make it impossible to
> validate documents with an XML Schema schema and later process them
> with an RDF processor.

As pointed out in the March email above, where xsi:type would be useful
(an attribute of an element with literal content) it has been illegal
since the RDF/XML in the 1999 RDF Model and Syntax recommendation.
RDF/XML can still be validated fine via externally referenced W3C XML
schemas.

> It is also not clear to us that you or we have fully addressed the
> question of user confusion. The small string distance between rdf:type
> and xsi:type is almost certain eventually to confuse any user who must
> use both.  Your analysis seems to us to indicate only that you don't
> really expect any users to be interested in both RDF and XML Schema;
> we don't think that such users are likely to be all that rare.
> 
> But since we don't have any better solution to urge upon you, all we
> can do is gloomily predict user confusion and hope for the best.

RDF/XML had rdf:type in the 1999 RECommendation. XML Schema's later
creation of xsi:type is not something anyone can do much about now.  If
you think the two names are confusing, then the XML Schema WG in
2000/2001 should have made an xsi:xmltype :)

The overloading of short and useful terms such as 'type' is going to
happen. This is why Namespaces in XML was written (and RDF Model and
Syntax was one of the first specs to make use of it)

Dave
Received on Monday, 6 October 2003 07:16:14 GMT

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