org.coode.owlapi.obo.parser
Class IDSpaceManager

java.lang.Object
  extended by org.coode.owlapi.obo.parser.IDSpaceManager

public class IDSpaceManager
extends Object

Author: Matthew Horridge
Stanford University
Bio-Medical Informatics Research Group
Date: 18/04/2012

Maps between id prefixes and IRI prefixes. By default an IRI prefix is the value defined by OBOPrefix#OBO#getPrefix(), but this can be overridden using an idspace tag in the ontology header.

Note that the terminology used here, i.e. "id prefix" and "IRI prefix" is OBO terminology and is not related to the OWL notion of prefix name and prefix. "id prefix" is the substring before the colon in an OBO id. IRI prefix is the prefix of an IRI that is the result of translating an OBO id to an IRI.


Constructor Summary
IDSpaceManager()
           
IDSpaceManager(IDSpaceManager idSpaceManager)
          Creates an IDSpaceManager and copying the id prefix to IRI prefix mappings contained in some other IDSpaceManager.
 
Method Summary
 String getDefaultIRIPrefix()
          Gets the default IRI prefix (which is returned by the getIRIPrefix(String) for unregistered id prefixes.
 String getIRIPrefix(String idPrefix)
          Gets an IRI prefix from an id prefix.
 void setIRIPrefix(String idPrefix, String iriPrefix)
          Sets the IRI prefix for a given id prefix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IDSpaceManager

public IDSpaceManager()

IDSpaceManager

public IDSpaceManager(IDSpaceManager idSpaceManager)
Creates an IDSpaceManager and copying the id prefix to IRI prefix mappings contained in some other IDSpaceManager.

Parameters:
idSpaceManager - The other IDSpaceManager from where id prefix to IRI prefix mappings will be copied. Not null.
Throws:
NullPointerException - if idSpaceManager is null.
Method Detail

getDefaultIRIPrefix

public String getDefaultIRIPrefix()
Gets the default IRI prefix (which is returned by the getIRIPrefix(String) for unregistered id prefixes.

Returns:
The default prefix. This is actually defined by OBOPrefix.OBO.

getIRIPrefix

public String getIRIPrefix(String idPrefix)
Gets an IRI prefix from an id prefix.

Parameters:
idPrefix - The id prefix. May be null.
Returns:
The IRI prefix for the given id prefix. Not null. If the specified id prefix is not registered/set with this manager, or it is null, then the default prefix will be returned, which is defined by OBOPrefix.OBO.

setIRIPrefix

public void setIRIPrefix(String idPrefix,
                         String iriPrefix)
Sets the IRI prefix for a given id prefix. This clears any previously set IRI prefix for the given id prefix.

Parameters:
idPrefix - The id prefix to set.
iriPrefix - The IRI prefix that the id prefix maps to.


Copyright © 2012 The University of Manchester. All Rights Reserved.