|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
The interface for modules that can import (and optionally merge) ontologies from a certain file format.
An ImportHandler can be registered with OntologyManager.addImportHandler().
However, it's easier just to declare all import handlers (their fully qualified classes) as a comma separated list
under the "cf.importhandler" key in the ConsensusFoundation.properties configuration file.
The declared import handlers will be loaded by OntologyManager.init(). Instantiation will only be
successful if one of the following constructors is available (the first one that matches will be used):
MyImportHandler(Properties config, LoggingManager log, OntologyManager om)
MyImportHandler(LoggingManager log, OntologyManager om)
MyImportHandler(OntologyManager om)
MyImportHandler()
Properties parameter contains all entries from ConsensusFoundation.properties.
OntologyManager,
ExportHandler| Method Summary | |
boolean |
canMerge()
Signals whether this handler can not only load (import), but also merge ontologies |
String |
getDescription()
Returns a short description about this import handler. |
String |
getExtension()
Returns the file extensions of the ontology format that this handler can load, e.g. |
void |
importOntology(InputStream in)
Imports an ontology from the given InputStream. |
void |
mergeOntology(InputStream in,
Collection errors)
If this handler supports ontology merging, this method can be called by an application to merge an ontology into the existing ontology. |
| Method Detail |
public void importOntology(InputStream in)
throws IOException,
OntologyManagerException
This method is responsible for closing the stream!
in - the InputStream to read the ontology from
IOException - if an IO error occurrs while reading the stream
OntologyManagerException - if the ontology cannot be loaded for logical reasons
public void mergeOntology(InputStream in,
Collection errors)
throws IOException
This method is responsible for closing the stream!
in - the InputStream to read the ontology fromerrors - an empty collection provided by the caller, into which the method can put all exceptions that happen during the merge
IOException - if an IO error occurrs while reading the streamcanMerge()public boolean canMerge()
true if the handler can merge ontologies, false otherwisemergeOntology(InputStream, Collection)public String getExtension()
public String getDescription()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||