W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > April 2005

Re: Some possible enhancements

From: Dan Connolly <connolly@w3.org>
Date: Tue, 12 Apr 2005 15:30:17 -0500
To: Peter Wilson <pwilson@gorge.net>, public-rdf-dawg-comments@w3.org
Message-Id: <1113337817.4891.197.camel@localhost>

> I am working on a SPARQL engine written in Javascript.

Sounds interesting. We would appreciate a pointer to any
code, documentation, etc.

There's a growing list... you're welcome to edit it...

> In implementing this engine I added some of the features that the 
> Mozilla RDF implementation makes particularly easy:
> 1.WHERE  RESOURCES(?R)   This binds ?R, in turn,  to all the resources 
> in the current graph.
> 2.WHERE ARCSOUT(?S ?P)   This binds ?P, in turn,  to all predicates 
> referenced by the specified subject  for some object.
> 3.WHERE ARCSIN(?O ?P)   This binds ?P, in turn,  to all predicates 
> which  reference the specified object  for some subject.
> These are all hard to achieve using the current SPARQL features.

Hmm... really? the first one is tricky, yes, but 2 and 3 seem
pretty straightforward:

  WHERE { :someSpecificSubject ?P _:anything }
  WHERE { _:anything ?P :someSpecificObject }

Do you have any particular motivation for the first one? I ran into
a need for it the other day, but only in the case of a contrived
academic example. If there's a real use case, perhaps we'll look
into it more.

> 4.WHERE IN(list of literals or resources ?V) This binds ?V, in turn,  to 
> each literal or resourse in the list.

I think this can be done ala...

  WHERE { ... FILTER ?V = "abc" || ?V = "def" || ?V = "xyz" }

>      SELECT ?S ?P ?V
>     WHERE IN(1 2 <ns:someName> ?V) (?S ?P ?V)
> IN may also be used as a value check when ?V is already bound. This is 
> inspired by the very useful SQL IN clause.

I don't think I understand that one. Care to elaborate?

> 5. I have not yet implemented this predicate yet but I have been 
> considering :
>     WHERE FIRST( patternElementList )
>    This operates like a UNION but only succeeds for the first 
> successful patternElement (if any). This would allow a default/fallback 
> mechanism
>    when the current graph does not contain some expected facts.

Hmm... I'm not sure what you mean by that either. Can you give a more
complete example?

Dan Connolly, W3C http://www.w3.org/People/Connolly/
D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E
Received on Tuesday, 12 April 2005 20:30:18 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:52:06 UTC