public void populatePcj(final Connector accumuloConn,final String pcjTableName,final RepositoryConnection ryaConn) throws PCJStorageException {
  checkNotNull(accumuloConn);
  checkNotNull(pcjTableName);
  checkNotNull(ryaConn);
  try {
    final PcjMetadata pcjMetadata=getPcjMetadata(accumuloConn,pcjTableName);
    final String sparql=pcjMetadata.getSparql();
    final TupleQuery query=ryaConn.prepareTupleQuery(QueryLanguage.SPARQL,sparql);
    final TupleQueryResult results=query.evaluate();
    final Set<VisibilityBindingSet> batch=new HashSet<>(1000);
    while (results.hasNext()) {
      batch.add(new VisibilityBindingSet(results.next()));
      if (batch.size() == 1000) {
        addResults(accumuloConn,pcjTableName,batch);
        batch.clear();
      }
    }
    if (!batch.isEmpty()) {
      addResults(accumuloConn,pcjTableName,batch);
    }
  }
 catch (  RepositoryException|MalformedQueryException|QueryEvaluationException e) {
    throw new PCJStorageException("Could not populate a PCJ table with Rya results for the table named: " + pcjTableName,e);
  }
}

public void populatePcj ( final Connector accumuloConn , final String pcjTableName , final RepositoryConnection ryaConn ) throws PCJStorageException { checkNotNull ( accumuloConn ) ; checkNotNull ( pcjTableName ) ; checkNotNull ( ryaConn ) ; try { final PcjMetadata pcjMetadata = getPcjMetadata ( accumuloConn , pcjTableName ) ; final String sparql = pcjMetadata . getSparql ( ) ; final TupleQuery query = ryaConn . prepareTupleQuery ( QueryLanguage . SPARQL , sparql ) ; final TupleQueryResult results = query . evaluate ( ) ; final Set < VisibilityBindingSet > batch = new HashSet < > ( 1000 ) ; while ( results . hasNext ( ) ) { batch . add ( new VisibilityBindingSet ( results . next ( ) ) ) ; if ( batch . size ( ) == 1000 ) { addResults ( accumuloConn , pcjTableName , batch ) ; batch . clear ( ) ; } } if ( ! batch . isEmpty ( ) ) { addResults ( accumuloConn , pcjTableName , batch ) ; } } catch ( RepositoryException | MalformedQueryException | QueryEvaluationException e ) { throw new PCJStorageException ( "Could not populate a PCJ table with Rya results for the table named: " + pcjTableName , e ) ; } }
scan rya for results that solve the pcj ' s query and store them in the pcj table . < p > this method assumes the pcj table has already been created .
