W3C home > Mailing lists > Public > www-rdf-interest@w3.org > June 2001

QNames As Anonymous First Class Objects

From: Sean B. Palmer <sean@mysterylights.com>
Date: Tue, 19 Jun 2001 00:34:14 +0100
Message-ID: <068c01c0f84f$643b8120$ccec93c3@z5n9x1>
To: <www-rdf-interest@w3.org>
Cc: "Jonathan Borden" <jonathan@openhealth.org>, "Aaron Swartz" <aswartz@swartzfam.com>
Has anyone done any previous work on modelling QNames as anonymous
first class objects, by taking definitions from the non-normative
namespace partitions section of the XMLNS recommendation [1]? It would
seem to me that this is a pretty obvious and logical thing to do,
although I did some searching through the archives, and only found
stuff from July such as [2]. Perhaps Jon will have some comments on

Basically, you can model the QNames easily in RDF is you simply create
a set of expansions, which are all sub classes of ":QName". These are
as defined in the XMLNS specification, and are ":ExpEType" and
":ExpAName". Further to that, you have the other predicates which are
":type", ":ns", (and for ":ExpAName") ":eltype", and ":elns". This
allows us to refer to QNames with ease.

Take for example the <title> element in the XHTML namespace. In RDF,
this has the QName:-

   [ a :ExpEType; :type "title";
     :ns "http://www.w3.org/1999/xhtml" ] .

Taking the example from the XMLNS specification:-

 <section xmlns="urn:com:books-r-us">
   <title>Book-Signing Event</title>
     <author title="Mr" name="Vikram Seth" />
     <book title="A Suitable Boy" price="$22.95" />

this has the QNames:-

[ a :ExpEType; :type "section"; :ns "urn:com:books-r-us" ] .
[ a :ExpEType; :type "title"; :ns "urn:com:books-r-us" ] .
[ a :ExpEType; :type "signing"; :ns "urn:com:books-r-us" ] .
[ a :ExpEType; :type "author"; :ns "urn:com:books-r-us" ] .
[ a :ExpAName; :name "title"; :eltype "author"; :elns
"urn:com:books-r-us" ] .
[ a :ExpAName; :name "name"; :eltype "author"; :elns
"urn:com:books-r-us" ] .
[ a :ExpEType; :type "book"; :ns "urn:com:books-r-us" ] .
[ a :ExpAName; :name "title"; :eltype "book"; :elns
"urn:com:books-r-us" ] .
[ a :ExpAName; :name "price"; :eltype "book"; :elns
"urn:com:books-r-us" ] .

This makes associations such as:-

 [ a :ExpEType; :type "label"; :ns "http://example.org/#" ]
     [ a :ExpEType; :type "title"; :ns
"http://www.w3.org/1999/xhtml" ] .

remarkably trivial.

Here's a short, non-complete (missing cardinalities) schema for the

   :QName daml:unionOf (:ExpEType :ExpAName) .
   :ns rdfs:domain :QName; rdfs:range rdfs:Literal .
   :type rdfs:domain :ExpEType; rdfs:range rdfs:Literal .
   :name rdfs:domain :ExpAName; rdfs:range rdfs:Literal .
   :eltype rdfs:domain :ExpAName; rdfs:range rdfs:Literal .
   :elns rdfs:domain :ExpAName; rdfs:range rdfs:Literal .

Although I'm not sure what namespace one would use for these terms.

BTW, going by this, it doesn't bother me too much that the
concatenation mechanism is so different from the QNames mechanism,
because the dataset of triples that is generated from XML RDF is not
the same as the expanded element types and attribute names that you
get from parsing the document tree as XML. Also, it is clearly
possible to map QNames into triples.

cf. [3], which is when I got started on this rant.

[1] http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-expnames
[2] http://lists.w3.org/Archives/Public/www-rdf-interest/2000Jul/0045
[3] "21:36:09" onwards in

Kindest Regards,
Sean B. Palmer
@prefix : <http://webns.net/roughterms/> .
:Sean :hasHomepage <http://purl.org/net/sbp/> .
Received on Monday, 18 June 2001 19:35:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:44:31 UTC