Re: Requirement: queries written as RDF

On Apr 02, 2004, at 07:27, ext Eric Prud'hommeaux wrote:

>
> ... Once we know how to express a variable in the RDF model, I
> think the query expression will fall out.

I believe that RDFQ does this in a very intuitive and effective manner.

E.g. (using Turtle)

Match all resources where the dct:created value is equal to the
dct:modified value:

[a rdfq:Query;
    rdfq:target
       [a rdfq:Target;
          dct:created  [a rdfq:Value; rdfq:id "x"];
          dct:modified [a rdfq:Value; rdfq:id "x"]
       ]
].


or minimally (presuming domain/range closures and RDFQ default 
namespace):

[:target [dct:created  [:id "x"]; dct:modified [:id "x"]]].

(results are a graph consisting of the descriptions of the matched 
targets)

--

Or...

Return the title and description for all resources with a dct:modified
value greater than one week ago (modified in the past week):

[:select ("title" "description");
  :target [dc:title       [:id "title"];
           dc:description [:id "description"];
           dct:modified   [:gt one-week-ago]]].

(results are a graph consisting of the variable bindings)

Patrick

--

Patrick Stickler
Nokia, Finland
patrick.stickler@nokia.com

Received on Friday, 2 April 2004 03:12:24 UTC