// start for each type of the keys a different context
final String directory = base_dir + keyType;
final BasicIndexQueryEvaluator evaluator = Endpoint.createQueryEvaluator(directory);
// evaluate context for SPARQL query processing...
Endpoint.registerHandler("/sparql/" + keyType, new SPARQLHandler(new SPARQLExecutionImplementation(evaluator, directory)));
final RDF3XCreator creator = new RDF3XCreator();
// register context for evaluating subgraphs...
Endpoint.registerHandler("/sparql/subgraph/" + keyType, new SPARQLHandler(new SubgraphExecutionImplementation(evaluator, directory, creator)));