CloseableIteration<? extends Statement,SailException> createStatementIterator(Resource subj,IRI pred,Value obj,boolean explicit,Resource... contexts) throws IOException {
  int subjID=NativeValue.UNKNOWN_ID;
  if (subj != null) {
    subjID=valueStore.getID(subj);
    if (subjID == NativeValue.UNKNOWN_ID) {
      return new EmptyIteration<Statement,SailException>();
    }
  }
  int predID=NativeValue.UNKNOWN_ID;
  if (pred != null) {
    predID=valueStore.getID(pred);
    if (predID == NativeValue.UNKNOWN_ID) {
      return new EmptyIteration<Statement,SailException>();
    }
  }
  int objID=NativeValue.UNKNOWN_ID;
  if (obj != null) {
    objID=valueStore.getID(obj);
    if (objID == NativeValue.UNKNOWN_ID) {
      return new EmptyIteration<Statement,SailException>();
    }
  }
  List<Integer> contextIDList=new ArrayList<Integer>(contexts.length);
  if (contexts.length == 0) {
    contextIDList.add(NativeValue.UNKNOWN_ID);
  }
 else {
    for (    Resource context : contexts) {
      if (context == null) {
        contextIDList.add(0);
      }
 else {
        int contextID=valueStore.getID(context);
        if (contextID != NativeValue.UNKNOWN_ID) {
          contextIDList.add(contextID);
        }
      }
    }
  }
  ArrayList<NativeStatementIterator> perContextIterList=new ArrayList<NativeStatementIterator>(contextIDList.size());
  for (  int contextID : contextIDList) {
    RecordIterator btreeIter=tripleStore.getTriples(subjID,predID,objID,contextID,explicit,false);
    perContextIterList.add(new NativeStatementIterator(btreeIter,valueStore));
  }
  if (perContextIterList.size() == 1) {
    return perContextIterList.get(0);
  }
 else {
    return new UnionIteration<Statement,SailException>(perContextIterList);
  }
}

CloseableIteration < ? extends Statement , SailException > createStatementIterator ( Resource subj , IRI pred , Value obj , boolean explicit , Resource ... contexts ) throws IOException { int subjID = NativeValue . UNKNOWN_ID ; if ( subj != null ) { subjID = valueStore . getID ( subj ) ; if ( subjID == NativeValue . UNKNOWN_ID ) { return new EmptyIteration < Statement , SailException > ( ) ; } } int predID = NativeValue . UNKNOWN_ID ; if ( pred != null ) { predID = valueStore . getID ( pred ) ; if ( predID == NativeValue . UNKNOWN_ID ) { return new EmptyIteration < Statement , SailException > ( ) ; } } int objID = NativeValue . UNKNOWN_ID ; if ( obj != null ) { objID = valueStore . getID ( obj ) ; if ( objID == NativeValue . UNKNOWN_ID ) { return new EmptyIteration < Statement , SailException > ( ) ; } } List < Integer > contextIDList = new ArrayList < Integer > ( contexts . length ) ; if ( contexts . length == 0 ) { contextIDList . add ( NativeValue . UNKNOWN_ID ) ; } else { for ( Resource context : contexts ) { if ( context == null ) { contextIDList . add ( 0 ) ; } else { int contextID = valueStore . getID ( context ) ; if ( contextID != NativeValue . UNKNOWN_ID ) { contextIDList . add ( contextID ) ; } } } } ArrayList < NativeStatementIterator > perContextIterList = new ArrayList < NativeStatementIterator > ( contextIDList . size ( ) ) ; for ( int contextID : contextIDList ) { RecordIterator btreeIter = tripleStore . getTriples ( subjID , predID , objID , contextID , explicit , false ) ; perContextIterList . add ( new NativeStatementIterator ( btreeIter , valueStore ) ) ; } if ( perContextIterList . size ( ) == 1 ) { return perContextIterList . get ( 0 ) ; } else { return new UnionIteration < Statement , SailException > ( perContextIterList ) ; } }
creates a statement iterator based on the supplied pattern .
