org.semanticweb.skosapibinding
Class SKOSManager

java.lang.Object
  extended by org.semanticweb.skosapibinding.SKOSManager
All Implemented Interfaces:
SKOSContentManager

public class SKOSManager
extends java.lang.Object
implements SKOSContentManager

Author: Simon Jupp
Date: Mar 4, 2008
The University of Manchester
Bio-Health Informatics Group
Provides a point of convenience for creating an SKOSDataset with commonly required features (such as an RDF parser for example). The SKOSManager manages a set of SKOS vocabularies. It is the main point for creating, loading and accessing vocabularies.


Constructor Summary
SKOSManager()
          Creates a new SKOSManager object which is used to manage SKOS vocabularies
SKOSManager(org.semanticweb.owl.model.OWLOntologyManager manager)
           
 
Method Summary
 java.util.List<SKOSChange> applyChange(SKOSChange change)
          Applies a single AddAssertion object (change) to some or all the vocabularies that are managed by this Manager
 java.util.List<SKOSChange> applyChanges(java.util.List<SKOSChange> change)
          A conveniance method which applies a list of AddAssertion objects (changes) to some or all the vocabularies that are managed by this Manager
 SKOSDataset createSKOSDataset(java.net.URI uri)
          Creates a new (empty) SKOS vocabulary that has the specified ontology URI.
 org.semanticweb.owl.model.OWLOntologyManager getOWLManger()
          As SKOSManager is a wrapper for an OWLOntologyManager, you get access to the actual OWLOntologyManger using this method
 SKOSDataFactory getSKOSDataFactory()
          Return a SKOSDataFactory for this Manager.
 java.util.Collection<uk.ac.manchester.cs.skos.SKOSDatasetImpl> getSKOSDataSets()
           
 SKOSDataset loadDataset(SKOSInputSource inputSource)
          A convenience method that load an ontology from an input source.
 SKOSDataset loadDataset(java.net.URI uri)
          Loads the ontology specified by the uri parameter.
 SKOSDataset loadDatasetFromPhysicalURI(java.net.URI uri)
          A convenience method that loads an ontology from a physical URI.
 void save(SKOSDataset vocab)
           
 void save(SKOSDataset vocab, SKOSFormat format)
           
 void save(SKOSDataset vocab, SKOSFormat format, java.net.URI uri)
          Saves the specified ontology, using the specified URI to determine where/how the ontology should be saved.
 void save(SKOSDataset vocab, java.net.URI uri)
          Saves the specified ontology, using the specified URI to determine where/how the ontology should be saved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SKOSManager

public SKOSManager()
            throws SKOSCreationException
Creates a new SKOSManager object which is used to manage SKOS vocabularies

Throws:
SKOSCreationException - A SKOS creation exception

SKOSManager

public SKOSManager(org.semanticweb.owl.model.OWLOntologyManager manager)
Method Detail

getOWLManger

public org.semanticweb.owl.model.OWLOntologyManager getOWLManger()
As SKOSManager is a wrapper for an OWLOntologyManager, you get access to the actual OWLOntologyManger using this method

Returns:
OWLOntologyManager, the actual OWLOntologyManager that is being maniupulated by this class

createSKOSDataset

public SKOSDataset createSKOSDataset(java.net.URI uri)
                              throws SKOSCreationException
Description copied from interface: SKOSContentManager
Creates a new (empty) SKOS vocabulary that has the specified ontology URI. The SKOS API uses an OWLOntology to contain single or multiple Concept Schemes. This URI is the base URI for that Ontology.

Specified by:
createSKOSDataset in interface SKOSContentManager
Parameters:
uri - The URI of the ontology to be created. The ontology URI will be mapped to a physical URI in order to determine the type of ontology factory that will be used to create the ontology. If this mapping is null then a default (in memory) implementation of the ontology will most likely be created.
Returns:
The newly created SKOSDataset
Throws:
SKOSCreationException

loadDataset

public SKOSDataset loadDataset(java.net.URI uri)
                        throws SKOSCreationException
Description copied from interface: SKOSContentManager
Loads the ontology specified by the uri parameter. Note that this is NOT the physical URI that points to a concrete representation (e.g. an RDF/XML OWL file) of an ontology. The mapping to a physical URI will be determined by using one of the loaded OWLOntologyURIMappers. Again, it is important to realise that the ontology being loaded is the container for your SKOSVocabularies

Specified by:
loadDataset in interface SKOSContentManager
Parameters:
uri - The ontology URI (sometimes called logical URI of the ontology to be loaded)
Returns:
The SKOSDataset represented in the Ontology that was loaded. If an ontology with the specified URI is already loaded then that ontology will be returned.
Throws:
SKOSCreationException

loadDataset

public SKOSDataset loadDataset(SKOSInputSource inputSource)
                        throws SKOSCreationException
Description copied from interface: SKOSContentManager
A convenience method that load an ontology from an input source. If the ontology contains imports then the appropriate mappers should be set up before calling this method.

Specified by:
loadDataset in interface SKOSContentManager
Returns:
SKOSDataset
Throws:
SKOSCreationException

loadDatasetFromPhysicalURI

public SKOSDataset loadDatasetFromPhysicalURI(java.net.URI uri)
                                       throws SKOSCreationException
Description copied from interface: SKOSContentManager
A convenience method that loads an ontology from a physical URI. If the ontology contains imports, then the appropriate mappers should be set up before calling this method.

Specified by:
loadDatasetFromPhysicalURI in interface SKOSContentManager
Parameters:
uri - The physical URI which points to a concrete representation of an ontology. (e.g a physical URI could be file:/home/simon/myvocab.rdf)
Returns:
The SKOSDataset conatined in the loaded ontology
Throws:
SKOSCreationException

getSKOSDataFactory

public SKOSDataFactory getSKOSDataFactory()
Description copied from interface: SKOSContentManager
Return a SKOSDataFactory for this Manager. The SKOSDataFactory is used to construct SKOS object (for example a SKOSConcept)

Specified by:
getSKOSDataFactory in interface SKOSContentManager
Returns:
SKOSDataFactory

save

public void save(SKOSDataset vocab,
                 SKOSFormat format)
          throws SKOSStorageException
Throws:
SKOSStorageException

save

public void save(SKOSDataset vocab,
                 SKOSFormat format,
                 java.net.URI uri)
          throws SKOSStorageException
Description copied from interface: SKOSContentManager
Saves the specified ontology, using the specified URI to determine where/how the ontology should be saved.

Specified by:
save in interface SKOSContentManager
Parameters:
vocab - The vocabulary to be saved.
uri - The physical URI which will be used to determine how and where the ontology will be saved.
Throws:
SKOSStorageException

applyChanges

public java.util.List<SKOSChange> applyChanges(java.util.List<SKOSChange> change)
                                        throws SKOSChangeException
Description copied from interface: SKOSContentManager
A conveniance method which applies a list of AddAssertion objects (changes) to some or all the vocabularies that are managed by this Manager

Specified by:
applyChanges in interface SKOSContentManager
Parameters:
change - The changes to be applied
Returns:
OWLEntity, the List of changes that were actually applied
Throws:
SKOSChangeException

applyChange

public java.util.List<SKOSChange> applyChange(SKOSChange change)
                                       throws SKOSChangeException
Description copied from interface: SKOSContentManager
Applies a single AddAssertion object (change) to some or all the vocabularies that are managed by this Manager

Specified by:
applyChange in interface SKOSContentManager
Parameters:
change - The changes to be applied
Returns:
OWLEntity, the List of changes that were actually applied
Throws:
SKOSChangeException

save

public void save(SKOSDataset vocab)
          throws SKOSStorageException
Specified by:
save in interface SKOSContentManager
Throws:
SKOSStorageException

save

public void save(SKOSDataset vocab,
                 java.net.URI uri)
          throws SKOSStorageException
Description copied from interface: SKOSContentManager
Saves the specified ontology, using the specified URI to determine where/how the ontology should be saved.

Specified by:
save in interface SKOSContentManager
Parameters:
vocab - The vocabulary to be saved.
uri - The physical URI which will be used to determine how and where the ontology will be saved.
Throws:
SKOSStorageException

getSKOSDataSets

public java.util.Collection<uk.ac.manchester.cs.skos.SKOSDatasetImpl> getSKOSDataSets()