Re: RDF QLs within a larger language

EricP wrote:
> Howard's XSRQL [1] and TimBL's N3QL [2] are good examples of RDF
> functions that fit into a larger QL. In the XSRQL case, it gives us
> an opportunity to lean on some already specified and implemented
> functionality in XQuery that is likely to get very wide
> deployment. I'm curious about how much re-use we get, Howard.
>
> N3QL constrains itself to be a subset of the N3 syntax which can be
> used for query. This is especially usful if N3 is later adopted as a
> rules language because we would get to take advantage of the fact that
> query goals and rule goals are very similar, both in syntax and in
> semantics. Once we've defined a language that produces some sort of
> variable bindings, it's pretty easy to define how to use those
> bindings to construct new graphs.
>
> Anybody interested in exploring this with me?

yes, I do
started some testing..
seems pretty straightforward to map
--query testQ.n3
to
--filter testF.n3

i.e.
[] select { result is (?x ?y) };
   where  { ?x a ex:Librarian;  ex:hairColor ?y }.
to
{ ?x a ex:Librarian;  ex:hairColor ?y } => { result is (?x ?y) }.


for the moment I assume it is q:result and q:is where
@prefix q: <http://www.w3.org/2004/ql#>
                                     ^

and then given

ex:Joe a ex:Librarian; ex:hairColor "black".
ex:Mary a ex:Librarian; ex:hairColor "red".

we indeed get

q:result q:is (ex:Joe "black").
q:result q:is (ex:Mary "red").


?? how about what we had before as
{ ?x a ex:Librarian; ex:hairColor ?y } => { result is (?x ?y) }.
{ ?x a ex:Plumber; ex:hairColor ?y } => { result is (?x ?y) }.

-jos


> [1] http://www.fatdog.com/xsrql.html#Examples
> [2] http://www.w3.org/DesignIssues/N3QL


-- 
Jos De Roo, AGFA http://www.agfa.com/w3c/jdroo/

Received on Monday, 28 June 2004 17:46:03 UTC