de.fzi.kadmos.api.impl
Class OWLOntologyDictionary

java.lang.Object
  extended by de.fzi.kadmos.api.impl.OWLOntologyDictionary

public class OWLOntologyDictionary
extends Object

Singleton class to hold all locally loaded OWLOntology instances and map OWLEntity instances to identifiers. WeakReferences are used to allow easy garbage collection if ontologies or entities are removed.

Since:
1.1.0
Version:
1.3.0
Author:
Carsten Daenschel

Method Summary
 void clear()
          Clears all data in the OWLOntologyDictionary.
 OWLOntology get(URI source)
          Returns the OWLOntology corresponding to the given URI.
 OWLEntity getEntity(Integer id)
           getEntity.
 Integer getID(OWLEntity entity)
           getID.
static OWLOntologyDictionary getInstance()
          Threadsafe method to get the single instance of this class.
 void put(OWLOntology ontology)
          Adds the given OWLOntology to the mapping using its default document URI.
 void remove(OWLOntology ontology)
          Removes the given OWLOntology and all contained OWLEntity instances from this OWLOntologyDictionary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static OWLOntologyDictionary getInstance()
Threadsafe method to get the single instance of this class.

Since:
1.1.0

put

public void put(OWLOntology ontology)
Adds the given OWLOntology to the mapping using its default document URI. Generates a mapping of all contained OWLEntity instances to their IDs. If OWLEntity instances are added or removed this mapping will not be updated. It is recommended to reintroduce the OWLOntology to the OWLOntologyDictionary. TODO Can this be automatised by using the OWLAPI ChangeListener?

Since:
1.1.0

get

public OWLOntology get(URI source)
Returns the OWLOntology corresponding to the given URI.

Returns:
The corresponding URI or null if nothing could be found.

getEntity

public OWLEntity getEntity(Integer id)

getEntity.

Returns:
The corresponding OWLEntity or null if nothing could be found.

getID

public Integer getID(OWLEntity entity)
              throws IllegalArgumentException

getID.

Returns:
The corresponding id
Throws:
IllegalArgumentException - Is thrown if the OWLEntity could not be found or is null.

remove

public void remove(OWLOntology ontology)
Removes the given OWLOntology and all contained OWLEntity instances from this OWLOntologyDictionary.

Parameters:
ontology - OWLOntology to remove.
Since:
1.1.0

clear

public void clear()
Clears all data in the OWLOntologyDictionary. This can make serialised Alignments unrecoverable.



Copyright © 2012. All Rights Reserved.