static public List<KeyParts> keyPartsForQuery(final TemporalInstant queryInstant,final StatementConstraints contraints){
  final List<KeyParts> keys=new LinkedList<KeyParts>();
  final URI urlNull=new URIImpl("urn:null");
  final Resource currentContext=contraints.getContext();
  final boolean hasSubj=contraints.hasSubject();
  if (contraints.hasPredicates()) {
    for (    final URI nextPredicate : contraints.getPredicates()) {
      final Text contraintPrefix=new Text();
      final Statement statement=new ContextStatementImpl(hasSubj ? contraints.getSubject() : urlNull,nextPredicate,urlNull,contraints.getContext());
      if (hasSubj) {
        appendSubjectPredicate(statement,contraintPrefix);
      }
 else {
        appendPredicate(statement,contraintPrefix);
      }
      keys.add(new KeyParts(contraintPrefix,queryInstant,(currentContext == null) ? "" : currentContext.toString(),hasSubj ? CQ_S_P_AT : CQ_P_AT));
    }
  }
 else   if (contraints.hasSubject()) {
    final Text contraintPrefix=new Text();
    final Statement statement=new StatementImpl(contraints.getSubject(),urlNull,urlNull);
    appendSubject(statement,contraintPrefix);
    keys.add(new KeyParts(contraintPrefix,queryInstant,(currentContext == null) ? "" : currentContext.toString(),CQ_S_AT));
  }
 else {
    keys.add(new KeyParts(null,queryInstant,(currentContext == null) ? "" : currentContext.toString(),CQ_O_AT));
  }
  return keys;
}

static public List < KeyParts > keyPartsForQuery ( final TemporalInstant queryInstant , final StatementConstraints contraints ) { final List < KeyParts > keys = new LinkedList < KeyParts > ( ) ; final URI urlNull = new URIImpl ( "urn:null" ) ; final Resource currentContext = contraints . getContext ( ) ; final boolean hasSubj = contraints . hasSubject ( ) ; if ( contraints . hasPredicates ( ) ) { for ( final URI nextPredicate : contraints . getPredicates ( ) ) { final Text contraintPrefix = new Text ( ) ; final Statement statement = new ContextStatementImpl ( hasSubj ? contraints . getSubject ( ) : urlNull , nextPredicate , urlNull , contraints . getContext ( ) ) ; if ( hasSubj ) { appendSubjectPredicate ( statement , contraintPrefix ) ; } else { appendPredicate ( statement , contraintPrefix ) ; } keys . add ( new KeyParts ( contraintPrefix , queryInstant , ( currentContext == null ) ? "" : currentContext . toString ( ) , hasSubj ? CQ_S_P_AT : CQ_P_AT ) ) ; } } else if ( contraints . hasSubject ( ) ) { final Text contraintPrefix = new Text ( ) ; final Statement statement = new StatementImpl ( contraints . getSubject ( ) , urlNull , urlNull ) ; appendSubject ( statement , contraintPrefix ) ; keys . add ( new KeyParts ( contraintPrefix , queryInstant , ( currentContext == null ) ? "" : currentContext . toString ( ) , CQ_S_AT ) ) ; } else { keys . add ( new KeyParts ( null , queryInstant , ( currentContext == null ) ? "" : currentContext . toString ( ) , CQ_O_AT ) ) ; } return keys ; }
list all the index keys to find for any query . set the strategy via the column qualifier , ex : cq_s_p_at . column family ( cf ) is the context / named - graph .
