org.coode.owlapi.obo.renderer
Class OBOFlatFileRenderer

java.lang.Object
  extended by org.semanticweb.owlapi.io.AbstractOWLRenderer
      extended by org.coode.owlapi.obo.renderer.OBOFlatFileRenderer
All Implemented Interfaces:
OBOExceptionHandler, OWLRenderer

public class OBOFlatFileRenderer
extends AbstractOWLRenderer
implements OBOExceptionHandler

Author: Nick Drummond
The University Of Manchester
Bio Health Informatics Group
Date: Dec 17, 2008

Renders OBO 1.2 flat file format. OBO 1.2 is a subset of OWL, so a rendering of an arbitrary OWL ontology may be incomplete in OBO. Several features are currently not implemented: - Exception handling for unsupported constructs - these are currently reported in stderr - axiom annotations (these might be serialisable as inline comments - although OBO parsers provide no guarantees these will be roundtripped) - anonymous classes/properties - it is not clear what this means in OBO - datatype restrictions - namespace and derived tags for relationships etc - it is not clear what this means in OBO - preservation of ordering on roundtripping exercises - Stanzas are ordered (classes, obj/data props then instances) - Entities are ordered by ID in each Stanza type - OBO tags are ordered WRT the OBO specifications Additional points: - cardinality is expressed as an '=' separated tag value pair in [1] and underspecified in [2]. OBOEdit 2 does not parse this (at the time of writing) so this has been changed to standard TVP syntax - OBO 1.2 currently specifies pairwise disjointness which this renderer follows so files may get large - Exceptions are caught along the way and then wrapped in an OBOStorageIncompleteException which is thrown after serialisation ends References: [1] http://www.cs.man.ac.uk/~horrocks/obo/ [2] http://www.geneontology.org/GO.format.obo-1_2.shtml


Constructor Summary
protected OBOFlatFileRenderer(OWLOntologyManager owlOntologyManager)
           
 
Method Summary
 void addException(OBOStorageException exception)
           
 java.util.List<OBOStorageException> getExceptions()
           
 void render(OWLOntology ontology, java.io.Writer writer)
          Renders the specified ontology using the specified writer.
 
Methods inherited from class org.semanticweb.owlapi.io.AbstractOWLRenderer
getOWLOntologyManager, render, setOWLOntologyManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OBOFlatFileRenderer

protected OBOFlatFileRenderer(OWLOntologyManager owlOntologyManager)
Method Detail

render

public void render(OWLOntology ontology,
                   java.io.Writer writer)
            throws OWLRendererException
Description copied from class: AbstractOWLRenderer
Renders the specified ontology using the specified writer.

Specified by:
render in class AbstractOWLRenderer
writer - The writer that should be used to write the ontology. Note that this writer need not be wrapped with a BufferedWriter because this is taken care of by this abstract implementation.
Throws:
OWLRendererException

addException

public void addException(OBOStorageException exception)
Specified by:
addException in interface OBOExceptionHandler

getExceptions

public java.util.List<OBOStorageException> getExceptions()
Specified by:
getExceptions in interface OBOExceptionHandler