use of org.geneontology.minerva.curie.CurieMappings in project minerva by geneontology.
the class BatchModelHandlerTest method init.
static void init(ParserWrapper pw) throws OWLOntologyCreationException, IOException, UnknownIdentifierException {
final MinervaOWLGraphWrapper graph = pw.parseToOWLGraph("src/test/resources/go-lego-minimal.owl");
final OWLObjectProperty legorelParent = StartUpTool.getRelation("http://purl.obolibrary.org/obo/LEGOREL_0000000", graph);
assertNotNull(legorelParent);
importantRelations = StartUpTool.getAssertedSubProperties(legorelParent, graph);
assertFalse(importantRelations.isEmpty());
// curie handler
final String modelIdcurie = "gomodel";
final String modelIdPrefix = "http://model.geneontology.org/";
final CurieMappings localMappings = new CurieMappings.SimpleCurieMappings(Collections.singletonMap(modelIdcurie, modelIdPrefix));
curieHandler = new MappedCurieHandler(DefaultCurieHandler.loadDefaultMappings(), localMappings);
InferenceProviderCreator ipc = CachingInferenceProviderCreatorImpl.createElk(false, null);
models = new UndoAwareMolecularModelManager(graph.getSourceOntology(), curieHandler, modelIdPrefix, folder.newFile().getAbsolutePath(), null, ontology_journal_file, true);
lookupService = createTestProteins(curieHandler);
handler = new JsonOrJsonpBatchHandler(models, "development", ipc, importantRelations, lookupService) {
@Override
protected String generateDateString() {
// hook for overriding the date generation with a custom counter
if (dateGenerator.useCounter) {
int count = dateGenerator.counter;
dateGenerator.counter += 1;
return Integer.toString(count);
}
return super.generateDateString();
}
};
JsonOrJsonpBatchHandler.VALIDATE_BEFORE_SAVE = true;
}
Aggregations