@Test public void regressionTestAxiomRelaxation() throws OWLOntologyCreationException, OBOFormatParserException, IOException { log.debug("Loading ontology for testing axiom relaxation at instantiation..."); ParserWrapper parserWrapper = new ParserWrapper(); OWLOntology ont = parserWrapper.parse( this.getClass().getResource("/graph/relaxAxiomsTest.owl").getFile()); log.debug("Done loading the ontology."); log.debug("Loading the ontology into OWLGraphManipulator, testing default operations..."); this.graphManipulator = new OWLGraphManipulator(new OWLGraphWrapper(ont)); log.debug("Default operations done."); assertEquals("Some EquivalentClassesAxioms were not removed", 0, ont.getAxiomCount(AxiomType.EQUIVALENT_CLASSES)); for (OWLSubClassOfAxiom ax: ont.getAxioms(AxiomType.SUBCLASS_OF)) { for (OWLClassExpression ce: ax.getNestedClassExpressions()) { if (ce instanceof OWLObjectIntersectionOf || ce instanceof OWLObjectUnionOf) { throw new AssertionError("An OWLObjectIntersectionOf or " + "OWLObjectUnionOf was not removed: " + ax); } } } OWLDataFactory factory = ont.getOWLOntologyManager().getOWLDataFactory(); OWLObjectProperty partOf = this.graphManipulator.getOwlGraphWrapper(). getOWLObjectPropertyByIdentifier("BFO:0000050"); OWLGraphWrapper wrapper = this.graphManipulator.getOwlGraphWrapper(); Set<OWLAxiom> expectedAxioms = new HashSet<OWLAxiom>(); expectedAxioms.add(factory.getOWLSubClassOfAxiom( wrapper.getOWLClass("http: factory.getOWLObjectSomeValuesFrom(partOf, wrapper.getOWLClass("http: expectedAxioms.add(factory.getOWLSubClassOfAxiom( wrapper.getOWLClass("http: factory.getOWLObjectSomeValuesFrom(partOf, wrapper.getOWLClass("http: expectedAxioms.add(factory.getOWLSubClassOfAxiom( wrapper.getOWLClass("http: wrapper.getOWLClass("http: expectedAxioms.add(factory.getOWLSubClassOfAxiom( wrapper.getOWLClass("http: wrapper.getOWLClass("http: assertEquals("Axioms from import ontology incorrectly merged", expectedAxioms, ont.getAxioms(wrapper.getOWLClass("http: }
public OWLGraphWrapper getOwlGraphWrapper() { return this.owlGraphWrapper; }
OWLGraphManipulator { public OWLGraphWrapper getOwlGraphWrapper() { return this.owlGraphWrapper; } }
OWLGraphManipulator { public OWLGraphWrapper getOwlGraphWrapper() { return this.owlGraphWrapper; } @SuppressWarnings("unused") private  OWLGraphManipulator();  OWLGraphManipulator(OWLOntology ont);  OWLGraphManipulator(OWLGraphWrapper owlGraphWrapper);  OWLGraphManipulator(OWLGraphWrapper owlGraphWrapper, boolean performDefaultModifs); }
OWLGraphManipulator { public OWLGraphWrapper getOwlGraphWrapper() { return this.owlGraphWrapper; } @SuppressWarnings("unused") private  OWLGraphManipulator();  OWLGraphManipulator(OWLOntology ont);  OWLGraphManipulator(OWLGraphWrapper owlGraphWrapper);  OWLGraphManipulator(OWLGraphWrapper owlGraphWrapper, boolean performDefaultModifs); void makeSimpleOntology(); void simplifies(Collection<String> classIdsToRemove, Collection<String> relIds, 
            Collection<String> toRemoveSubgraphRootIds,
            Collection<String> toFilterSubgraphRootIds,   
            Collection<String> subsetNames); int reduceRelations(); int reducePartOfIsARelations(); int removeClassAndPropagateEdges(String classToRemoveId); int mapRelationsToParent(Collection<String> parentRelations); int mapRelationsToParent(Collection<String> parentRelations, 
    		Collection<String> relsExcluded); Set<String> filterSubgraphs(Collection<String> allowedSubgraphRootIds); Set<String> removeSubgraphs(Collection<String> subgraphRootIds, 
            boolean keepSharedClasses); Set<String> removeSubgraphs(Collection<String> subgraphRootIds, 
            boolean keepSharedClasses, Collection<String> allowedSubgraphRootIds); int filterRelations(Collection<String> allowedRels, boolean allowSubRels); void removeUnrelatedRelations(Collection<String> allowedRels); int removeRelations(Collection<String> forbiddenRels, boolean forbidSubRels); int removeRelsToSubsets(Collection<String> subsets); int removeRelsToSubsets(Collection<String> subsets, 
	        Collection<String> classIdsExcluded); int removeDirectEdgesBetween(String sourceId, String targetId); boolean removeEdge(OWLGraphEdge edge); int removeEdges(Collection<OWLGraphEdge> edges); boolean addEdge(OWLGraphEdge edge); int addEdges(Set<OWLGraphEdge> edges); boolean removeClass(OWLClass classToDel); Set<OWLClass> removeClasses(Set<OWLClass> classesToDel); Set<OWLClass> filterClasses(Set<OWLClass> classesToKeep); boolean isASubClassOfEdge(OWLGraphEdge edge); boolean isAPartOfEdge(OWLGraphEdge edge); OWLGraphWrapper getOwlGraphWrapper(); }
OWLGraphManipulator { public OWLGraphWrapper getOwlGraphWrapper() { return this.owlGraphWrapper; } @SuppressWarnings("unused") private  OWLGraphManipulator();  OWLGraphManipulator(OWLOntology ont);  OWLGraphManipulator(OWLGraphWrapper owlGraphWrapper);  OWLGraphManipulator(OWLGraphWrapper owlGraphWrapper, boolean performDefaultModifs); void makeSimpleOntology(); void simplifies(Collection<String> classIdsToRemove, Collection<String> relIds, 
            Collection<String> toRemoveSubgraphRootIds,
            Collection<String> toFilterSubgraphRootIds,   
            Collection<String> subsetNames); int reduceRelations(); int reducePartOfIsARelations(); int removeClassAndPropagateEdges(String classToRemoveId); int mapRelationsToParent(Collection<String> parentRelations); int mapRelationsToParent(Collection<String> parentRelations, 
    		Collection<String> relsExcluded); Set<String> filterSubgraphs(Collection<String> allowedSubgraphRootIds); Set<String> removeSubgraphs(Collection<String> subgraphRootIds, 
            boolean keepSharedClasses); Set<String> removeSubgraphs(Collection<String> subgraphRootIds, 
            boolean keepSharedClasses, Collection<String> allowedSubgraphRootIds); int filterRelations(Collection<String> allowedRels, boolean allowSubRels); void removeUnrelatedRelations(Collection<String> allowedRels); int removeRelations(Collection<String> forbiddenRels, boolean forbidSubRels); int removeRelsToSubsets(Collection<String> subsets); int removeRelsToSubsets(Collection<String> subsets, 
	        Collection<String> classIdsExcluded); int removeDirectEdgesBetween(String sourceId, String targetId); boolean removeEdge(OWLGraphEdge edge); int removeEdges(Collection<OWLGraphEdge> edges); boolean addEdge(OWLGraphEdge edge); int addEdges(Set<OWLGraphEdge> edges); boolean removeClass(OWLClass classToDel); Set<OWLClass> removeClasses(Set<OWLClass> classesToDel); Set<OWLClass> filterClasses(Set<OWLClass> classesToKeep); boolean isASubClassOfEdge(OWLGraphEdge edge); boolean isAPartOfEdge(OWLGraphEdge edge); OWLGraphWrapper getOwlGraphWrapper();  }