uk.ac.manchester.cs.owl
Class OWLOntologyImpl

java.lang.Object
  extended by uk.ac.manchester.cs.owl.OWLObjectImpl
      extended by uk.ac.manchester.cs.owl.OWLOntologyImpl
All Implemented Interfaces:
java.lang.Comparable<OWLObject>, OWLMutableOntology, OWLNamedObject, OWLObject, OWLOntology

public class OWLOntologyImpl
extends OWLObjectImpl
implements OWLMutableOntology

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 26-Oct-2006


Constructor Summary
OWLOntologyImpl(OWLDataFactory dataFactory, java.net.URI uri)
           
 
Method Summary
 void accept(OWLNamedObjectVisitor visitor)
           
 void accept(OWLObjectVisitor visitor)
           
<O> O
accept(OWLObjectVisitorEx<O> visitor)
           
 java.util.List<OWLOntologyChange> applyChange(OWLOntologyChange change)
           
 java.util.List<OWLOntologyChange> applyChanges(java.util.List<OWLOntologyChange> changes)
           
 boolean containsAxiom(OWLAxiom axiom)
          Determines if this ontology contains the specified axiom.
 boolean containsClassReference(java.net.URI owlClassURI)
          Determines if the ontology contains a reference to a class that has a specific URI.
 boolean containsDataPropertyReference(java.net.URI propURI)
          Determines if the ontology contains a reference to a data property that has a specific URI.
 boolean containsDataTypeReference(java.net.URI datatypeURI)
           
 boolean containsEntityDeclaration(OWLEntity owlEntity)
          Determines if this ontology contains a declaration axiom for the specified entity.
 boolean containsEntityReference(OWLEntity owlEntity)
          Determines if the ontology contains a reference to the specified entity.
 boolean containsIndividualReference(java.net.URI individualURI)
          Determines if the ontology contains a reference to an individual that has a specific URI.
 boolean containsObjectPropertyReference(java.net.URI propURI)
          Determines if the ontology contains a reference to an object property that has a specific URI.
 boolean containsReference(OWLClass owlClass)
           
 boolean containsReference(OWLDataProperty prop)
           
 boolean containsReference(OWLDataType dt)
           
 boolean containsReference(OWLIndividual ind)
           
 boolean containsReference(OWLObjectProperty prop)
           
 boolean equals(java.lang.Object obj)
           
 java.util.Set<OWLAnnotationAxiom> getAnnotationAxioms()
          Gets all of the annotation axioms in this ontology.
 java.util.Set<OWLAxiomAnnotationAxiom> getAnnotations(OWLAxiom axiom)
          Gets the annotation axioms that annotate the specified axiom in this ontology.
 java.util.Set<OWLOntologyAnnotationAxiom> getAnnotations(OWLOntology ontology)
          Gets the annotations whose subject is this ontology - i.e.
 java.util.Set<java.net.URI> getAnnotationURIs()
          Gets the set of URIs that are used in annotations (e.g.
 OWLAntiSymmetricObjectPropertyAxiom getAntiSymmetricObjectPropertyAxiom(OWLObjectPropertyExpression property)
           
 OWLAntiSymmetricObjectPropertyAxiom getAsymmetricObjectPropertyAxiom(OWLObjectPropertyExpression property)
          Gets the axiom that states that this property is asymmetric.
 java.util.Set<OWLAxiomAnnotationAxiom> getAxiomAnnotationAxioms()
           
 int getAxiomCount()
          Gets the number of axioms in this ontology.
<T extends OWLAxiom>
int
getAxiomCount(AxiomType<T> axiomType)
          Gets the axiom count of a specific type of axiom
 java.util.Set<OWLAxiom> getAxioms()
          Retrieves all of the axioms in this ontology.
<T extends OWLAxiom>
java.util.Set<T>
getAxioms(AxiomType<T> axiomType)
          Gets the axioms which are of the specified type.
 java.util.Set<OWLClassAxiom> getAxioms(OWLClass cls)
          Gets the axioms that form the definition/description of a class.
 java.util.Set<OWLDataPropertyAxiom> getAxioms(OWLDataProperty prop)
          Gets the axioms that form the definition/description of a data property.
 java.util.Set<OWLIndividualAxiom> getAxioms(OWLIndividual individual)
          Gets the axioms that form the definition/description of an individual
 java.util.Set<OWLObjectPropertyAxiom> getAxioms(OWLObjectPropertyExpression prop)
          Gets the axioms that form the definition/description of an object property.
 java.util.Set<OWLClassAssertionAxiom> getClassAssertionAxioms(OWLClass type)
           
 java.util.Set<OWLClassAssertionAxiom> getClassAssertionAxioms(OWLIndividual individual)
           
 java.util.Set<OWLClassAxiom> getClassAxioms()
          Gets all of the class axioms in this ontology.
 java.util.Set<OWLDataPropertyAssertionAxiom> getDataPropertyAssertionAxioms(OWLIndividual individual)
           
 java.util.Set<OWLPropertyAxiom> getDataPropertyAxioms()
          Gets all of the data property axioms in this ontology.
 java.util.Set<OWLDataPropertyDomainAxiom> getDataPropertyDomainAxioms(OWLDataProperty property)
           
 java.util.Set<OWLDataPropertyRangeAxiom> getDataPropertyRangeAxiom(OWLDataProperty property)
           
 java.util.Set<OWLDataSubPropertyAxiom> getDataSubPropertyAxiomsForLHS(OWLDataProperty lhsProperty)
           
 java.util.Set<OWLDataSubPropertyAxiom> getDataSubPropertyAxiomsForRHS(OWLDataPropertyExpression property)
           
 java.util.Set<OWLDeclarationAxiom> getDeclarationAxioms()
          Gets all of the annotation axioms in this ontology.
 java.util.Set<OWLDeclarationAxiom> getDeclarationAxioms(OWLEntity entity)
          Gets the declaration axioms for specified entity.
 java.util.Set<OWLDifferentIndividualsAxiom> getDifferentIndividualAxioms(OWLIndividual individual)
           
 java.util.Set<OWLDisjointClassesAxiom> getDisjointClassesAxioms(OWLClass cls)
          Gets the set of disjoint class axioms that contain the specified class as an operand.
 java.util.Set<OWLDisjointDataPropertiesAxiom> getDisjointDataPropertiesAxiom(OWLDataProperty property)
           
 java.util.Set<OWLDisjointObjectPropertiesAxiom> getDisjointObjectPropertiesAxiom(OWLObjectPropertyExpression property)
           
 java.util.Set<OWLDisjointUnionAxiom> getDisjointUnionAxioms(OWLClass owlClass)
          Gets the set of disjoint union axioms that have the specified class as the named class that is equivalent to the disjoint union of operands.
 java.util.Set<OWLEntityAnnotationAxiom> getEntityAnnotationAxioms(OWLEntity entity)
          Gets the axioms that annotate the specified entity.
 java.util.Set<OWLEquivalentClassesAxiom> getEquivalentClassesAxioms(OWLClass cls)
          Gets all of the equivalent axioms in this ontology that contain the specified class as an operand.
 java.util.Set<OWLEquivalentDataPropertiesAxiom> getEquivalentDataPropertiesAxiom(OWLDataProperty property)
           
 java.util.Set<OWLEquivalentObjectPropertiesAxiom> getEquivalentObjectPropertiesAxioms(OWLObjectPropertyExpression property)
           
 OWLFunctionalDataPropertyAxiom getFunctionalDataPropertyAxiom(OWLDataPropertyExpression property)
           
 OWLFunctionalObjectPropertyAxiom getFunctionalObjectPropertyAxiom(OWLObjectPropertyExpression property)
           
 java.util.Set<OWLClassAxiom> getGeneralClassAxioms()
          Gets the set of general axioms in this ontology.
 java.util.Set<OWLOntology> getImports(OWLOntologyManager ontologyManager)
          Gets the OWLOntology instances that this ontology imports.
 java.util.Set<OWLImportsDeclaration> getImportsDeclarations()
          Gets the set of imports annotations for this ontology.
 java.util.Set<OWLIndividualAxiom> getIndividualAxioms()
          Gets all of the individual axioms in this ontology.
 OWLInverseFunctionalObjectPropertyAxiom getInverseFunctionalObjectPropertyAxiom(OWLObjectPropertyExpression property)
           
 java.util.Set<OWLInverseObjectPropertiesAxiom> getInverseObjectPropertyAxioms(OWLObjectPropertyExpression property)
           
 OWLIrreflexiveObjectPropertyAxiom getIrreflexiveObjectPropertyAxiom(OWLObjectPropertyExpression property)
           
 int getLogicalAxiomCount()
          Gets the number of logical axioms in this ontology.
 java.util.Set<OWLLogicalAxiom> getLogicalAxioms()
          Gets all of the axioms in the ontology that affect the logical meaning of the ontology.
 java.util.Set<OWLNegativeDataPropertyAssertionAxiom> getNegativeDataPropertyAssertionAxioms(OWLIndividual individual)
           
 java.util.Set<OWLNegativeObjectPropertyAssertionAxiom> getNegativeObjectPropertyAssertionAxioms(OWLIndividual individual)
           
 java.util.Set<OWLObjectPropertyAssertionAxiom> getObjectPropertyAssertionAxioms(OWLIndividual individual)
           
 java.util.Set<OWLPropertyAxiom> getObjectPropertyAxioms()
          Gets all of the object property axioms in this ontology.
 java.util.Set<OWLObjectPropertyDomainAxiom> getObjectPropertyDomainAxioms(OWLObjectPropertyExpression property)
           
 java.util.Set<OWLObjectPropertyRangeAxiom> getObjectPropertyRangeAxioms(OWLObjectPropertyExpression property)
           
 java.util.Set<OWLObjectSubPropertyAxiom> getObjectSubPropertyAxiomsForLHS(OWLObjectPropertyExpression property)
          Gets the object property sub property axioms where the specified property is on the left hand side of the axiom.
 java.util.Set<OWLObjectSubPropertyAxiom> getObjectSubPropertyAxiomsForRHS(OWLObjectPropertyExpression property)
           
 java.util.Set<OWLOntologyAnnotationAxiom> getOntologyAnnotationAxioms()
          Gets all of the ontology annotation axioms which have been asserted in this ontology.
 java.util.Set<OWLObjectPropertyChainSubPropertyAxiom> getPropertyChainSubPropertyAxioms()
          Gets the property chain sub property axioms in the ontology.
 java.util.Set<OWLClass> getReferencedClasses()
          Gets the classes that are referenced by axioms (including annotation axioms) in this ontology.
 java.util.Set<OWLDataProperty> getReferencedDataProperties()
          Gets the data properties that are referenced by axioms (including annotation axioms) in this ontology.
 java.util.Set<OWLDataType> getReferencedDatatypes()
           
 java.util.Set<OWLEntity> getReferencedEntities()
          Gets the entities that are referenced by axioms in this ontology.
 java.util.Set<OWLIndividual> getReferencedIndividuals()
          Gets the individuals that are referenced by axioms (including annotation axioms) in this ontology.
 java.util.Set<OWLObjectProperty> getReferencedObjectProperties()
          Gets the object properties that are referenced by axioms (including annotation axioms) in this ontology.
 java.util.Set<OWLNamedObject> getReferencedObjects()
           
 java.util.Set<OWLAxiom> getReferencingAxioms(OWLEntity owlEntity)
          Gets the axioms where the specified entity appears anywhere in the axiom.
 OWLReflexiveObjectPropertyAxiom getReflexiveObjectPropertyAxiom(OWLObjectPropertyExpression property)
           
 java.util.Set<SWRLRule> getRules()
          Gets the rules in this ontology.
 java.util.Set<OWLSameIndividualsAxiom> getSameIndividualAxioms(OWLIndividual individual)
           
 java.util.Set<OWLSubClassAxiom> getSubClassAxiomsForLHS(OWLClass cls)
          Gets all of the subclass axioms where the left hand side (the subclass) is equal to the specified class.
 java.util.Set<OWLSubClassAxiom> getSubClassAxiomsForRHS(OWLClass cls)
          Gets all of the subclass axioms where the right hand side (the superclass) is equal to the specified class.
 OWLSymmetricObjectPropertyAxiom getSymmetricObjectPropertyAxiom(OWLObjectPropertyExpression property)
           
 OWLTransitiveObjectPropertyAxiom getTransitiveObjectPropertyAxiom(OWLObjectPropertyExpression property)
           
 java.net.URI getURI()
          Gets the URI of the ontology.
 boolean isEmpty()
          Determines if this ontology is empty - an ontology is empty if it does not contain any axioms.
 boolean isPunned(java.net.URI uri)
          Determines if the specified URI refers to more than one type of entity (i.e.
 
Methods inherited from class uk.ac.manchester.cs.owl.OWLObjectImpl
compareTo, getOWLDataFactory, getSignature, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.semanticweb.owl.model.OWLObject
getSignature
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

OWLOntologyImpl

public OWLOntologyImpl(OWLDataFactory dataFactory,
                       java.net.URI uri)
Method Detail

getURI

public java.net.URI getURI()
Gets the URI of the ontology.

Specified by:
getURI in interface OWLNamedObject
Returns:
A URI that represents the name of the object

isEmpty

public boolean isEmpty()
Description copied from interface: OWLOntology
Determines if this ontology is empty - an ontology is empty if it does not contain any axioms.

Specified by:
isEmpty in interface OWLOntology
Returns:
true if the ontology is empty, otherwise false.

getAxiomCount

public int getAxiomCount()
Description copied from interface: OWLOntology
Gets the number of axioms in this ontology.

Specified by:
getAxiomCount in interface OWLOntology
Returns:
The number of axioms in this ontology.

getAxioms

public java.util.Set<OWLAxiom> getAxioms()
Description copied from interface: OWLOntology
Retrieves all of the axioms in this ontology. Note that to test whether or not this ontology is empty (i.e. contains no axioms, the isEmpty method is preferred over getAxioms().isEmpty(). )

Specified by:
getAxioms in interface OWLOntology
Returns:
The set of all axioms in this ontology, including logical axioms and annotation axioms. The set that is returned is a copy of the axioms in the ontology - it will not be updated if the ontology changes. It is recommended that the containsAxiom method is used to determine whether or not this ontology contains a particular axiom rather than using getAxioms().contains().

getAxioms

public <T extends OWLAxiom> java.util.Set<T> getAxioms(AxiomType<T> axiomType)
Description copied from interface: OWLOntology
Gets the axioms which are of the specified type.

Specified by:
getAxioms in interface OWLOntology
Parameters:
axiomType - The type of axioms to be retrived.
Returns:
A set containing the axioms which are of the specified type. The set that is returned is a copy of the axioms in the ontology - it will not be updated if the ontology changes.

getAxiomCount

public <T extends OWLAxiom> int getAxiomCount(AxiomType<T> axiomType)
Description copied from interface: OWLOntology
Gets the axiom count of a specific type of axiom

Specified by:
getAxiomCount in interface OWLOntology
Parameters:
axiomType - The type of axiom to count
Returns:
The number of the specified types of axioms in this ontology

getLogicalAxioms

public java.util.Set<OWLLogicalAxiom> getLogicalAxioms()
Description copied from interface: OWLOntology
Gets all of the axioms in the ontology that affect the logical meaning of the ontology. In other words, this method returns all axioms that are not annotation axioms, declaration axioms or imports declarations.

Specified by:
getLogicalAxioms in interface OWLOntology
Returns:
A set of axioms which are of the type OWLLogicalAxiom The set that is returned is a copy of the axioms in the ontology - it will not be updated if the ontology changes.

getLogicalAxiomCount

public int getLogicalAxiomCount()
Description copied from interface: OWLOntology
Gets the number of logical axioms in this ontology.

Specified by:
getLogicalAxiomCount in interface OWLOntology
Returns:
The number of axioms in this ontology.

getRules

public java.util.Set<SWRLRule> getRules()
Description copied from interface: OWLOntology
Gets the rules in this ontology.

Specified by:
getRules in interface OWLOntology
Returns:
The set of rules in this ontology. Note that the set that is returned will be a copy and will not be updated if the ontology changes.

getClassAxioms

public java.util.Set<OWLClassAxiom> getClassAxioms()
Description copied from interface: OWLOntology
Gets all of the class axioms in this ontology.

Specified by:
getClassAxioms in interface OWLOntology
Returns:
The set that is returned is a copy of the axioms in the ontology - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getObjectPropertyAxioms

public java.util.Set<OWLPropertyAxiom> getObjectPropertyAxioms()
Description copied from interface: OWLOntology
Gets all of the object property axioms in this ontology.

Specified by:
getObjectPropertyAxioms in interface OWLOntology
Returns:
The set that is returned is a copy of the axioms in the ontology - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getDataPropertyAxioms

public java.util.Set<OWLPropertyAxiom> getDataPropertyAxioms()
Description copied from interface: OWLOntology
Gets all of the data property axioms in this ontology.

Specified by:
getDataPropertyAxioms in interface OWLOntology
Returns:
The set that is returned is a copy of the axioms in the ontology - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getIndividualAxioms

public java.util.Set<OWLIndividualAxiom> getIndividualAxioms()
Description copied from interface: OWLOntology
Gets all of the individual axioms in this ontology.

Specified by:
getIndividualAxioms in interface OWLOntology
Returns:
The set that is returned is a copy of the axioms in the ontology - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getAnnotationAxioms

public java.util.Set<OWLAnnotationAxiom> getAnnotationAxioms()
Description copied from interface: OWLOntology
Gets all of the annotation axioms in this ontology.

Specified by:
getAnnotationAxioms in interface OWLOntology
Returns:
The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getAxiomAnnotationAxioms

public java.util.Set<OWLAxiomAnnotationAxiom> getAxiomAnnotationAxioms()

getDeclarationAxioms

public java.util.Set<OWLDeclarationAxiom> getDeclarationAxioms()
Description copied from interface: OWLOntology
Gets all of the annotation axioms in this ontology.

Specified by:
getDeclarationAxioms in interface OWLOntology
Returns:
The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getDeclarationAxioms

public java.util.Set<OWLDeclarationAxiom> getDeclarationAxioms(OWLEntity entity)
Description copied from interface: OWLOntology
Gets the declaration axioms for specified entity.

Specified by:
getDeclarationAxioms in interface OWLOntology
Parameters:
entity - The entity that is the subject of the set of returned axioms.
Returns:
The set of declaration axioms. Note that this set will be a copy and will not be updated if the ontology changes. It is therefore safe to iterate over this set while making changes to the ontology.

getAnnotations

public java.util.Set<OWLAxiomAnnotationAxiom> getAnnotations(OWLAxiom axiom)
Description copied from interface: OWLOntology
Gets the annotation axioms that annotate the specified axiom in this ontology.

Specified by:
getAnnotations in interface OWLOntology
Parameters:
axiom - The axiom that the returned set of axiom annotation axioms annotate.
Returns:
The set of annotation axioms. Note that this set will be a copy and will not be updated if the ontology changes. It is therefore safe to iterate over this set while making changes to the ontology.

getEntityAnnotationAxioms

public java.util.Set<OWLEntityAnnotationAxiom> getEntityAnnotationAxioms(OWLEntity entity)
Description copied from interface: OWLOntology
Gets the axioms that annotate the specified entity.

Specified by:
getEntityAnnotationAxioms in interface OWLOntology
Parameters:
entity - The entity whose annotations are to be retrieved.
Returns:
The set of entity annotation axioms. Note that this set will be a copy and will not be updated if the ontology changes. It is therefore safe to iterate over this set while making changes to the ontology.

getAnnotations

public java.util.Set<OWLOntologyAnnotationAxiom> getAnnotations(OWLOntology ontology)
Gets the annotations whose subject is this ontology - i.e. annotations on this ontology.

Specified by:
getAnnotations in interface OWLOntology
Parameters:
ontology - The ontology that is the subject of the annotations.
Returns:
The set of annotation axioms which have been asserted in this ontology, which have the specified ontology as their subject. Note that this set will be a copy and will not be updated if the ontology changes. It is therefore safe to iterate over this set while making changes to the ontology.

getOntologyAnnotationAxioms

public java.util.Set<OWLOntologyAnnotationAxiom> getOntologyAnnotationAxioms()
Description copied from interface: OWLOntology
Gets all of the ontology annotation axioms which have been asserted in this ontology.

Specified by:
getOntologyAnnotationAxioms in interface OWLOntology
Returns:
The set of ontology annotation axioms. Note that this set will be a copy and will not be updated if the ontology changes. It is therefore safe to iterate over this set while making changes to the ontology.

getGeneralClassAxioms

public java.util.Set<OWLClassAxiom> getGeneralClassAxioms()
Description copied from interface: OWLOntology
Gets the set of general axioms in this ontology. This includes:

Specified by:
getGeneralClassAxioms in interface OWLOntology
Returns:
The set that is returned is a copy of the axioms in the ontology - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getPropertyChainSubPropertyAxioms

public java.util.Set<OWLObjectPropertyChainSubPropertyAxiom> getPropertyChainSubPropertyAxioms()
Description copied from interface: OWLOntology
Gets the property chain sub property axioms in the ontology.

Specified by:
getPropertyChainSubPropertyAxioms in interface OWLOntology
Returns:
The set that is returned is a copy of the axioms in the ontology - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

containsAxiom

public boolean containsAxiom(OWLAxiom axiom)
Description copied from interface: OWLOntology
Determines if this ontology contains the specified axiom. This method does not take into consideration annotations. For example, if the ontology contained SubClassOf("Added by M Horridge" A B) then then this method would return true for SubClassOf(A B)

Specified by:
containsAxiom in interface OWLOntology
Parameters:
axiom - The axiom to test for.
Returns:
true if the ontology contains the specified axioms, or false if the ontology doesn't contain the specified axiom.

getAnnotationURIs

public java.util.Set<java.net.URI> getAnnotationURIs()
Description copied from interface: OWLOntology
Gets the set of URIs that are used in annotations (e.g. rdfs:label)

Specified by:
getAnnotationURIs in interface OWLOntology
Returns:
The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

containsClassReference

public boolean containsClassReference(java.net.URI owlClassURI)
Description copied from interface: OWLOntology
Determines if the ontology contains a reference to a class that has a specific URI.

Specified by:
containsClassReference in interface OWLOntology
Parameters:
owlClassURI - The URI to test for.
Returns:
true if the ontology refers to a class with the specified URI, otherwise false

containsObjectPropertyReference

public boolean containsObjectPropertyReference(java.net.URI propURI)
Description copied from interface: OWLOntology
Determines if the ontology contains a reference to an object property that has a specific URI.

Specified by:
containsObjectPropertyReference in interface OWLOntology
Parameters:
propURI - The URI of the property
Returns:
true if the ontology references (ontology signature contains) a property that has the specified URI.

containsDataPropertyReference

public boolean containsDataPropertyReference(java.net.URI propURI)
Description copied from interface: OWLOntology
Determines if the ontology contains a reference to a data property that has a specific URI.

Specified by:
containsDataPropertyReference in interface OWLOntology
Parameters:
propURI - The URI of the property
Returns:
true if the ontology references (ontology signature contains) a property that has the specified URI.

containsIndividualReference

public boolean containsIndividualReference(java.net.URI individualURI)
Description copied from interface: OWLOntology
Determines if the ontology contains a reference to an individual that has a specific URI.

Specified by:
containsIndividualReference in interface OWLOntology
Parameters:
individualURI - The URI of the individual
Returns:
true if the ontology references (ontology signature contains) an individual that has the specified URI.

containsDataTypeReference

public boolean containsDataTypeReference(java.net.URI datatypeURI)
Specified by:
containsDataTypeReference in interface OWLOntology

isPunned

public boolean isPunned(java.net.URI uri)
Description copied from interface: OWLOntology
Determines if the specified URI refers to more than one type of entity (i.e. class, object property, data property, individual or datatype)

Specified by:
isPunned in interface OWLOntology
Parameters:
uri - The URI to test.
Returns:
true if the URI refers to more than one entity, for example because the ontology references a class with the URI and also an individual with the same URI.

containsReference

public boolean containsReference(OWLClass owlClass)

containsReference

public boolean containsReference(OWLObjectProperty prop)

containsReference

public boolean containsReference(OWLDataProperty prop)

containsReference

public boolean containsReference(OWLIndividual ind)

containsReference

public boolean containsReference(OWLDataType dt)

containsEntityDeclaration

public boolean containsEntityDeclaration(OWLEntity owlEntity)
Description copied from interface: OWLOntology
Determines if this ontology contains a declaration axiom for the specified entity.

Specified by:
containsEntityDeclaration in interface OWLOntology
Parameters:
owlEntity - The entity
Returns:
true if the ontology contains a declaration for the specified entity, otherwise false The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

containsEntityReference

public boolean containsEntityReference(OWLEntity owlEntity)
Description copied from interface: OWLOntology
Determines if the ontology contains a reference to the specified entity.

Specified by:
containsEntityReference in interface OWLOntology
Parameters:
owlEntity - The entity
Returns:
true if the ontology contains a reference to the specified entity, otherwise false The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getReferencingAxioms

public java.util.Set<OWLAxiom> getReferencingAxioms(OWLEntity owlEntity)
Description copied from interface: OWLOntology
Gets the axioms where the specified entity appears anywhere in the axiom. The set that is returned, contains all axioms that directly reference the specified entity, including annotation axioms.

Specified by:
getReferencingAxioms in interface OWLOntology
Parameters:
owlEntity - The entity that should be directly referred to by an axiom that appears in the results set.
Returns:
The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getAxioms

public java.util.Set<OWLClassAxiom> getAxioms(OWLClass cls)
Description copied from interface: OWLOntology
Gets the axioms that form the definition/description of a class.

Specified by:
getAxioms in interface OWLOntology
Parameters:
cls - The class whose describing axioms are to be retrieved.
Returns:
A set of class axioms that describe the class. This set includes
  • Subclass axioms where the subclass is equal to the specified class
  • Equivalent class axioms where the specified class is an operand in the equivalent class axiom
  • Disjoint class axioms where the specified class is an operand in the disjoint class axiom
  • Disjoint union axioms, where the specified class is the named class that is equivalent to the disjoint union
The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getAxioms

public java.util.Set<OWLObjectPropertyAxiom> getAxioms(OWLObjectPropertyExpression prop)
Description copied from interface: OWLOntology
Gets the axioms that form the definition/description of an object property.

Specified by:
getAxioms in interface OWLOntology
Parameters:
prop - The property whose defining axioms are to be retrieved.
Returns:
A set of object property axioms that includes
  • Sub-property axioms where the sub property is equal to the specified property
  • Equivalent property axioms where the axiom contains the specified property
  • Equivalent property axioms that contain the inverse of the specified property
  • Disjoint property axioms that contain the specified property
  • Domain axioms that specify a domain of the specified property
  • Range axioms that specify a range of the specified property
  • Any property characteristic axiom (i.e. Functional, Symmetric, Reflexive etc.) whose subject is the specified property
  • Inverse properties axioms that contain the specified property
The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getAxioms

public java.util.Set<OWLDataPropertyAxiom> getAxioms(OWLDataProperty prop)
Description copied from interface: OWLOntology
Gets the axioms that form the definition/description of a data property.

Specified by:
getAxioms in interface OWLOntology
Parameters:
prop - The property whose defining axioms are to be retrieved.
Returns:
A set of data property axioms that includes
  • Sub-property axioms where the sub property is equal to the specified property
  • Equivalent property axioms where the axiom contains the specified property
  • Disjoint property axioms that contain the specified property
  • Domain axioms that specify a domain of the specified property
  • Range axioms that specify a range of the specified property
  • Any property characteristic axiom (i.e. Functional, Symmetric, Reflexive etc.) whose subject is the specified property
The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getAxioms

public java.util.Set<OWLIndividualAxiom> getAxioms(OWLIndividual individual)
Description copied from interface: OWLOntology
Gets the axioms that form the definition/description of an individual

Specified by:
getAxioms in interface OWLOntology
Parameters:
individual - The individual whose defining axioms are to be retrieved.
Returns:
A set of individual axioms that includes
  • Individual type assertions that assert the type of the specified individual
  • Same individuals axioms that contain the specified individual
  • Different individuals axioms that contain the specified individual
  • Object property assertion axioms whose subject is the specified individual
  • Data property assertion axioms whose subject is the specified individual
  • Negative object property assertion axioms whose subject is the specified individual
  • Negative data property assertion axioms whose subject is the specified individual
The set that is returned is a copy - it will not be updated if the ontology changes.

getReferencedObjects

public java.util.Set<OWLNamedObject> getReferencedObjects()

getReferencedEntities

public java.util.Set<OWLEntity> getReferencedEntities()
Description copied from interface: OWLOntology
Gets the entities that are referenced by axioms in this ontology.

Specified by:
getReferencedEntities in interface OWLOntology
Returns:
A set of OWLEntity objects. The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getReferencedClasses

public java.util.Set<OWLClass> getReferencedClasses()
Description copied from interface: OWLOntology
Gets the classes that are referenced by axioms (including annotation axioms) in this ontology.

Specified by:
getReferencedClasses in interface OWLOntology
Returns:
A set of named classes, which are referenced by any axiom in this ontology. The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getReferencedObjectProperties

public java.util.Set<OWLObjectProperty> getReferencedObjectProperties()
Description copied from interface: OWLOntology
Gets the object properties that are referenced by axioms (including annotation axioms) in this ontology.

Specified by:
getReferencedObjectProperties in interface OWLOntology
Returns:
A set of object properties, which are referenced by any axiom in this ontology. The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getReferencedDataProperties

public java.util.Set<OWLDataProperty> getReferencedDataProperties()
Description copied from interface: OWLOntology
Gets the data properties that are referenced by axioms (including annotation axioms) in this ontology.

Specified by:
getReferencedDataProperties in interface OWLOntology
Returns:
A set of data properties, which are referenced by any axiom in this ontology. The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getReferencedIndividuals

public java.util.Set<OWLIndividual> getReferencedIndividuals()
Description copied from interface: OWLOntology
Gets the individuals that are referenced by axioms (including annotation axioms) in this ontology.

Specified by:
getReferencedIndividuals in interface OWLOntology
Returns:
A set of individuals, which are referenced by any axiom in this ontology. The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getReferencedDatatypes

public java.util.Set<OWLDataType> getReferencedDatatypes()

getImportsDeclarations

public java.util.Set<OWLImportsDeclaration> getImportsDeclarations()
Description copied from interface: OWLOntology
Gets the set of imports annotations for this ontology.

Specified by:
getImportsDeclarations in interface OWLOntology
Returns:
The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getImports

public java.util.Set<OWLOntology> getImports(OWLOntologyManager ontologyManager)
                                      throws UnknownOWLOntologyException
Description copied from interface: OWLOntology
Gets the OWLOntology instances that this ontology imports.

Specified by:
getImports in interface OWLOntology
Parameters:
ontologyManager - The OWLOntologyManager that will map the imports annotations to actual OWLOntology instances.
Returns:
The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.
Throws:
UnknownOWLOntologyException - if this ontology isn't managed by the specified manager.

getSubClassAxiomsForLHS

public java.util.Set<OWLSubClassAxiom> getSubClassAxiomsForLHS(OWLClass cls)
Description copied from interface: OWLOntology
Gets all of the subclass axioms where the left hand side (the subclass) is equal to the specified class.

Specified by:
getSubClassAxiomsForLHS in interface OWLOntology
Parameters:
cls - The class that is equal to the left hand side of the axiom (subclass).
Returns:
The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getSubClassAxiomsForRHS

public java.util.Set<OWLSubClassAxiom> getSubClassAxiomsForRHS(OWLClass cls)
Description copied from interface: OWLOntology
Gets all of the subclass axioms where the right hand side (the superclass) is equal to the specified class.

Specified by:
getSubClassAxiomsForRHS in interface OWLOntology
Parameters:
cls - The class
Returns:
The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getEquivalentClassesAxioms

public java.util.Set<OWLEquivalentClassesAxiom> getEquivalentClassesAxioms(OWLClass cls)
Description copied from interface: OWLOntology
Gets all of the equivalent axioms in this ontology that contain the specified class as an operand.

Specified by:
getEquivalentClassesAxioms in interface OWLOntology
Parameters:
cls - The class
Returns:
A set of equivalent class axioms that contain the specified class as an operand. The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getDisjointClassesAxioms

public java.util.Set<OWLDisjointClassesAxiom> getDisjointClassesAxioms(OWLClass cls)
Description copied from interface: OWLOntology
Gets the set of disjoint class axioms that contain the specified class as an operand.

Specified by:
getDisjointClassesAxioms in interface OWLOntology
Parameters:
cls - The class that should be contained in the set of disjoint class axioms that will be returned.
Returns:
The set of disjoint axioms that contain the specified class. The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getDisjointUnionAxioms

public java.util.Set<OWLDisjointUnionAxiom> getDisjointUnionAxioms(OWLClass owlClass)
Description copied from interface: OWLOntology
Gets the set of disjoint union axioms that have the specified class as the named class that is equivalent to the disjoint union of operands. For example, if the ontology contained the axiom DisjointUnion(A, propP some C, D, E) this axiom would be returned for class A (but not for D or E).

Specified by:
getDisjointUnionAxioms in interface OWLOntology
Parameters:
owlClass - The class that indexes the axioms to be retrieved.
Returns:
The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getObjectSubPropertyAxiomsForLHS

public java.util.Set<OWLObjectSubPropertyAxiom> getObjectSubPropertyAxiomsForLHS(OWLObjectPropertyExpression property)
Description copied from interface: OWLOntology
Gets the object property sub property axioms where the specified property is on the left hand side of the axiom.

Specified by:
getObjectSubPropertyAxiomsForLHS in interface OWLOntology
Parameters:
property - The property which is on the left hand side of the axiom.
Returns:
The set that is returned is a copy - it will not be updated if the ontology changes. It is therefore safe to apply changes to this ontology while iterating over this set.

getObjectSubPropertyAxiomsForRHS

public java.util.Set<OWLObjectSubPropertyAxiom> getObjectSubPropertyAxiomsForRHS(OWLObjectPropertyExpression property)
Specified by:
getObjectSubPropertyAxiomsForRHS in interface OWLOntology

getObjectPropertyDomainAxioms

public java.util.Set<OWLObjectPropertyDomainAxiom> getObjectPropertyDomainAxioms(OWLObjectPropertyExpression property)
Specified by:
getObjectPropertyDomainAxioms in interface OWLOntology

getObjectPropertyRangeAxioms

public java.util.Set<OWLObjectPropertyRangeAxiom> getObjectPropertyRangeAxioms(OWLObjectPropertyExpression property)
Specified by:
getObjectPropertyRangeAxioms in interface OWLOntology

getInverseObjectPropertyAxioms

public java.util.Set<OWLInverseObjectPropertiesAxiom> getInverseObjectPropertyAxioms(OWLObjectPropertyExpression property)
Specified by:
getInverseObjectPropertyAxioms in interface OWLOntology

getEquivalentObjectPropertiesAxioms

public java.util.Set<OWLEquivalentObjectPropertiesAxiom> getEquivalentObjectPropertiesAxioms(OWLObjectPropertyExpression property)
Specified by:
getEquivalentObjectPropertiesAxioms in interface OWLOntology

getDisjointObjectPropertiesAxiom

public java.util.Set<OWLDisjointObjectPropertiesAxiom> getDisjointObjectPropertiesAxiom(OWLObjectPropertyExpression property)
Specified by:
getDisjointObjectPropertiesAxiom in interface OWLOntology

getFunctionalObjectPropertyAxiom

public OWLFunctionalObjectPropertyAxiom getFunctionalObjectPropertyAxiom(OWLObjectPropertyExpression property)
Specified by:
getFunctionalObjectPropertyAxiom in interface OWLOntology

getInverseFunctionalObjectPropertyAxiom

public OWLInverseFunctionalObjectPropertyAxiom getInverseFunctionalObjectPropertyAxiom(OWLObjectPropertyExpression property)
Specified by:
getInverseFunctionalObjectPropertyAxiom in interface OWLOntology

getSymmetricObjectPropertyAxiom

public OWLSymmetricObjectPropertyAxiom getSymmetricObjectPropertyAxiom(OWLObjectPropertyExpression property)
Specified by:
getSymmetricObjectPropertyAxiom in interface OWLOntology

getAntiSymmetricObjectPropertyAxiom

public OWLAntiSymmetricObjectPropertyAxiom getAntiSymmetricObjectPropertyAxiom(OWLObjectPropertyExpression property)
Specified by:
getAntiSymmetricObjectPropertyAxiom in interface OWLOntology

getAsymmetricObjectPropertyAxiom

public OWLAntiSymmetricObjectPropertyAxiom getAsymmetricObjectPropertyAxiom(OWLObjectPropertyExpression property)
Description copied from interface: OWLOntology
Gets the axiom that states that this property is asymmetric. Note that this will return an antisymmetric property axiom. The name of this interfaces is due to legacy reasons.

Specified by:
getAsymmetricObjectPropertyAxiom in interface OWLOntology
Parameters:
property - The property
Returns:
The axiom that states that this property is asymmetric, or null if there is no axiom that states this.

getReflexiveObjectPropertyAxiom

public OWLReflexiveObjectPropertyAxiom getReflexiveObjectPropertyAxiom(OWLObjectPropertyExpression property)
Specified by:
getReflexiveObjectPropertyAxiom in interface OWLOntology

getIrreflexiveObjectPropertyAxiom

public OWLIrreflexiveObjectPropertyAxiom getIrreflexiveObjectPropertyAxiom(OWLObjectPropertyExpression property)
Specified by:
getIrreflexiveObjectPropertyAxiom in interface OWLOntology

getTransitiveObjectPropertyAxiom

public OWLTransitiveObjectPropertyAxiom getTransitiveObjectPropertyAxiom(OWLObjectPropertyExpression property)
Specified by:
getTransitiveObjectPropertyAxiom in interface OWLOntology

getFunctionalDataPropertyAxiom

public OWLFunctionalDataPropertyAxiom getFunctionalDataPropertyAxiom(OWLDataPropertyExpression property)
Specified by:
getFunctionalDataPropertyAxiom in interface OWLOntology

getDataSubPropertyAxiomsForLHS

public java.util.Set<OWLDataSubPropertyAxiom> getDataSubPropertyAxiomsForLHS(OWLDataProperty lhsProperty)
Specified by:
getDataSubPropertyAxiomsForLHS in interface OWLOntology

getDataSubPropertyAxiomsForRHS

public java.util.Set<OWLDataSubPropertyAxiom> getDataSubPropertyAxiomsForRHS(OWLDataPropertyExpression property)
Specified by:
getDataSubPropertyAxiomsForRHS in interface OWLOntology

getDataPropertyDomainAxioms

public java.util.Set<OWLDataPropertyDomainAxiom> getDataPropertyDomainAxioms(OWLDataProperty property)
Specified by:
getDataPropertyDomainAxioms in interface OWLOntology

getDataPropertyRangeAxiom

public java.util.Set<OWLDataPropertyRangeAxiom> getDataPropertyRangeAxiom(OWLDataProperty property)
Specified by:
getDataPropertyRangeAxiom in interface OWLOntology

getEquivalentDataPropertiesAxiom

public java.util.Set<OWLEquivalentDataPropertiesAxiom> getEquivalentDataPropertiesAxiom(OWLDataProperty property)
Specified by:
getEquivalentDataPropertiesAxiom in interface OWLOntology

getDisjointDataPropertiesAxiom

public java.util.Set<OWLDisjointDataPropertiesAxiom> getDisjointDataPropertiesAxiom(OWLDataProperty property)
Specified by:
getDisjointDataPropertiesAxiom in interface OWLOntology

getClassAssertionAxioms

public java.util.Set<OWLClassAssertionAxiom> getClassAssertionAxioms(OWLIndividual individual)
Specified by:
getClassAssertionAxioms in interface OWLOntology

getClassAssertionAxioms

public java.util.Set<OWLClassAssertionAxiom> getClassAssertionAxioms(OWLClass type)
Specified by:
getClassAssertionAxioms in interface OWLOntology

getDataPropertyAssertionAxioms

public java.util.Set<OWLDataPropertyAssertionAxiom> getDataPropertyAssertionAxioms(OWLIndividual individual)
Specified by:
getDataPropertyAssertionAxioms in interface OWLOntology

getObjectPropertyAssertionAxioms

public java.util.Set<OWLObjectPropertyAssertionAxiom> getObjectPropertyAssertionAxioms(OWLIndividual individual)
Specified by:
getObjectPropertyAssertionAxioms in interface OWLOntology

getNegativeObjectPropertyAssertionAxioms

public java.util.Set<OWLNegativeObjectPropertyAssertionAxiom> getNegativeObjectPropertyAssertionAxioms(OWLIndividual individual)
Specified by:
getNegativeObjectPropertyAssertionAxioms in interface OWLOntology

getNegativeDataPropertyAssertionAxioms

public java.util.Set<OWLNegativeDataPropertyAssertionAxiom> getNegativeDataPropertyAssertionAxioms(OWLIndividual individual)
Specified by:
getNegativeDataPropertyAssertionAxioms in interface OWLOntology

getSameIndividualAxioms

public java.util.Set<OWLSameIndividualsAxiom> getSameIndividualAxioms(OWLIndividual individual)
Specified by:
getSameIndividualAxioms in interface OWLOntology

getDifferentIndividualAxioms

public java.util.Set<OWLDifferentIndividualsAxiom> getDifferentIndividualAxioms(OWLIndividual individual)
Specified by:
getDifferentIndividualAxioms in interface OWLOntology

applyChange

public java.util.List<OWLOntologyChange> applyChange(OWLOntologyChange change)
Specified by:
applyChange in interface OWLMutableOntology

applyChanges

public java.util.List<OWLOntologyChange> applyChanges(java.util.List<OWLOntologyChange> changes)
Specified by:
applyChanges in interface OWLMutableOntology

accept

public void accept(OWLObjectVisitor visitor)
Specified by:
accept in interface OWLObject

accept

public void accept(OWLNamedObjectVisitor visitor)
Specified by:
accept in interface OWLNamedObject

accept

public <O> O accept(OWLObjectVisitorEx<O> visitor)
Specified by:
accept in interface OWLObject

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class OWLObjectImpl