Search in sources :

Example 11 with CurieMappings

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;
}
Also used : MappedCurieHandler(org.geneontology.minerva.curie.MappedCurieHandler) CurieMappings(org.geneontology.minerva.curie.CurieMappings) MinervaOWLGraphWrapper(org.geneontology.minerva.MinervaOWLGraphWrapper) UndoAwareMolecularModelManager(org.geneontology.minerva.UndoAwareMolecularModelManager) InferenceProviderCreator(org.geneontology.minerva.server.inferences.InferenceProviderCreator) OWLObjectProperty(org.semanticweb.owlapi.model.OWLObjectProperty)

Aggregations

CurieMappings (org.geneontology.minerva.curie.CurieMappings)11 MappedCurieHandler (org.geneontology.minerva.curie.MappedCurieHandler)11 UndoAwareMolecularModelManager (org.geneontology.minerva.UndoAwareMolecularModelManager)7 File (java.io.File)6 ExternalLookupService (org.geneontology.minerva.lookup.ExternalLookupService)5 InferenceProviderCreator (org.geneontology.minerva.server.inferences.InferenceProviderCreator)5 Server (org.eclipse.jetty.server.Server)3 MinervaShexValidator (org.geneontology.minerva.server.validation.MinervaShexValidator)3 URL (java.net.URL)2 HttpConfiguration (org.eclipse.jetty.server.HttpConfiguration)2 HttpConnectionFactory (org.eclipse.jetty.server.HttpConnectionFactory)2 ServerConnector (org.eclipse.jetty.server.ServerConnector)2 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)2 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)2 CurieHandler (org.geneontology.minerva.curie.CurieHandler)2 DefaultCurieHandler (org.geneontology.minerva.curie.DefaultCurieHandler)2 GPADSPARQLExport (org.geneontology.minerva.legacy.sparql.GPADSPARQLExport)2 MinervaStartUpConfig (org.geneontology.minerva.server.StartUpTool.MinervaStartUpConfig)2 ResourceConfig (org.glassfish.jersey.server.ResourceConfig)2 ServletContainer (org.glassfish.jersey.servlet.ServletContainer)2