You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by anuj kumar <an...@gmail.com> on 2018/05/14 10:31:12 UTC

Difference Between ElementWalker and OpWalker | ARQ

Hey guys,
 Can some one please explain me the difference between ElementWalker and
OpWalker classes of ARQ and when to use which one.

I am trying to modify an incoming SPARQL query such that I want to strip
the FILTER portion out of the query. Here is an example incoming query:

> "SELECT ?s\n" +
> "WHERE {\n" +
> "    ?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.example.com/Ind#Indicator> .\n" +
> "    ?s <http://www.example.com/common#modified> ?modified .\n" +
> "    FILTER (?modified >= \"2018-04-01T00:00:00.000000\"^^<http://www.w3.org/2001/XMLSchema#dateTime>)\n" +
> "} limit 100"
>
> And I want to convert it to:



"SELECT ?s\n" +
"WHERE {\n" +
"    ?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.example.com/Ind#Indicator> .\n" +
"} limit 100"

Basically the idea is to do filtering at the Data Store level rather than
at the application level.

If I understand it correctly then I can use either of the classes to
achieve what I want to do, but I dont know if there is some sort of benefit
to use one over the other.

Thanks,
-- 
*Anuj Kumar*

Re: Difference Between ElementWalker and OpWalker | ARQ

Posted by Lorenz Buehmann <bu...@informatik.uni-leipzig.de>.
I'd say it's query syntax vs algebra syntax ...


On 14.05.2018 12:31, anuj kumar wrote:
> Hey guys,
>  Can some one please explain me the difference between ElementWalker and
> OpWalker classes of ARQ and when to use which one.
>
> I am trying to modify an incoming SPARQL query such that I want to strip
> the FILTER portion out of the query. Here is an example incoming query:
>
>> "SELECT ?s\n" +
>> "WHERE {\n" +
>> "    ?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.example.com/Ind#Indicator> .\n" +
>> "    ?s <http://www.example.com/common#modified> ?modified .\n" +
>> "    FILTER (?modified >= \"2018-04-01T00:00:00.000000\"^^<http://www.w3.org/2001/XMLSchema#dateTime>)\n" +
>> "} limit 100"
>>
>> And I want to convert it to:
>
>
> "SELECT ?s\n" +
> "WHERE {\n" +
> "    ?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
> <http://www.example.com/Ind#Indicator> .\n" +
> "} limit 100"
>
> Basically the idea is to do filtering at the Data Store level rather than
> at the application level.
>
> If I understand it correctly then I can use either of the classes to
> achieve what I want to do, but I dont know if there is some sort of benefit
> to use one over the other.
>
> Thanks,