You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by osma <gi...@git.apache.org> on 2016/01/04 08:40:21 UTC

[GitHub] jena pull request: JENA-1093: return multiple literals from text q...

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

    https://github.com/apache/jena/pull/112#discussion_r48709186
  
    --- 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 --
    
    @afs That was exactly my intent - to fix the functionality in master first (and verify with unit tests), then continue with the cache. I just wanted to point out that the lines for which @ajs6f suggested another formulation are likely to be short-lived.
    
    I will merge this soon if there are no other comments.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---