Github user ajs6f commented on a diff in the pull request:

    https://github.com/apache/jena/pull/112#discussion_r48286947
  
    --- Diff: 
jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java ---
    @@ -210,44 +212,36 @@ private QueryIterator variableSubject(Binding 
binding, Node s, Node score, Node
                 return bmap;
             } ;
             
    -        Iterator<Binding> bIter = Iter.map(r.iterator(), converter);
    +        Iterator<Binding> bIter = Iter.map(results.iterator(), converter);
             QueryIterator qIter = new QueryIterPlainWrapper(bIter, execCxt);
             return qIter ;
         }
     
    +    private QueryIterator variableSubject(Binding binding, Node s, Node 
score, Node literal, StrMatch match, ExecutionContext execCxt) {
    +        List<TextHit> r = query(match.getProperty(), 
match.getQueryString(), match.getLimit(), execCxt) ;
    +        return resultsToQueryIterator(binding, s, score, literal, r, 
execCxt);
    +    }
    +
         private QueryIterator concreteSubject(Binding binding, Node s, Node 
score, Node literal, StrMatch match, ExecutionContext execCxt) {
             if (!s.isURI()) {
                 log.warn("Subject not a URI: " + s) ;
                 return IterLib.noResults(execCxt) ;
             }
     
    -        Var scoreVar = (score==null) ? null : Var.alloc(score) ;
    -        Var literalVar = (literal==null) ? null : Var.alloc(literal) ;
             String qs = match.getQueryString() ;
             List<TextHit> x = query(match.getProperty(), 
match.getQueryString(), -1, execCxt) ;
             
             if ( x == null ) // null return value - empty result
                 return IterLib.noResults(execCxt) ;
             
    +        List<TextHit> r = new LinkedList();
    --- End diff --
    
    You might or might not like this style more, but you could do this with a 
filter:
    ```
    List<TextHit> r = x.stream().filter(hit -> 
hit.getNode().equals(s)).collect(Collectors.toList());
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to