- From: Seaborne, Andy <andy.seaborne@hp.com>
- Date: Tue, 27 Jul 2004 12:25:34 +0100
- To: public-rdf-dawg@w3.org
Seaborne, Andy wrote: > Updated: > > http://jena.hpl.hp.com/~afs/RDF-XML.html > > Andy I've updated the document again to include an example of issuing a BRQL query from an XQuery processor. The core is a single external function which executes a query (passed as a string) on a named source (named by URI). ------------------------- declare namespace brql = "java:com.hp.hpl.jena.brql.extensions.RDFQuery" ; declare variable $query as xs:string external ; declare variable $source as xs:string external ; . . . . { let $rs := brql:query($query, $source)/resultSet let $selectVars := $rs/vars/var/text() return <table> { for $x in $selectVars return <th>{$x}</th> } { for $soln in $rs/solution return <tr> { for $v in $selectVars let $binding := $soln/binding[ var = $v] return fn:binding($binding) } </tr> } </table> } ------------------------- Full XQuery code in the document. Many thanks to Damian Steer for the work in building the extension function which works for XSLT as well. Andy
Received on Tuesday, 27 July 2004 07:26:16 UTC