org.semanticweb.owlapi.model
Class OWLOntologyID

java.lang.Object
  extended by org.semanticweb.owlapi.model.OWLOntologyID
All Implemented Interfaces:
java.lang.Comparable<OWLOntologyID>

public final class OWLOntologyID
extends java.lang.Object
implements java.lang.Comparable<OWLOntologyID>

Author: Matthew Horridge
The University of Manchester
Information Management Group
Date: 18-Jan-2009

An object that identifies an ontology. Since OWL 2, ontologies do not have to have an ontology IRI, or if they have an ontology IRI then they can optionally also have a version IRI. Instances of this OWLOntologyID class bundle identifying information of an ontology together. If an ontology doesn't have an ontology IRI then we say that it is "anonymous".


Constructor Summary
OWLOntologyID()
          Constructs an ontology identifier specifying that the ontology IRI (and hence the version IRI) is not present.
OWLOntologyID(IRI ontologyIRI)
          Constructs an ontology identifier specifying the ontology IRI
OWLOntologyID(IRI ontologyIRI, IRI versionIRI)
          Constructs an ontology identifier specifiying the ontology IRI and version IRI
 
Method Summary
 int compareTo(OWLOntologyID o)
           
 boolean equals(java.lang.Object obj)
           
 IRI getDefaultDocumentIRI()
          Gets the IRI which is used as a default for the document that contain a representation of an ontology with this ID.
 IRI getOntologyIRI()
           
 IRI getVersionIRI()
           
 int hashCode()
           
 boolean isAnonymous()
          Determines if this ID names an ontology or whether it is an ID for an ontology without an IRI.
 boolean isOWL2DLOntologyID()
          Determines if this is a valid OWL 2 DL ontology ID.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OWLOntologyID

public OWLOntologyID(IRI ontologyIRI)
Constructs an ontology identifier specifying the ontology IRI

Parameters:
ontologyIRI - The ontology IRI used to indentify the ontology

OWLOntologyID

public OWLOntologyID(IRI ontologyIRI,
                     IRI versionIRI)
Constructs an ontology identifier specifiying the ontology IRI and version IRI

Parameters:
ontologyIRI - The ontology IRI (may be null)
versionIRI - The version IRI (must be null if the ontologyIRI is null)

OWLOntologyID

public OWLOntologyID()
Constructs an ontology identifier specifying that the ontology IRI (and hence the version IRI) is not present.

Method Detail

isOWL2DLOntologyID

public boolean isOWL2DLOntologyID()
Determines if this is a valid OWL 2 DL ontology ID. To be a valid OWL 2 DL ID, the ontology IRI and version IRI must not be reserved vocabulary.

Returns:
true if this is a valid OWL 2 DL ontology ID, otherwise false
See Also:
IRI.isReservedVocabulary()

compareTo

public int compareTo(OWLOntologyID o)
Specified by:
compareTo in interface java.lang.Comparable<OWLOntologyID>

getOntologyIRI

public IRI getOntologyIRI()

getVersionIRI

public IRI getVersionIRI()

getDefaultDocumentIRI

public IRI getDefaultDocumentIRI()
Gets the IRI which is used as a default for the document that contain a representation of an ontology with this ID. This will be the version IRI if there is an ontology IRI and version IRI, else it will be the ontology IRI if there is an ontology IRI but no version IRI, else it will be null if there is no ontology IRI. See Ontology Documents in the OWL 2 Structural Specification.

Returns:
The IRI that can be used as a default for an ontology document containing an ontology as identified by this ontology ID. Returns the default IRI or null.

isAnonymous

public boolean isAnonymous()
Determines if this ID names an ontology or whether it is an ID for an ontology without an IRI.

Returns:
true if this ID is an ID for an ontology without an IRI, or false if this ID is an ID for an ontology with an IRI.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

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