RE: FW: [Jena-devel] FYI: New CVS module: BRQL

From: Butler, Mark <mark-h.butler_at_hp.com>
Date: Thu, 29 Jul 2004 16:06:53 +0100

Hi David

Here is a clearer explantation - sorry I should have included it originally.
At the moment in Longwell we do queries like this in RDQL (hence
RDQLLocalModel being slow)

SELECT ?a,
WHERE (?a , rdf:type , vra:Image ) ,
         (?a , vra:subject, vraTopic:Architecture_artist)

then we query each member of ?a serially e.g.

foreach uri in ?a
  SELECT ?b WHERE ( uri , ims:aggregationlevel, ?b)
  SELECT ?b WHERE ( uri , vra:subject, ?b)
  SELECT ?b WHERE ( uri , vra:creator, ?b)
  SELECT ?b WHERE ( uri , art:topic, ?b)
  SELECT ?b WHERE ( uri , art:geographic, ?b)
  SELECT ?b WHERE ( uri , dc:subject, ?b)
end

but in BRQL we can replace this with a single query e.g.

SELECT *
WHERE (?a , rdf:type , vra:Image ) ,
         (?a , vra:subject, vraTopic:Architecture_artist)
OPTIONAL (?a, ims:aggregationlevel, ?c) ,
         (?a, vra:subject, ?d) ,
         (?a, vra:creator, ?e) ,
         (?a, art:topic, ?f) ,
         (?a, art:geographic, ?g) ,
         (?a, dc:subject, ?h)

so for example for one of the demos, we query for ARTstor, VIA and OCW
objects. In BRQL this will require 3 queries, as there is no support for OR
constraints.

Mark

-----Original Message-----
From: David R. Karger [mailto:karger_at_theory.csail.mit.edu]
Sent: 29 July 2004 15:23
To: general_at_simile.mit.edu
Subject: Re: FW: [Jena-devel] FYI: New CVS module: BRQL

Mark, this is quite interesting. Following the example from your previous
email, http://lists.w3.org/Archives/Public/www-rdf-dspace/2004Jan/0026.html,
does jena support queries of the form

foreach uri in ?a
  SELECT ?b,?c where (uri, ?b, ?c)
                     and (?b = rdf:type or ?b=ims:aggregationlevel or
                          ?b = vra:subject or ?b = vra:creator ....)

etc?

Though perhaps not the easiest code to read, this does appear to get what
you want in one query....
Received on Thu Jul 29 2004 - 15:07:11 EDT

This archive was generated by hypermail 2.3.0 : Thu Aug 09 2012 - 16:39:17 EDT