org.semanticweb.owl.model
Interface NamespaceManager

All Known Implementing Classes:
DefaultNamespaceManager, DefaultOntologyFormat, NamespaceOWLOntologyFormat, OWLXMLOntologyFormat, RDFXMLOntologyFormat

public interface NamespaceManager

Author: Matthew Horridge
The University Of Manchester
Information Management Group
Date: 10-Sep-2008

A namespace manager than can provide namespaces for prefixes. Note that the empty string always points to the default namespace if there is a default namespace.


Method Summary
 boolean containsPrefixMapping(java.lang.String prefix)
          Determines if this manager knows about a given namespace prefix and it contains a (non-null) mapping for the prefix.
 java.lang.String getDefaultNamespace()
          Gets the default namespace.
 java.lang.String getNamespace(java.lang.String prefix)
          Gets the namespace that is bound to a particular prefix.
 java.util.Map<java.lang.String,java.lang.String> getNamespaceMap()
          Gets a map that maps prefixes to namespaces.
 java.net.URI getURI(java.lang.String curi)
          Gets the URI for a given CURI.
 

Method Detail

getDefaultNamespace

java.lang.String getDefaultNamespace()
Gets the default namespace.

Returns:
The default namespace, or null if there is no default namespace.

containsPrefixMapping

boolean containsPrefixMapping(java.lang.String prefix)
Determines if this manager knows about a given namespace prefix and it contains a (non-null) mapping for the prefix.

Parameters:
prefix - The prefix to be tested for.
Returns:
true if the manager knows about this prefix and there is a non-null mapping for this prefix.

getNamespace

java.lang.String getNamespace(java.lang.String prefix)
Gets the namespace that is bound to a particular prefix. Note that specifying the empty string corresponds to requesting the default namespace and will return the same result as a call to the getDefaultNamespace() method.

Parameters:
prefix - The namespace prefix. A string that represents a namespace prefix of the namespace to be retrieved. Note that specifying the empty string is the same as asking for the default namespace (see the getDefaultNamespace() method).
Returns:
The namespace, or null if there is no namespace bound to this prefix, or the prefix doesn't exist.

getNamespaceMap

java.util.Map<java.lang.String,java.lang.String> getNamespaceMap()
Gets a map that maps prefixes to namespaces.

Returns:
The map of prefixes to namespaces. Note that modifying the contents of this map will not change the prefix - namespace mappings

getURI

java.net.URI getURI(java.lang.String curi)
Gets the URI for a given CURI. The CURI must have a namespace prefix that is registered with this namespace manager, or a runtime exception will be thrown.

Parameters:
curi - The CURI
Returns:
The full URI.