Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-1739

Using Path in UpdateBuilder#addWhere throws an Exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 3.10.0
    • Jena 3.13.0
    • ARQ
    • None

    Description

      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)

       

      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); }

      Workaround:

      .addWhere(new TriplePath(subject, path, object));

      Attachments

        Activity

          People

            claude Claude Warren
            vgubin Vadim Gubin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: