@Test public void testOWLOntologyChangeHashCode() { OWLOntology ont = this.graphManipulator.getOwlGraphWrapper().getSourceOntology(); OWLDataFactory factory = this.graphManipulator.getOwlGraphWrapper(). getManager().getOWLDataFactory(); OWLClass source = this.graphManipulator.getOwlGraphWrapper().getOWLClassByIdentifier("FOO:0005"); OWLClass target = this.graphManipulator.getOwlGraphWrapper().getOWLClassByIdentifier("FOO:0001"); OWLGraphEdge checkEdge = new OWLGraphEdge(source, target, ont); OWLAxiom axiom = factory.getOWLSubClassOfAxiom(source, (OWLClassExpression) this.graphManipulator.getOwlGraphWrapper(). edgeToTargetExpression(checkEdge)); OWLAxiomChange rm1 = new RemoveAxiom(ont, axiom); OWLGraphEdge checkEdge2 = new OWLGraphEdge(source, target, ont); OWLAxiom axiom2 = factory.getOWLSubClassOfAxiom(source, (OWLClassExpression) this.graphManipulator.getOwlGraphWrapper(). edgeToTargetExpression(checkEdge2)); OWLAxiomChange rm2 = new RemoveAxiom(ont, axiom2); assertTrue("The two OWLAxiomChange objects are equal", rm1.equals(rm2)); assertTrue("Two OWLAxiomChange are equal but have different hashcode", rm1.equals(rm2) && rm1.hashCode() == rm2.hashCode()); source = this.graphManipulator.getOwlGraphWrapper().getOWLClassByIdentifier("FOO:0014"); target = this.graphManipulator.getOwlGraphWrapper().getOWLClassByIdentifier("FOO:0001"); checkEdge = new OWLGraphEdge(source, target, ont); axiom = factory.getOWLSubClassOfAxiom(source, (OWLClassExpression) this.graphManipulator.getOwlGraphWrapper(). edgeToTargetExpression(checkEdge)); OWLAxiomChange rm3 = new RemoveAxiom(ont, axiom); assertFalse("Different OWLAxiomChange objects are equal", rm1.equals(rm3)); assertFalse("Different OWLAxiomChanges have same hashcode", rm1.hashCode() == rm3.hashCode()); }
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();  }