org.dllearner.tools.ore
Class OntologyModifier

java.lang.Object
  extended by org.dllearner.tools.ore.OntologyModifier

public class OntologyModifier
extends Object

This class provides several methods to modify the ontology by using OWL-API.

Author:
Lorenz Buehmann

Constructor Summary
OntologyModifier(ReasonerComponent reasoner, ReasonerComponent rs)
           
 
Method Summary
 org.semanticweb.owl.model.OWLOntologyChange addAxiomToOWL(Description newDesc, Description oldDesc)
          Adds an EquivalentClassesAxiom axiom to the ontology.
 List<org.semanticweb.owl.model.OWLOntologyChange> addClassAssertion(Individual ind, Description desc)
          Adds a classAssertion.
 List<org.semanticweb.owl.model.OWLOntologyChange> addObjectProperty(Individual subInd, ObjectQuantorRestriction objSome, Individual objInd)
          Adds an object property assertion to the ontology.
 List<org.semanticweb.owl.model.OWLOntologyChange> deleteIndividual(Individual ind)
          Deletes the complete individual from the ontology.
 List<org.semanticweb.owl.model.OWLOntologyChange> deleteObjectProperty(Individual ind, ObjectQuantorRestriction objSome)
          Removes all object property assertions with role, and it's inverse.
 Set<ObjectPropertyAssertion> getObjectProperties(Individual ind)
          Returns object properties for an individual.
 org.semanticweb.owl.model.OWLOntology getOntology()
          Returns the actual ontology.
 boolean isComplement(Description desc1, Description desc2)
          checks whether desc1 and desc2 are disjoint.
 List<org.semanticweb.owl.model.OWLOntologyChange> moveIndividual(Individual ind, Description oldClass, Description newClass)
          Removes classAssertion between individual to a old class, and creates a new classAssertion.
 void reason()
          Prints reasons for inconsistent classes.
 List<org.semanticweb.owl.model.OWLOntologyChange> removeClassAssertion(Individual ind, Description desc)
          Removes a classAssertion.
 List<org.semanticweb.owl.model.OWLOntologyChange> removeObjectPropertyAssertion(Individual subject, ObjectQuantorRestriction objSome, Individual object)
          Removes an object property assertion from the ontology if the axiom is existing in the ontology.
 List<org.semanticweb.owl.model.OWLOntologyChange> rewriteClassDescription(Description newDesc, Description oldClass)
          Rewrite ontology by replacing old class with new learned class description.
 void saveOntology()
          Saves the ontology as RDF-file.
 void undoChanges(Collection<org.semanticweb.owl.model.OWLOntologyChange> changes)
          undo changes of type OWLOntologyChange.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntologyModifier

public OntologyModifier(ReasonerComponent reasoner,
                        ReasonerComponent rs)
Method Detail

addAxiomToOWL

public org.semanticweb.owl.model.OWLOntologyChange addAxiomToOWL(Description newDesc,
                                                                 Description oldDesc)
Adds an EquivalentClassesAxiom axiom to the ontology.

Parameters:
newDesc - new axiom to add
oldDesc - old description

rewriteClassDescription

public List<org.semanticweb.owl.model.OWLOntologyChange> rewriteClassDescription(Description newDesc,
                                                                                 Description oldClass)
Rewrite ontology by replacing old class with new learned class description.

Parameters:
newDesc -
oldClass -

saveOntology

public void saveOntology()
Saves the ontology as RDF-file.


deleteIndividual

public List<org.semanticweb.owl.model.OWLOntologyChange> deleteIndividual(Individual ind)
Deletes the complete individual from the ontology.

Parameters:
ind - the individual to delete

removeClassAssertion

public List<org.semanticweb.owl.model.OWLOntologyChange> removeClassAssertion(Individual ind,
                                                                              Description desc)
Removes a classAssertion.

Parameters:
ind - the individual which has to removed from class
desc - the class to which the individual is asserted
Returns:
changes that have been done

addClassAssertion

public List<org.semanticweb.owl.model.OWLOntologyChange> addClassAssertion(Individual ind,
                                                                           Description desc)
Adds a classAssertion.

Parameters:
ind - the individual which has to be asserted to class
desc - the class to which the individual has to be asserted
Returns:
changes that have been done

moveIndividual

public List<org.semanticweb.owl.model.OWLOntologyChange> moveIndividual(Individual ind,
                                                                        Description oldClass,
                                                                        Description newClass)
Removes classAssertion between individual to a old class, and creates a new classAssertion.

Parameters:
ind - individual which has to be moved
oldClass - class where individual is asserted before
newClass - class where individual is moved to
Returns:
changes that have been done

deleteObjectProperty

public List<org.semanticweb.owl.model.OWLOntologyChange> deleteObjectProperty(Individual ind,
                                                                              ObjectQuantorRestriction objSome)
Removes all object property assertions with role, and it's inverse.

Parameters:
ind - the individual which property has to be removed
objSome - the property which has to be removed
Returns:
changes that have been done

removeObjectPropertyAssertion

public List<org.semanticweb.owl.model.OWLOntologyChange> removeObjectPropertyAssertion(Individual subject,
                                                                                       ObjectQuantorRestriction objSome,
                                                                                       Individual object)
Removes an object property assertion from the ontology if the axiom is existing in the ontology.

Parameters:
subject -
objSome -
object -
Returns:
changes that have been done

addObjectProperty

public List<org.semanticweb.owl.model.OWLOntologyChange> addObjectProperty(Individual subInd,
                                                                           ObjectQuantorRestriction objSome,
                                                                           Individual objInd)
Adds an object property assertion to the ontology.

Parameters:
subInd - the individual which is subject in the objectProperty
objSome - the property which has to be added to subject
objInd - the individual which is object in the objectProperty
Returns:
changes that have been done

undoChanges

public void undoChanges(Collection<org.semanticweb.owl.model.OWLOntologyChange> changes)
undo changes of type OWLOntologyChange.

Parameters:
changes -

isComplement

public boolean isComplement(Description desc1,
                            Description desc2)
checks whether desc1 and desc2 are disjoint.

Parameters:
desc1 - class 1
desc2 - class 2

getObjectProperties

public Set<ObjectPropertyAssertion> getObjectProperties(Individual ind)
Returns object properties for an individual.

Parameters:
ind -

getOntology

public org.semanticweb.owl.model.OWLOntology getOntology()
Returns the actual ontology.

Returns:
ontology

reason

public void reason()
Prints reasons for inconsistent classes.



SourceForge.net Logo DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2008 Jens Lehmann