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

Andy Seaborne commented on JENA-362:
------------------------------------

The current codebase has the changes applied.  I'm unclear what you are 
suggesting.  What could the code do? If O and S are null, calling (?,P,?) and 
filter for string objects is about the best that can happen as far as I am 
aware. Note: there is no indexing of L.

Do you have a proposal relative to the current codebase? 

(Even when O is null, there is an implicit "O is a string" condition in this 
call.)


> model.listStatements(s,p,o,lang) has problems when o or lang is null
> --------------------------------------------------------------------
>
>                 Key: JENA-362
>                 URL: https://issues.apache.org/jira/browse/JENA-362
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Jena
>    Affects Versions: Jena 2.7.4
>            Reporter: François-Paul Servant
>            Assignee: Andy Seaborne
>            Priority: Minor
>             Fix For: Jena 2.10.0
>
>         Attachments: ListStatementTest.java, ModelCom.java
>
>
> 1) model.listStatements(s,p,null,lang) doesn't filter on lang param
> 2) model.listStatements(s,p,o,null) only returns statements whose object has 
> lang "" (when o != null)
> TEST 1
> import org.junit.Test;
> import com.hp.hpl.jena.rdf.model.*;
> public class LstStmt1 {
>       @Test
>       public final void test() {
>               Model m = ModelFactory.createDefaultModel();
>               Resource s = m.createResource("http://www.a.com/s";);
>               Property p = m.createProperty("http://www.a.com/p";);
>               m.add(s,p,m.createResource("http://www.a.com/o";));
>               m.add(s,p,"texte","fr");
>               m.add(s,p,"text","en");
>               
>               StmtIterator it = m.listStatements(s, p, null,"en");
>               // list all the statements - not what one can expect
>               for (;it.hasNext();) {
>                       System.out.println(it.next());
>               }
>       }
> }
> TEST2
> public class LstStmt2 {
>       @Test
>       public final void test() {
>               Model m = ModelFactory.createDefaultModel();
>               Resource s = m.createResource("http://www.a.com/s";);
>               Property p = m.createProperty("http://www.a.com/p";);
>               m.add(s,p,"text","en");
>               m.add(s,p,"text");
>               
>               StmtIterator it = m.listStatements(s, p,"text",null);
>               // should list the 2 statements, but doesn't: only the one 
> without lang
>               for (;it.hasNext();) {
>                       System.out.println(it.next());
>               }
>       }
> }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to