org.semanticweb.owl.vocab
Class NamespaceOWLOntologyFormat

java.lang.Object
  extended by org.semanticweb.owl.model.OWLOntologyFormat
      extended by org.semanticweb.owl.vocab.NamespaceOWLOntologyFormat
All Implemented Interfaces:
NamespaceManager
Direct Known Subclasses:
OWLXMLOntologyFormat, RDFXMLOntologyFormat

public class NamespaceOWLOntologyFormat
extends OWLOntologyFormat
implements NamespaceManager

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 20-Feb-2007

An


Constructor Summary
NamespaceOWLOntologyFormat()
           
 
Method Summary
 void addPrefixNamespaceMapping(java.lang.String prefix, java.lang.String namespace)
          A convenience method to add a namespace mapping
 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.util.Map<java.lang.String,java.lang.String> getNamespacesByPrefixMap()
          Gets a map that maps namespace prefixes to namespaces
 java.net.URI getURI(java.lang.String curi)
          Gets the URI for a given CURI.
 void setDefaultNamespace(java.lang.String namespace)
          Sets the default namespace.
 
Methods inherited from class org.semanticweb.owl.model.OWLOntologyFormat
equals, getParameter, hashCode, setParameter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespaceOWLOntologyFormat

public NamespaceOWLOntologyFormat()
Method Detail

addPrefixNamespaceMapping

public void addPrefixNamespaceMapping(java.lang.String prefix,
                                      java.lang.String namespace)
A convenience method to add a namespace mapping

Parameters:
prefix - The prefix which maps to a namespace
namespace - The namespace

setDefaultNamespace

public void setDefaultNamespace(java.lang.String namespace)
Sets the default namespace. This is equivalent to adding mapping from the empty string prefix to a namespace.

Parameters:
namespace - The namespace to be set.

containsPrefixMapping

public boolean containsPrefixMapping(java.lang.String prefix)
Description copied from interface: NamespaceManager
Determines if this manager knows about a given namespace prefix and it contains a (non-null) mapping for the prefix.

Specified by:
containsPrefixMapping in interface NamespaceManager
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.

getNamespacesByPrefixMap

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

Returns:
Gets a map that maps namespace prefixes to namespaces.

getDefaultNamespace

public java.lang.String getDefaultNamespace()
Description copied from interface: NamespaceManager
Gets the default namespace.

Specified by:
getDefaultNamespace in interface NamespaceManager
Returns:
The default namespace, or null if there is no default namespace.

getNamespaceMap

public java.util.Map<java.lang.String,java.lang.String> getNamespaceMap()
Description copied from interface: NamespaceManager
Gets a map that maps prefixes to namespaces.

Specified by:
getNamespaceMap in interface NamespaceManager
Returns:
The map of prefixes to namespaces. Note that modifying the contents of this map will not change the prefix - namespace mappings

getNamespace

public java.lang.String getNamespace(java.lang.String prefix)
Description copied from interface: NamespaceManager
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.

Specified by:
getNamespace in interface NamespaceManager
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.

getURI

public java.net.URI getURI(java.lang.String curi)
Description copied from interface: NamespaceManager
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.

Specified by:
getURI in interface NamespaceManager
Parameters:
curi - The CURI
Returns:
The full URI.