Package org.semanticweb.owlapi.model
Class OWLOntologyID
java.lang.Object
org.semanticweb.owlapi.model.OWLOntologyID
- All Implemented Interfaces:
Serializable
,Comparable<OWLOntologyID>
,IsAnonymous
public class OWLOntologyID
extends Object
implements Comparable<OWLOntologyID>, Serializable, IsAnonymous
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".
- Since:
- 3.0.0
- Author:
- Matthew Horridge, The University of Manchester, Information Management Group
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an ontology identifier specifying that the ontology IRI (and hence the version IRI) is not present.OWLOntologyID
(Optional<IRI> iri, Optional<IRI> version) Constructs an ontology identifier specifying the ontology IRI and version IRI.OWLOntologyID
(IRI iri) Constructs an ontology identifier specifying the ontology IRI and version IRI.OWLOntologyID
(IRI iri, IRI versionIRI) Constructs an ontology identifier specifying the ontology IRI and version IRI. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
Gets the IRI which is used as a default for the document that contain a representation of an ontology with this ID.Gets the ontology IRI.Gets the version IRI.int
hashCode()
boolean
Determines if this ID names an ontology or whether it is an ID for an ontology without an IRI.boolean
Determines if this is a valid OWL 2 DL ontology ID.boolean
boolean
match
(OWLOntologyID id) boolean
matchDocument
(IRI iri) boolean
matchOntology
(IRI iri) boolean
matchVersion
(IRI iri) toString()
Methods inherited from interface org.semanticweb.owlapi.model.IsAnonymous
isNamed
-
Constructor Details
-
OWLOntologyID
Constructs an ontology identifier specifying the ontology IRI and version IRI. Equivalent to OWLOntologyID(Optional- Parameters:
iri
- The ontology IRI (may benull
)
-
OWLOntologyID
Constructs an ontology identifier specifying the ontology IRI and version IRI.- Parameters:
iri
- The ontology IRI (may benull
)versionIRI
- The version IRI (must benull
if the ontologyIRI is null)
-
OWLOntologyID
Constructs an ontology identifier specifying the ontology IRI and version IRI.- Parameters:
iri
- The ontology IRI (may be absent)version
- The version IRI (must be absent if the ontologyIRI is absent)
-
OWLOntologyID
public OWLOntologyID()Constructs an ontology identifier specifying that the ontology IRI (and hence the version IRI) is not present.
-
-
Method Details
-
match
- Parameters:
iri
- the iri to check- Returns:
- true if the input iri matches the ontology iri or the version iri
-
matchVersion
- Parameters:
iri
- the iri to check- Returns:
- true if the input iri matches the version iri
-
matchDocument
- Parameters:
iri
- the iri to check- Returns:
- true if the input iri matches the default document iri
-
matchOntology
- Parameters:
iri
- the iri to check- Returns:
- true if the input iri matches the ontology iri
-
match
- Parameters:
id
- the id to check- Returns:
- true if the input id has the same ontology iri
-
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, otherwisefalse
- See Also:
-
compareTo
- Specified by:
compareTo
in interfaceComparable<OWLOntologyID>
-
getOntologyIRI
Gets the ontology IRI. If the ontology is anonymous, it will return an absent Optional (i.e., getOntologyIRI().isPresent() will return false.- Returns:
- Optional of the ontology IRI, or Optional.absent if there is no ontology IRI.
-
getVersionIRI
Gets the version IRI.- Returns:
- an optional of the version IRI, or Optional.absent if there is no version 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 benull
if there is no ontology IRI. See Ontology Documents in the OWL 2 Structural Specification.- Returns:
- An Optional of 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 an Optional.absent.
-
isAnonymous
public boolean isAnonymous()Determines if this ID names an ontology or whether it is an ID for an ontology without an IRI. If the result of this method is true, getOntologyIRI() will return an Optional.absent.- Specified by:
isAnonymous
in interfaceIsAnonymous
- Returns:
true
if this ID is an ID for an ontology without an IRI, orfalse
if this ID is an ID for an ontology with an IRI.
-
toString
-
hashCode
public int hashCode() -
equals
-