W3C home > Mailing lists > Public > www-tag@w3.org > May 2002

Re: [rdfmsQnameUriMapping-6] Algorithm for creating a URI from a QName in RDF Model?

From: Jonathan Borden <jonathan@openhealth.org>
Date: Sun, 26 May 2002 11:21:23 -0400
Message-ID: <006f01c204c9$00e461a0$0301a8c0@ne.client2.attbi.com>
To: <www-tag@w3.org>, "Brian McBride" <bwm@hplb.hpl.hp.com>
Brian McBride wrote:

> At 10:34 10/05/2002 -0400, Jonathan Borden wrote:
>
> [...]
>
>
> >There are two related issues:
> >
> >1. How to convert a QName into a URIreference  in the general case.
> >2. A QName may be either an element type name or an attribute type name,
> >what/which should the URI reference identify?
>
> Hmm, not sure I follow what the problem is there; could you give a little
> more detail/example?
>

Sure,

In XML 1.0 the element _name_ is the same as the element type name i.e. the
XML 1.0 type. Extending this to XML + Namespaces, the element QName is the
element type name, and the attribute QName is the attribute type name.

XML Schema uses this type name definition. In XML Schema a QName identifies
a type. In the case of an element, e.g.

<ex:foo>this is text content</ex:foo>

 the QName might identify the XML Schema particle:

<xsd:element name="foo"> ...

and in the case of an attribute e.g.

<ex:bar ex:foo="this is text content" />

the XML Schema particle

<xsd:attribute name="foo">...

so _what_ a QName identifies is dependent on what you are looking for, i.e.
the QName "ex:foo" identifies the type declaration of  _both_ the element
"ex:foo" and the attribute "ex:foo".

now one _could_ construct a URI reference syntax that specifically
identifies the element and attribute e.g.

...#attribute::foo
...#element::foo

but the simple concatentation of the namespace URI and the local name, won't
serve as an adequate identifier of XML Schema types because you just can't
know whether you are identifying an element, or an attribute or a simple
type or a complex type.

QNames work in XML Schema because the schema particle identification is
_always context dependent_ i.e. you always know that you want an attribute
and not an element. RDF however doesn't maintain information, for example,
about whether the predicate/object pair was parsed as an XML element or
attribute i.e. the abbreviated syntax, so this information is missing. Now
if you wanted to limit the RDF datatypes use of XML Schema datatypes _to
always be a simple type_ then that might be a reasonable solution for simple
types alone (and leaving the identification of complex types unsolved but
perhaps WebOnt will take that up -- it being on our issues list)

That alone (limiting RDF to simple types) wouldn't be the entire solution
but would be a part of a solution, you would be left with the problem of
constructing a URI reference that properly identifies an XML Schema particle
according to XML rules which is a solvable problem.

Jonathan
Received on Sunday, 26 May 2002 11:13:16 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:32:32 UTC