SpeciesSubsetterUtil { public void removeSpecies() { this.remove(false); } SpeciesSubsetterUtil(OWLGraphWrapper g);  SpeciesSubsetterUtil(OWLGraphWrapper g, boolean performMacroExpansion); void removeOtherSpecies(); void removeSpecies(); Collection<List<OWLObject>> explainTaxonConstraint(Collection<String> clsIds, 
	        Collection<String> taxonIds); public OWLReasoner reasoner; public OWLObjectProperty viewProperty; public OWLClass taxClass; public OWLClass rootClass; }
@Test public void testRemoveSpecies() throws Exception { OWLOntology owlOntology = new ParserWrapper().parse(getResourceIRIString("speciesRemoveTest.obo")); OWLDataFactory fac = owlOntology.getOWLOntologyManager().getOWLDataFactory(); OWLGraphWrapper graph = new OWLGraphWrapper(owlOntology); OWLReasonerFactory rf = new ElkReasonerFactory(); OWLReasoner reasoner = rf.createReasoner(graph.getSourceOntology()); SpeciesSubsetterUtil smu = new SpeciesSubsetterUtil(graph); smu.taxClass = graph.getOWLClassByIdentifier("T:2"); smu.reasoner = reasoner; smu.removeSpecies(); assertEquals("Incorrect number of classes", 10, graph.getAllRealOWLClasses().size()); assertNull(graph.getOWLClassByIdentifier("U:21")); assertNull(graph.getOWLClassByIdentifier("U:22")); assertNull(graph.getOWLClassByIdentifier("U:23")); assertNull(graph.getOWLClassByIdentifier("U:24")); assertTrue("OWL:Nothing incorrecty removed", owlOntology.containsClassInSignature(fac.getOWLNothing().getIRI())); owlOntology = new ParserWrapper().parse(getResourceIRIString("speciesRemoveTest.obo")); fac = owlOntology.getOWLOntologyManager().getOWLDataFactory(); graph = new OWLGraphWrapper(owlOntology); rf = new ElkReasonerFactory(); reasoner = rf.createReasoner(graph.getSourceOntology()); smu = new SpeciesSubsetterUtil(graph); smu.taxClass = graph.getOWLClassByIdentifier("T:3"); smu.reasoner = reasoner; smu.removeSpecies(); assertEquals("Incorrect number of classes", 11, graph.getAllRealOWLClasses().size()); assertNull(graph.getOWLClassByIdentifier("U:22")); assertNull(graph.getOWLClassByIdentifier("U:23")); assertNull(graph.getOWLClassByIdentifier("U:24")); assertTrue("OWL:Nothing incorrecty removed", owlOntology.containsClassInSignature(fac.getOWLNothing().getIRI())); owlOntology = new ParserWrapper().parse(getResourceIRIString("speciesRemoveTest.obo")); fac = owlOntology.getOWLOntologyManager().getOWLDataFactory(); graph = new OWLGraphWrapper(owlOntology); rf = new ElkReasonerFactory(); reasoner = rf.createReasoner(graph.getSourceOntology()); smu = new SpeciesSubsetterUtil(graph); smu.taxClass = graph.getOWLClassByIdentifier("T:1"); smu.reasoner = reasoner; smu.removeSpecies(); assertEquals("Incorrect number of classes", 14, graph.getAllRealOWLClasses().size()); assertTrue("OWL:Nothing incorrecty removed", owlOntology.containsClassInSignature(fac.getOWLNothing().getIRI())); }