@@ -0,0 +1,2182 @@
+package owltools.gaf.lego;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport java.io.File;%0Aimport java.io.FileOutputStream;%0Aimport java.io.FileWriter;%0Aimport java.io.IOException;%0Aimport java.io.Writer;%0Aimport java.util.Map;%0Aimport java.util.Set;%0A%0Aimport org.apache.commons.io.FileUtils;%0Aimport org.apache.log4j.Level;%0Aimport org.apache.log4j.Logger;%0Aimport org.junit.Test;%0Aimport org.semanticweb.elk.owlapi.ElkReasonerFactory;%0Aimport org.semanticweb.owlapi.model.OWLClass;%0Aimport org.semanticweb.owlapi.model.OWLNamedIndividual;%0Aimport org.semanticweb.owlapi.model.OWLObject;%0Aimport org.semanticweb.owlapi.model.OWLOntology;%0Aimport org.semanticweb.owlapi.model.OWLOntologyStorageException;%0A%0Aimport owltools.OWLToolsTestBasics;%0Aimport owltools.gaf.GafDocument;%0Aimport owltools.gaf.GafObjectsBuilder;%0Aimport owltools.graph.OWLGraphWrapper;%0Aimport owltools.io.ParserWrapper;%0Aimport owltools.util.MinimalModelGeneratorTest;%0Aimport owltools.vocab.OBOUpperVocabulary;%0A%0Apublic class MolecularModelManagerGeneratorTest extends AbstractLegoModelGeneratorTest %7B%0A%09private static Logger LOG = Logger.getLogger(MolecularModelManagerGeneratorTest.class);%0A%0A%09MolecularModelManager mmm;%0A%0A%09static%7B%0A%09%09Logger.getLogger(%22org.semanticweb.elk%22).setLevel(Level.ERROR);%0A%09%09//Logger.getLogger(%22org.semanticweb.elk.reasoner.indexing.hierarchy%22).setLevel(Level.ERROR);%0A%09%7D%0A%0A%09@Test%0A%09public void testM3() throws Exception %7B%0A%09%09ParserWrapper pw = new ParserWrapper();%0A%09%09//w = new FileWriter(new File(%22target/lego.out%22));%0A%0A%09%09g = pw.parseToOWLGraph(getResourceIRIString(%22go-mgi-signaling-test.obo%22));%0A%09%09g.mergeOntology(pw.parseOBO(getResourceIRIString(%22disease.obo%22)));%0A%09%09//g.m%0A%0A%09%09mmm = new MolecularModelManager(g);%0A%09%09File gafPath = getResource(%22mgi-signaling.gaf%22);%0A%09%09mmm.loadGaf(%22mgi%22, gafPath);%0A%0A%09%09OWLClass p = g.getOWLClassByIdentifier(%22GO:0014029%22); // neural crest formation%0A%09%09String modelId = mmm.generateModel(p, %22mgi%22);%0A%09%09LOG.info(%22Model: %22+modelId);%0A%09%09LegoModelGenerator model = mmm.getModel(modelId);%0A%0A%09%09Set%3COWLNamedIndividual%3E inds = mmm.getIndividuals(modelId);%0A%09%09LOG.info(%22Individuals: %22+inds.size());%0A%09%09for (OWLNamedIndividual i : inds) %7B%0A%09%09%09LOG.info(%22I=%22+i);%0A%09%09%7D%0A%09%09assertTrue(inds.size() == 15);%0A%0A%09%0A%09%7D%0A%0A%0A%0A%0A%7D%0A

test for model manager