jena-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurent Pellegrino <laurent.pellegr...@gmail.com>
Subject Re: STRSTARTS does not work with Transactional TDB
Date Wed, 02 Nov 2011 15:14:27 GMT
Thanks Andy for your help. I have understood the problem of scope but
even if I move the FILTER clause outside the GRAPH block I stil get no
result with the transactional TDB dataset.

    Laurent

On Wed, Nov 2, 2011 at 3:22 PM, Andy Seaborne <andy@apache.org> wrote:
> Hi Laurent,
>
> There is a bug ...
>
> .. it's nothing to do with transactions
> (try http://pastebin.com/LzDFqf0g for using with plain TDB and plain ARQ
>
> ... it's nothing to do with STRSTARTS
>
> ... it's every thing to do with the scope of ?g
>
> The problem is the scope of ?g - it should only come into visibility when
> GRAPH ?g happens -
>
> In { ?s ?p ?o  FILTER ( ... ?g ... ) }
> then ?g is not bound so the filter is false.
>
> TDB is right (but I'm not sure why) - it's ARQ that's wrong!
>
>
> You possibly meant:
>
>  SELECT ?g ?s ?p ?o WHERE {
>      GRAPH ?g {
>          ?s ?p ?o .
>      }
>      FILTER (STRSTARTS(str(?g), "https://plus.google.com825349613"))
>  }
>
> i.e the FILTER outside the GRAPH block, after ?g is set and in-scope.
>
> Time to go and think ...
>
> Thank you for the report
>
>        Andy
>
> On 02/11/11 09:54, Laurent Pellegrino wrote:
>>
>> Hi all,
>>
>> I have executing a SPARQL Select query which filters quadruples
>> according to a prefix in the graph value. The SPARQL query is the
>> following:
>>
>> SELECT ?g ?s ?p ?o WHERE {
>>     GRAPH ?g {
>>         ?s ?p ?o .
>>         FILTER (STRSTARTS(str(?g), "https://plus.google.com/825349613"))
>>     }
>> }
>>
>> It seems that the query works when it is executed with a basic Dataset
>> but when it is executed with a transactional Dataset it does not work.
>> Hereafter are the links to the tests (I use the last snapshots from
>> the apache repository):
>>
>> 1/ This is the test associated to the basic Dataset where the query works:
>> http://pastebin.com/raw.php?i=Atkt16Zk
>>
>> the output is, as expected:
>>
>>> TestDatasetGraph.main() results are:
>>>   https://plus.google.com/825349613/$1320226073388/$null
>>
>> 2/ The test which is not working (returns no result) and that uses a
>> transactional dataset:
>>
>> http://pastebin.com/raw.php?i=vcCJV30P
>>
>> Do I miss something in the second test or is it a bug?
>>
>> Kind Regards,
>> Laurent
>
>

Mime
View raw message