W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2004

use a QName as variable identifier

From: Alberto Reggiori <alberto@asemantics.com>
Date: Mon, 1 Nov 2004 14:51:13 +0100
Message-Id: <17F4604A-2C0D-11D9-90D4-0011242E4018@asemantics.com>
To: RDF Data Access Working Group <public-rdf-dawg@w3.org>

hi all,

while implementing the newer XML format to serialize query results  
proposed by Dave Beckett


it came to my mind a simple use-case where the user wants to prefix  
each variable with a meaningful namespace

PREFIX dc:  <http://foo.com/foo/>
PREFIX foaf:  <http://xmlns.com/foaf/0.1/>
PREFIX my:  <http://foo.com/my/namespace/>
SELECT ?my:name ?my:title
FROM <file:foo6.rdf>
    (?person rdf:type foaf:Person)
    (?person foaf:name ?my:name)
    (?person dc:title ?my:title)

where foo6.rdf is

<?xml version="1.0"?>
    xmlns:foaf="http://xmlns.com/foaf/0.1/" >

<foaf:Person foaf:name="Some Name" dc:title="Some Title" />


and use the PREFIX namespace into the XML serialization

<?xml version="1.0"?>
<results xmlns='http://www.w3.org/sw/2001/DataAccess/result1#'
  xmlns:my='http://foo.com/my/namespace/' >
          <my:name>Some Name</my:name>
          <my:title>Some Title</my:title>

which would allow a kind of "lightweight" construct to map a input  
namespace to an output one - CONSTRUCT clause would provide a more  
general solution to the mapping/rules problem.

The above query can be tested at  

In other words we could use QNAME in place of VAR terminal symbol...

Any bigger implication on SPARQL grammar I did not think of?


Alberto Reggiori, Senior Partner, R&D @Semantics S.R.L.
alberto@asemantics.com  www.asemantics.com
Milan Office, milano@asemantics.com,   +39 0332 667092
Received on Monday, 1 November 2004 13:51:24 UTC

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