[Activerdf] Query .filter and unifying query results
Benjamin Heitmann
benjamin.heitmann at deri.org
Thu Aug 2 09:41:06 IST 2007
Hi Mikael.
On 26.07.2007, at 17:52, Mikael Lammentausta wrote:
> The Query class doesn't seem to know FILTER. At first thought this
> seems somewhat simple to implement; add the filter method to
> query.rb and form the string in query2sparql.rb. Is there a
> specific reason why this hasn't been implemented yet?
Yes, AFAIK FILTER is not supported by the current stable ActiveRDF
adapters:
- redland: no complete sparql support AFAIR, might have changed in
the last few months
- rdflite: implemented directly on top of sqlite, so we could add
support for FILTER querys, but you have to ask eyal for this
- sparql: support for FILTER querys depends on the sparql endpoint
Generally speaking I overheard a few senior researchers, complaining
that there actually is no complete sparql implementation, but that
was about 3 months ago.
If you can point to triple stores which support FILTER, then there
might be an incentive to actually implement support in the sparql
engine. Otherwise there is no use for that, because it would be
passed on to triple stores which do not support it.
Basically, the same argument applies to UNIONS. Better to deal with
them in ruby, this might also be more performant, and you can use all
the fancy ruby trucks for dealing with single or multidemensional
arrays.
(like my_array.sort_by {|arg| # this block does something with arg} )
> I'm formulating queries in a model, which takes take the objects in
> an argument and forms several where clauses in a loop. Is this
> legal? :)
Thats perfectly legal, and exactly the reason why you can add where
clauses incrementally to a Query object, and do not have to construct
it in one go.
ActiveRDF itself uses this kind of step wise construction in mutliple
places.
cheers, Benjamin.
More information about the ActiveRDF
mailing list