de.fau.cs.www8.jadeowlcodec.tool.dig1_1_extended
Class Renderer

java.lang.Object
  extended by de.fau.cs.www8.jadeowlcodec.tool.dig1_1_extended.Renderer
All Implemented Interfaces:
org.semanticweb.owl.io.Options, org.semanticweb.owl.io.Renderer
Direct Known Subclasses:
TBoxRenderer

public class Renderer
extends java.lang.Object
implements org.semanticweb.owl.io.Renderer

Renders OWL ontologies as DIG 1.1 . Note: This renderer does not do anything with imports.

Version:
$Id: Renderer.java 2121 2007-03-18 13:00:50Z schieman $
Author:
Sean Bechhofer and Daniele Turi

Nested Class Summary
static class Renderer.SessionInfo
          A little structure to pass around some info about the current rendering activity to the various visitors
 
Field Summary
static java.lang.String ANONYMOUS_INDIV
           
static org.apache.log4j.Logger logger
          Log4J Logger for this class
static java.lang.String[] RACER_ONE_DOT_NINE_DIG_EXTENSIONS
           
static java.lang.String[] TOLERANT_RACER_ONE_DOT_NINE_DIG_EXTENSIONS
           
 
Constructor Summary
Renderer()
           
Renderer(java.util.Set<java.lang.String> extendedDigFeatures)
          constructor for rendering with extended DIG keywords (like the supported by Protege and RACER)
Renderer(java.lang.String[] extendedDigFeatures)
          constructor for rendering with extended DIG keywords (like the supported by Protege and RACER)
 
Method Summary
static java.lang.String anonymIndividual(org.semanticweb.owl.model.OWLIndividual individual)
          Returns the String ANONYMOUS_INDIVfollowed by the individual's hash code.
 java.util.Map getOptions()
          Empty implementation.
static void main(java.lang.String[] args)
          Renders the OWL ontology specified in the URI in the first argument as DIG 1.1.
static org.apache.xmlbeans.XmlOptions prettyPrintOptions()
           
 org.kr.dl.dig.v1_1.TellsDocument renderOntology(org.semanticweb.owl.model.OWLOntology ontology)
          Translates ontology into a TellsDocument.
 void renderOntology(org.semanticweb.owl.model.OWLOntology ontology, java.io.Writer writer)
          Renders ontology as a TellsDocumentwhich is then saved into writer.
 void setOptions(java.util.Map map)
          Empty implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RACER_ONE_DOT_NINE_DIG_EXTENSIONS

public static final java.lang.String[] RACER_ONE_DOT_NINE_DIG_EXTENSIONS

TOLERANT_RACER_ONE_DOT_NINE_DIG_EXTENSIONS

public static final java.lang.String[] TOLERANT_RACER_ONE_DOT_NINE_DIG_EXTENSIONS

ANONYMOUS_INDIV

public static final java.lang.String ANONYMOUS_INDIV
See Also:
Constant Field Values

logger

public static final org.apache.log4j.Logger logger
Log4J Logger for this class

Constructor Detail

Renderer

public Renderer()

Renderer

public Renderer(java.util.Set<java.lang.String> extendedDigFeatures)
constructor for rendering with extended DIG keywords (like the supported by Protege and RACER)

Parameters:
extendedDigFeatures - contains the extended DIG tags this renderer is allowed to use allowed combinations are described by alphabetical concatenation (example: atleastattribute, atmostattribute "seems to be supported in RACER 1.9") extended by author Ulf Schreiber

Renderer

public Renderer(java.lang.String[] extendedDigFeatures)
constructor for rendering with extended DIG keywords (like the supported by Protege and RACER)

Parameters:
extendedDigFeatures - contains the extended DIG tags this renderer is allowed to use extended by Ulf Schreiber
Method Detail

setOptions

public void setOptions(java.util.Map map)
Empty implementation.

Specified by:
setOptions in interface org.semanticweb.owl.io.Options

getOptions

public java.util.Map getOptions()
Empty implementation.

Specified by:
getOptions in interface org.semanticweb.owl.io.Options
Returns:
null.

renderOntology

public org.kr.dl.dig.v1_1.TellsDocument renderOntology(org.semanticweb.owl.model.OWLOntology ontology)
                                                throws NotExpressableInDIGException,
                                                       org.semanticweb.owl.io.RendererException
Translates ontology into a TellsDocument.

Parameters:
ontology - an OWLOntology.
Returns:
the TellsDocumentcorresponding to ontology.
Throws:
NotExpressableInDIGException - if ontology contains constructs not expressable in DIG 1.1.
org.semanticweb.owl.io.RendererException - wraps any other OWLException.

renderOntology

public void renderOntology(org.semanticweb.owl.model.OWLOntology ontology,
                           java.io.Writer writer)
                    throws NotExpressableInDIGException,
                           org.semanticweb.owl.io.RendererException
Renders ontology as a TellsDocumentwhich is then saved into writer.

Specified by:
renderOntology in interface org.semanticweb.owl.io.Renderer
Parameters:
ontology - an OWLOntology.
writer - the Writer where the rendered ontology is saved.
Throws:
NotExpressableInDIGException - if ontology contains constructs not expressable in DIG 1.1.
org.semanticweb.owl.io.RendererException - wraps any other OWLException.

anonymIndividual

public static java.lang.String anonymIndividual(org.semanticweb.owl.model.OWLIndividual individual)
Returns the String ANONYMOUS_INDIVfollowed by the individual's hash code.

Parameters:
individual - an OWLIndividual.
Returns:
the String ANONYMOUS_INDIVfollowed by the individual's hash code.

main

public static void main(java.lang.String[] args)
Renders the OWL ontology specified in the URI in the first argument as DIG 1.1. If a file is specified as second argument then the rendering is saved to that file, otherwise it is simply printed to standard out. Also checks whether the rendered ontology is valid.

Parameters:
args - the URI of the OWL ontology and, optionally, the file where the rendered ontology is to be stored.

prettyPrintOptions

public static org.apache.xmlbeans.XmlOptions prettyPrintOptions()
Returns:
XmlOptions for beautiful printing


Copyright 2007 Moritz Goeb, Bernhard Schiemann, Ulf Schreiber of Chair of Artificial Intelligence, University of Erlangen-Nuremberg