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

QueryBuilder allows Node_Variable instances into QueryTripleIterator

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Jena 3.6.0
    • Jena 3.7.0
    • QueryBuilder
    • None

    Description

      Using Node_Variable instances in Quads and Triples to to methods results in Node_Variable instances appearing in the QueryTripleIterator.

      QueryTripleIterator at line 87 calls Var.isVar(node) which throws an exception if the node is a Node_Variable. But based code following line 87 I think that Node_Variable should be accepted.

              private static Node substitute(Node node, Binding binding)
              {
                  if ( Var.isVar(node) ) // <---- line 87
                  {
                      Node x = binding.get(Var.alloc(node)) ;
                      if ( x != null )
                          return x ;
                  }
                  return node ;
              }
      

      QueryTripleIterator is internal code and is only expecting Var instances. The solution is to fix the QueryBuilder code so that it only produces Var in the queries resulting from a build() execution.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: