On 2014-07-16 10:34, Alexey Zakhlestin wrote:
>
> On 14 Jul 2014, at 17:37, Bart Vandewoestyne <bart.vandewoest...@telenet.be> 
> wrote:
>
>> Our problem is the following: we observed that certain of our SPARQL
>> queries have subqueries (that return IDs) that run rather slow (because
>> of a slow bif:contains full-text-search).  We therefore
>> 'migrated'/'copied'/'flattened' some of our data to another
>> technology/database/store that allows for faster textual search.
>> Querying this database results in a list of IDs, and these IDs are then
>> 'injected' in a SPARQL query (we simply create a SPARQL query string
>> with all these IDs in the FILTER command).
>>
>> Apparently, we are limited to filtering 4094 IDs and I don't see a way
>> to overcome this if the subquery returns more.  Could there be a way to
>> work-around this limitation at SPARQL level?
>
> Couple of untested thoughts:
>
> 1. try to use several IN() filters by joining them using OR
>
>      FILTER(?id IN(1,2,3) or ?id IN(4,5,6))
>
> 2. use UNION to join result sets
>
>      {
>          … . FILTER(?id IN(1,2,3)
>      }
>      UNION
>      {
>          … . FILTER(?id IN(4,5,6)
>      }

Getting back to my old question, I have another question :-)

Am I right if I say that using an expression like

   ?id IN(1,2,3)

is a Virtuoso-specific extension to the SPARQL standard?

I can't seem to find anything about IN() online at 
http://www.w3.org/TR/rdf-sparql-query/#grammar nor 
http://www.w3.org/TR/sparql11-overview/ but if my interpretation of the 
grammar online at http://docs.openlinksw.com/virtuoso/rdfsparql.html is 
correct, then according to rule [47] the use of IN() is a 
Virtuoso-specific extension.

Can anybody confirm?  And if this is indeed a Virtuoso-specific 
extension, then what would be the most appropriate/efficient way to 
rewrite a FILTER-statement of the form

   FILTER (?id IN (1, 2, 3))

in a standard-conforming way?

Kind regards,
Bart

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to