W3C home > Mailing lists > Public > www-rdf-rules@w3.org > January 2004

Using XML Query and reflection to query RDF

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: Fri, 02 Jan 2004 14:42:53 +0000
To: www-rdf-rules@w3.org
Message-ID: <f5blloq1keq.fsf@erasmus.inf.ed.ac.uk>

As briefly discussed at the BOF in Philadelphia, here's my proposal
for using XQuery to query RDF graphs, by traversing a synthetic XPath
data model which is an Edinburgh Normal Form reflection (see [1]) of
the RDF graph:

First the reflection -- basically elements encode relations,
attributes encode properties and (RDF) types encode entities.

<_anon rdf:type="wsdl:service">
 <a href="http://www.w3.org/2001/11/13-RDF-Query-Rules/#implementations">
    From Eric P</a>
 <wsdl:hasPort rdf:type="wsdl:port">
  <wsdl:binding wssoap:style="wssoap:document"
                wssoap:transport="wssoap:http"
                wsdl:name="es:EndorsementSoapSearchBinding"/>
  <wssoap:address>. . .</wssoap:address>
 </wsdl:hasPort>
</_anon>

and here's the query (I'm not an XQuery expert, so someone who is
please correct any mistakes -- I trust the intention at least is
clear):

 <flwr>for $port in //*[rdf:type="wsdl:service"]/wsdl:hasPort
          for $binding in $port/wsdl:binding[@wssoap:style="wssoap:document"]
             return ($port, $binding/@wsdl:name)
 </flwr>

I think a more interesting approach, which allows more native use of
the power of typed XPath expressions, assumes a reflection which uses
_Schema_ (complex) types to encode entities:

 <flwr>for $port in //element(*,wsdl:service)/wsdl:hasPort
          for $binding in $port/wsdl:binding[@wssoap:style="wssoap:document"]
             return ($port, $binding/@wsdl:name)
 </flwr>

ht

[1] http://www.idealliance.org/papers/extreme03/html/2003/Thompson01/EML2003Thompson01.html

-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                      Half-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Friday, 2 January 2004 09:43:11 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 2 March 2016 11:10:15 UTC