You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Claude Warren (JIRA)" <ji...@apache.org> on 2019/08/08 13:31:00 UTC

[jira] [Commented] (JENA-1739) Using Path in UpdateBuilder#addWhere throws an Exception

    [ https://issues.apache.org/jira/browse/JENA-1739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16902981#comment-16902981 ] 

Claude Warren commented on JENA-1739:
-------------------------------------

This is a but isolated to the UpdateBuilder.  Code needs to be added to test for predicate being an path object for 3-argument methods addWhere, addOptional and addDelete as well as the 4-argument addDelete method.

For completeness 4 methods should be added addDeletePath( Iterator<TriplePath> ), addDeletePath( Collection<TriplePath> ) , addInsertPath( Iterator<TriplePath> ) and addInsertPath( Collection<TriplePath> )




> Using Path in UpdateBuilder#addWhere throws an Exception
> --------------------------------------------------------
>
>                 Key: JENA-1739
>                 URL: https://issues.apache.org/jira/browse/JENA-1739
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: ARQ
>    Affects Versions: Jena 3.10.0
>            Reporter: Vadim Gubin
>            Assignee: Claude Warren
>            Priority: Major
>
> java.lang.IllegalArgumentException: Predicate ("[some path here, for example (S|^S)/((S|^S))?]"^^java:org.apache.jena.sparql.path.P_Seq) must be a Path, URI , variable, or a wildcard. 
> Is a prefix missing? Prefix must be defined before use.
>  at org.apache.jena.arq.querybuilder.updatebuilder.WhereQuadHolder.testTriple(WhereQuadHolder.java:190)
>  at org.apache.jena.arq.querybuilder.updatebuilder.WhereQuadHolder.addWhere(WhereQuadHolder.java:204)
>  at org.apache.jena.arq.querybuilder.UpdateBuilder.addWhere(UpdateBuilder.java:813)
>  at org.apache.jena.arq.querybuilder.UpdateBuilder.addWhere(UpdateBuilder.java:983)
>  at org.apache.jena.arq.querybuilder.UpdateBuilder.addWhere(UpdateBuilder.java:1012)
>  
> h4. How to reproduce:
> Path path = createSomePath()...
> UpdateRequest update = new UpdateRequest(new UpdateBuilder()
> .addWhere(subject, path, object)
> .build());
>  
> RDFConnectionRemoteBuilder connectionBuilder = connectionBuilderFactory.createConnectionBuilder();
> try (RDFConnection connection = connectionBuilder.build()) {
>  connection.update(update);
> }
> h4. Workaround:
> .addWhere(new TriplePath(subject, path, object));



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)