Hi,

lisStatements(Resource, Property, String, String) doesn't take the forth arg 
into account when the third one is null (in other words: it can't be used to 
select statements with a given subject, property and literal's language)

import org.junit.Test;
import com.hp.hpl.jena.rdf.model.*;

public class LstStmt {
        @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";);
                Property o = m.createProperty("http://www.a.com/o";);
                m.add(s,p,o);
                m.add(s,p,"texte","fr");
                m.add(s,p,"text","en");
                
                StmtIterator it = m.listStatements(s, p, null,"fr");
                // display the 3 statements
                for (;it.hasNext();) {
                        System.out.println(it.next());
                }
        }
}

I hadn't noticed it, and I'm suprised. Tested with jena 2.7.4 and 2.6.4

Best

fps




Reply via email to