com.clarkparsia.modularity
Class OntologyDiff

java.lang.Object
  extended by com.clarkparsia.modularity.OntologyDiff

public class OntologyDiff
extends java.lang.Object

Computes differences between two ontologies, sets of ontologies or collections of axioms.

Title:

Description:

Copyright: Copyright (c) 2009

Company: Clark & Parsia, LLC.

Author:
Evren Sirin

Method Summary
 boolean areSame()
          Checks whether the two compared ontologies were the same (i.e., there are no differences).
static OntologyDiff diffAxioms(java.util.Collection<org.semanticweb.owlapi.model.OWLAxiom> initialAxioms, java.util.Collection<org.semanticweb.owlapi.model.OWLAxiom> finalAxioms)
          Computes the difference between two sets of axioms.
static OntologyDiff diffAxiomsWithOntologies(java.util.Collection<org.semanticweb.owlapi.model.OWLAxiom> initialAxioms, java.util.Collection<org.semanticweb.owlapi.model.OWLOntology> finalOntologies)
          Computes the difference between a set of axioms and an ontology.
static OntologyDiff diffOntologies(org.semanticweb.owlapi.model.OWLOntology initialOnt, org.semanticweb.owlapi.model.OWLOntology finalOnt)
          Computes the difference between two ontologies.
static OntologyDiff diffOntologiesWithAxioms(java.util.Collection<org.semanticweb.owlapi.model.OWLOntology> initialOntologies, java.util.Collection<org.semanticweb.owlapi.model.OWLAxiom> finalAxioms)
          Computes the difference between a collection of ontologies and a collection of axioms
 java.util.Collection<org.semanticweb.owlapi.model.OWLAxiom> getAdditions()
          Gets the list of axioms that were added to the second ontology with respect to the first ontology.
 java.util.Collection<org.semanticweb.owlapi.model.OWLOntologyChange> getChanges(java.util.Collection<org.semanticweb.owlapi.model.OWLOntology> ontologies)
          Produces a list of ontology change objects that if applied to the set of initial ontologies, would convert that set of ontologies into the final ontology.
 java.util.Collection<org.semanticweb.owlapi.model.OWLOntologyChange> getChanges(org.semanticweb.owlapi.model.OWLOntology initialOnt)
          Produces a list of ontology change objects that if applied to the initial ontology, would convert that initial ontology into the final ontology.
 java.util.Collection<org.semanticweb.owlapi.model.OWLAxiom> getDeletions()
          Gets the list of axioms that were deleted in the second ontology with respect to the first ontology.
 int getDiffCount()
          Gets the number of differences (in terms of numbers of axioms) between the compared ontologies.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

diffOntologies

public static OntologyDiff diffOntologies(org.semanticweb.owlapi.model.OWLOntology initialOnt,
                                          org.semanticweb.owlapi.model.OWLOntology finalOnt)
Computes the difference between two ontologies.

Parameters:
initialOnt - the initial (first) ontology
finalOnt - the final (second or later) ontology
Returns:
the difference between the initial and final ontology

diffOntologiesWithAxioms

public static OntologyDiff diffOntologiesWithAxioms(java.util.Collection<org.semanticweb.owlapi.model.OWLOntology> initialOntologies,
                                                    java.util.Collection<org.semanticweb.owlapi.model.OWLAxiom> finalAxioms)
Computes the difference between a collection of ontologies and a collection of axioms

Parameters:
initialOntologies - the initial (first) ontologies
finalAxioms - the final set of axioms (the equivalent of second ontology)
Returns:
the difference in axioms

diffAxiomsWithOntologies

public static OntologyDiff diffAxiomsWithOntologies(java.util.Collection<org.semanticweb.owlapi.model.OWLAxiom> initialAxioms,
                                                    java.util.Collection<org.semanticweb.owlapi.model.OWLOntology> finalOntologies)
Computes the difference between a set of axioms and an ontology.

Parameters:
initialAxioms - the initial set of axioms (the equivalent of the first ontology)
finalOntologies - the final set of ontologies
Returns:
the difference in axioms

diffAxioms

public static OntologyDiff diffAxioms(java.util.Collection<org.semanticweb.owlapi.model.OWLAxiom> initialAxioms,
                                      java.util.Collection<org.semanticweb.owlapi.model.OWLAxiom> finalAxioms)
Computes the difference between two sets of axioms.

Parameters:
initialAxioms - the first (initial) set of axioms
finalAxioms - the second (final) set of axioms
Returns:
the difference between the sets of axioms

areSame

public boolean areSame()
Checks whether the two compared ontologies were the same (i.e., there are no differences).

Returns:
true if there were no differences between the compared ontologies, false otherwise

getDiffCount

public int getDiffCount()
Gets the number of differences (in terms of numbers of axioms) between the compared ontologies.

Returns:
the number of axioms that were different (or more exactly the number of axioms that were added plus the number of axioms that were removed).

getAdditions

public java.util.Collection<org.semanticweb.owlapi.model.OWLAxiom> getAdditions()
Gets the list of axioms that were added to the second ontology with respect to the first ontology.

Returns:
a set of axioms that existed in the second ontology, and did not exist in the first one.

getChanges

public java.util.Collection<org.semanticweb.owlapi.model.OWLOntologyChange> getChanges(org.semanticweb.owlapi.model.OWLOntology initialOnt)
Produces a list of ontology change objects that if applied to the initial ontology, would convert that initial ontology into the final ontology.

Parameters:
initialOnt - the initial ontology (just for the purposes of creating OWLOntologyChange objects).
Returns:
a list of ontology change objects.

getChanges

public java.util.Collection<org.semanticweb.owlapi.model.OWLOntologyChange> getChanges(java.util.Collection<org.semanticweb.owlapi.model.OWLOntology> ontologies)
Produces a list of ontology change objects that if applied to the set of initial ontologies, would convert that set of ontologies into the final ontology.

Parameters:
ontologies - the set of initial ontologies (just for the purposes of creating OWLOntologyChange objects)
Returns:
a list of ontology change objects.

getDeletions

public java.util.Collection<org.semanticweb.owlapi.model.OWLAxiom> getDeletions()
Gets the list of axioms that were deleted in the second ontology with respect to the first ontology.

Returns:
a set of axioms that existed in the first ontology, and do not exist in the second one.


Copyright © 2004 Evren Sirin. All Rights Reserved.