net.sourceforge.fluxion.spring.xml
Class OWLOntologyXMLHandler

java.lang.Object
  extended by net.sourceforge.fluxion.spring.xml.OWLOntologyXMLHandler

public class OWLOntologyXMLHandler
extends java.lang.Object

Static methods to render OWLOntology to and from various different forms including InputStream, Element and String

Author:
Tom Oinn

Constructor Summary
OWLOntologyXMLHandler()
           
 
Method Summary
static org.jdom.Element getOntologyElement(org.semanticweb.owl.model.OWLOntology ontology)
          Render the supplied OWLOntology to a JDOM element, this bypasses the default OWL xml serializer and is considerably faster as it assembles XML objects directly.
static java.lang.String getOntologyString(org.semanticweb.owl.model.OWLOntology ontology)
          Render the supplied OWLOntology to a string, renders to a JDOM element first then uses JDOM's outputter to pretty-print the element.
static org.semanticweb.owl.model.OWLOntology getOwlOntology(org.jdom.Element ontologyElement)
          Assemble an OWLOntology from a JDOM element - note that this writes the element to a string and reads it using the rather inefficient OWL parser, this is not a particularly high performance operation! In the future we may be able to drive the ontology parser directly from the XML structure which would make things considerably faster.
static org.semanticweb.owl.model.OWLOntology getOwlOntology(java.io.InputStream ontologyInput)
          Assemble an OWLOntology from an ontology accessible through the supplied input stream.
static org.semanticweb.owl.model.OWLOntology getOwlOntology(java.lang.String ontologyXMLString)
          Assemble an OWLOntology, parsing the supplied string of OWL2 XML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OWLOntologyXMLHandler

public OWLOntologyXMLHandler()
Method Detail

getOwlOntology

public static org.semanticweb.owl.model.OWLOntology getOwlOntology(java.io.InputStream ontologyInput)
                                                            throws org.semanticweb.owl.model.OWLOntologyCreationException,
                                                                   java.io.IOException,
                                                                   java.net.URISyntaxException
Assemble an OWLOntology from an ontology accessible through the supplied input stream.

Throws:
org.semanticweb.owl.model.OWLOntologyCreationException
java.io.IOException
java.net.URISyntaxException

getOwlOntology

public static org.semanticweb.owl.model.OWLOntology getOwlOntology(java.lang.String ontologyXMLString)
                                                            throws org.semanticweb.owl.model.OWLOntologyCreationException
Assemble an OWLOntology, parsing the supplied string of OWL2 XML

Throws:
org.semanticweb.owl.model.OWLOntologyCreationException

getOwlOntology

public static org.semanticweb.owl.model.OWLOntology getOwlOntology(org.jdom.Element ontologyElement)
                                                            throws org.semanticweb.owl.model.OWLOntologyCreationException
Assemble an OWLOntology from a JDOM element - note that this writes the element to a string and reads it using the rather inefficient OWL parser, this is not a particularly high performance operation! In the future we may be able to drive the ontology parser directly from the XML structure which would make things considerably faster.

Throws:
org.semanticweb.owl.model.OWLOntologyCreationException

getOntologyString

public static java.lang.String getOntologyString(org.semanticweb.owl.model.OWLOntology ontology)
                                          throws org.semanticweb.owl.io.OWLRendererException,
                                                 org.semanticweb.owl.model.OWLOntologyCreationException,
                                                 java.io.IOException,
                                                 java.lang.InterruptedException,
                                                 java.util.concurrent.ExecutionException
Render the supplied OWLOntology to a string, renders to a JDOM element first then uses JDOM's outputter to pretty-print the element.

Throws:
org.semanticweb.owl.io.OWLRendererException
org.semanticweb.owl.model.OWLOntologyCreationException
java.io.IOException
java.lang.InterruptedException
java.util.concurrent.ExecutionException

getOntologyElement

public static org.jdom.Element getOntologyElement(org.semanticweb.owl.model.OWLOntology ontology)
                                           throws java.io.IOException,
                                                  java.lang.InterruptedException,
                                                  java.util.concurrent.ExecutionException,
                                                  org.semanticweb.owl.model.OWLOntologyCreationException,
                                                  org.semanticweb.owl.io.OWLRendererException
Render the supplied OWLOntology to a JDOM element, this bypasses the default OWL xml serializer and is considerably faster as it assembles XML objects directly.

Throws:
java.io.IOException
java.lang.InterruptedException
java.util.concurrent.ExecutionException
org.semanticweb.owl.model.OWLOntologyCreationException
org.semanticweb.owl.io.OWLRendererException


Copyright © 2010. All Rights Reserved.