ASF GitHub Bot commented on JENA-1519:

GitHub user jeremy-coulon opened a pull request:


    JENA-1519: OpWalkerVisitor with custom operators


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jeremy-coulon/jena bug-opext-jira-1519

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #394
commit 74529be4f7da2ce1a16c5542df073a1911859751
Author: Jeremy Coulon <jeremy.coulon@...>
Date:   2018-04-10T15:19:29Z

    Add UT showing the problem

commit 9c2bb1c183a70fafa1007857823e91aca9a1f18f
Author: Jeremy Coulon <jeremy.coulon@...>
Date:   2018-04-10T15:20:08Z

    Fix OpWalkerVisitor for OpExt


> OpWalkerVisitor should interact better with custom operators
> ------------------------------------------------------------
>                 Key: JENA-1519
>                 URL: https://issues.apache.org/jira/browse/JENA-1519
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: ARQ
>    Affects Versions: Jena 3.6.0
>            Reporter: Jeremy Coulon
>            Priority: Major
> When visiting an OpExt, current implementation of OpWalkerVisitor is just 
> calling the visitor on opExt.effectiveOp().
> However if OpExt is replacing a sub-tree of the algebra instead of a single 
> leaf node, the sub-tree is ignored by walker.
> I found this bug when trying to execute a query with a MINUS operator with 
> either side of the operator being replaced by an custom operator.
> For example the following query is not working, if I transform both side of 
> MINUS with a custom operator:
> {{(project (?animal)}}
> {{  (minus}}
> {{    (bgp (triple ?animal rdf:type ex:Animal))}}
> {{    (filter (|| (= ?type ex:Reptile) (= ?type ex:Insect))}}
> {{      (bgp (triple ?animal rdf:type ?type)))))}}
> which I transform into:
> {{(project (?animal)}}
> {{  (minus}}
> {{    (op-ext )}}
> {{    (op-ext )))}}
> The reason is that MINUS is calling OpVars.visibleVars() which does not walk 
> into the subop of the filter.

This message was sent by Atlassian JIRA

Reply via email to