org.semanticweb.owlapi.util
Class SimpleRenderer

java.lang.Object
  extended by org.semanticweb.owlapi.util.SimpleRenderer
All Implemented Interfaces:
OWLObjectRenderer, OWLAnnotationAxiomVisitor, OWLAnnotationObjectVisitor, OWLAnnotationValueVisitor, OWLAxiomVisitor, OWLClassExpressionVisitor, OWLDataRangeVisitor, OWLDataVisitor, OWLEntityVisitor, OWLIndividualVisitor, OWLObjectVisitor, OWLPropertyExpressionVisitor, SWRLObjectVisitor

public class SimpleRenderer
extends java.lang.Object
implements OWLObjectVisitor, OWLObjectRenderer

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 26-Nov-2006

A simple renderer that can be used for debugging purposes and provide an implementation of the toString method for different implementations.


Constructor Summary
SimpleRenderer()
           
 
Method Summary
protected  void append(java.lang.String s)
           
 java.lang.String getShortForm(IRI iri)
           
 boolean isUsingDefaultShortFormProvider()
           
 java.lang.String render(OWLObject object)
          Renders the specified object.
protected  void render(java.util.Set<? extends OWLObject> objects)
           
 void reset()
           
 void resetShortFormProvider()
          Resets the short form provider to the default short form provider, which is a PrefixManager with the default set of prefixes.
 void setPrefix(java.lang.String prefixName, java.lang.String prefix)
          Sets a prefix name for a given prefix.
 void setPrefixesFromOntologyFormat(OWLOntology ontology, OWLOntologyManager manager, boolean processImportedOntologies)
          Resets the short form provider and adds prefix name to prefix mappings based on the specified ontology's format (if it is a prefix format) and possibly the ontologies in the imports closure.
 void setShortFormProvider(ShortFormProvider shortFormProvider)
          Override the short form provider that is used to generate abreviated names for entities
 java.lang.String toString()
           
 void visit(IRI iri)
           
 void visit(OWLAnnotation node)
           
 void visit(OWLAnnotationAssertionAxiom axiom)
           
 void visit(OWLAnnotationProperty property)
           
 void visit(OWLAnnotationPropertyDomainAxiom axiom)
           
 void visit(OWLAnnotationPropertyRangeAxiom axiom)
           
 void visit(OWLAnonymousIndividual individual)
           
 void visit(OWLAsymmetricObjectPropertyAxiom axiom)
           
 void visit(OWLClass desc)
           
 void visit(OWLClassAssertionAxiom axiom)
           
 void visit(OWLDataAllValuesFrom desc)
           
 void visit(OWLDataComplementOf node)
           
 void visit(OWLDataExactCardinality desc)
           
 void visit(OWLDataHasValue desc)
           
 void visit(OWLDataIntersectionOf node)
           
 void visit(OWLDataMaxCardinality desc)
           
 void visit(OWLDataMinCardinality desc)
           
 void visit(OWLDataOneOf node)
           
 void visit(OWLDataProperty property)
           
 void visit(OWLDataPropertyAssertionAxiom axiom)
           
 void visit(OWLDataPropertyDomainAxiom axiom)
           
 void visit(OWLDataPropertyRangeAxiom axiom)
           
 void visit(OWLDataSomeValuesFrom desc)
           
 void visit(OWLDatatype node)
           
 void visit(OWLDatatypeDefinitionAxiom axiom)
           
 void visit(OWLDatatypeRestriction node)
           
 void visit(OWLDataUnionOf node)
           
 void visit(OWLDeclarationAxiom axiom)
           
 void visit(OWLDifferentIndividualsAxiom axiom)
           
 void visit(OWLDisjointClassesAxiom axiom)
           
 void visit(OWLDisjointDataPropertiesAxiom axiom)
           
 void visit(OWLDisjointObjectPropertiesAxiom axiom)
           
 void visit(OWLDisjointUnionAxiom axiom)
           
 void visit(OWLEquivalentClassesAxiom axiom)
           
 void visit(OWLEquivalentDataPropertiesAxiom axiom)
           
 void visit(OWLEquivalentObjectPropertiesAxiom axiom)
           
 void visit(OWLFacetRestriction node)
           
 void visit(OWLFunctionalDataPropertyAxiom axiom)
           
 void visit(OWLFunctionalObjectPropertyAxiom axiom)
           
 void visit(OWLHasKeyAxiom axiom)
           
 void visit(OWLInverseFunctionalObjectPropertyAxiom axiom)
           
 void visit(OWLInverseObjectPropertiesAxiom axiom)
           
 void visit(OWLIrreflexiveObjectPropertyAxiom axiom)
           
 void visit(OWLLiteral node)
           
 void visit(OWLNamedIndividual individual)
           
 void visit(OWLNegativeDataPropertyAssertionAxiom axiom)
           
 void visit(OWLNegativeObjectPropertyAssertionAxiom axiom)
           
 void visit(OWLObjectAllValuesFrom desc)
           
 void visit(OWLObjectComplementOf desc)
           
 void visit(OWLObjectExactCardinality desc)
           
 void visit(OWLObjectHasSelf desc)
           
 void visit(OWLObjectHasValue desc)
           
 void visit(OWLObjectIntersectionOf desc)
           
 void visit(OWLObjectInverseOf property)
           
 void visit(OWLObjectMaxCardinality desc)
           
 void visit(OWLObjectMinCardinality desc)
           
 void visit(OWLObjectOneOf desc)
           
 void visit(OWLObjectProperty property)
           
 void visit(OWLObjectPropertyAssertionAxiom axiom)
           
 void visit(OWLObjectPropertyDomainAxiom axiom)
           
 void visit(OWLObjectPropertyRangeAxiom axiom)
           
 void visit(OWLObjectSomeValuesFrom desc)
           
 void visit(OWLObjectUnionOf desc)
           
 void visit(OWLOntology ontology)
           
 void visit(OWLReflexiveObjectPropertyAxiom axiom)
           
 void visit(OWLSameIndividualAxiom axiom)
           
 void visit(OWLSubAnnotationPropertyOfAxiom axiom)
           
 void visit(OWLSubClassOfAxiom axiom)
           
 void visit(OWLSubDataPropertyOfAxiom axiom)
           
 void visit(OWLSubObjectPropertyOfAxiom axiom)
           
 void visit(OWLSubPropertyChainOfAxiom axiom)
           
 void visit(OWLSymmetricObjectPropertyAxiom axiom)
           
 void visit(OWLTransitiveObjectPropertyAxiom axiom)
           
 void visit(SWRLBuiltInAtom node)
           
 void visit(SWRLClassAtom node)
           
 void visit(SWRLDataPropertyAtom node)
           
 void visit(SWRLDataRangeAtom node)
           
 void visit(SWRLDifferentIndividualsAtom node)
           
 void visit(SWRLIndividualArgument node)
           
 void visit(SWRLLiteralArgument node)
           
 void visit(SWRLObjectPropertyAtom node)
           
 void visit(SWRLRule rule)
           
 void visit(SWRLSameIndividualAtom node)
           
 void visit(SWRLVariable node)
           
 void writeAnnotations(OWLAxiom axiom)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleRenderer

public SimpleRenderer()
Method Detail

reset

public void reset()

isUsingDefaultShortFormProvider

public boolean isUsingDefaultShortFormProvider()

resetShortFormProvider

public void resetShortFormProvider()
Resets the short form provider to the default short form provider, which is a PrefixManager with the default set of prefixes.


setPrefixesFromOntologyFormat

public void setPrefixesFromOntologyFormat(OWLOntology ontology,
                                          OWLOntologyManager manager,
                                          boolean processImportedOntologies)
Resets the short form provider and adds prefix name to prefix mappings based on the specified ontology's format (if it is a prefix format) and possibly the ontologies in the imports closure.

Parameters:
ontology - The ontology whose format will be used to obtain prefix mappings
manager - A manager which can be used to obtain the format of the specified ontology (and possibly ontologies in its imports closure)
processImportedOntologies - Specifies whether or not the prefix mapping should be obtained from imported ontologies.

setPrefix

public void setPrefix(java.lang.String prefixName,
                      java.lang.String prefix)
Sets a prefix name for a given prefix. Note that prefix names MUST end with a colon.

Parameters:
prefixName - The prefix name (ending with a colon)
prefix - The prefix that the prefix name maps to

setShortFormProvider

public void setShortFormProvider(ShortFormProvider shortFormProvider)
Override the short form provider that is used to generate abreviated names for entities

Specified by:
setShortFormProvider in interface OWLObjectRenderer
Parameters:
shortFormProvider - The short form provider to use

append

protected void append(java.lang.String s)

getShortForm

public java.lang.String getShortForm(IRI iri)

render

public java.lang.String render(OWLObject object)
Description copied from interface: OWLObjectRenderer
Renders the specified object.

Specified by:
render in interface OWLObjectRenderer
Parameters:
object - The object to be rendered.
Returns:
A string that represents the rendering of the object.

render

protected void render(java.util.Set<? extends OWLObject> objects)

visit

public void visit(OWLOntology ontology)
Specified by:
visit in interface OWLObjectVisitor

writeAnnotations

public void writeAnnotations(OWLAxiom axiom)

visit

public void visit(OWLSubClassOfAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLAsymmetricObjectPropertyAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLReflexiveObjectPropertyAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLDisjointClassesAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLDataPropertyDomainAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLObjectPropertyDomainAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLEquivalentObjectPropertiesAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLNegativeDataPropertyAssertionAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLDifferentIndividualsAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLDisjointDataPropertiesAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLDisjointObjectPropertiesAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLObjectPropertyRangeAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLObjectPropertyAssertionAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLFunctionalObjectPropertyAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLSubObjectPropertyOfAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLDisjointUnionAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLDeclarationAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLAnnotationAssertionAxiom axiom)
Specified by:
visit in interface OWLAnnotationAxiomVisitor

visit

public void visit(OWLSymmetricObjectPropertyAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLDataPropertyRangeAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLFunctionalDataPropertyAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLEquivalentDataPropertiesAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLClassAssertionAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLEquivalentClassesAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLDataPropertyAssertionAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLTransitiveObjectPropertyAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLIrreflexiveObjectPropertyAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLSubDataPropertyOfAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLInverseFunctionalObjectPropertyAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLSameIndividualAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLSubPropertyChainOfAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLClass desc)
Specified by:
visit in interface OWLClassExpressionVisitor
Specified by:
visit in interface OWLEntityVisitor

visit

public void visit(OWLObjectIntersectionOf desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLObjectUnionOf desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLObjectComplementOf desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLObjectSomeValuesFrom desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLObjectAllValuesFrom desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLObjectHasValue desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLObjectMinCardinality desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLObjectExactCardinality desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLObjectMaxCardinality desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLObjectHasSelf desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLObjectOneOf desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLDataSomeValuesFrom desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLDataAllValuesFrom desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLDataHasValue desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLDataMinCardinality desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLDataExactCardinality desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLDataMaxCardinality desc)
Specified by:
visit in interface OWLClassExpressionVisitor

visit

public void visit(OWLDatatype node)
Specified by:
visit in interface OWLDataRangeVisitor
Specified by:
visit in interface OWLEntityVisitor

visit

public void visit(OWLDataComplementOf node)
Specified by:
visit in interface OWLDataRangeVisitor

visit

public void visit(OWLDataOneOf node)
Specified by:
visit in interface OWLDataRangeVisitor

visit

public void visit(OWLDatatypeRestriction node)
Specified by:
visit in interface OWLDataRangeVisitor

visit

public void visit(OWLFacetRestriction node)
Specified by:
visit in interface OWLDataVisitor

visit

public void visit(OWLLiteral node)
Specified by:
visit in interface OWLAnnotationValueVisitor
Specified by:
visit in interface OWLDataVisitor

visit

public void visit(OWLObjectProperty property)
Specified by:
visit in interface OWLEntityVisitor
Specified by:
visit in interface OWLPropertyExpressionVisitor

visit

public void visit(OWLObjectInverseOf property)
Specified by:
visit in interface OWLPropertyExpressionVisitor

visit

public void visit(OWLDataProperty property)
Specified by:
visit in interface OWLEntityVisitor
Specified by:
visit in interface OWLPropertyExpressionVisitor

visit

public void visit(OWLNamedIndividual individual)
Specified by:
visit in interface OWLEntityVisitor
Specified by:
visit in interface OWLIndividualVisitor

visit

public void visit(OWLInverseObjectPropertiesAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLHasKeyAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(OWLDataIntersectionOf node)
Specified by:
visit in interface OWLDataRangeVisitor

visit

public void visit(OWLDataUnionOf node)
Specified by:
visit in interface OWLDataRangeVisitor

visit

public void visit(OWLAnnotationProperty property)
Specified by:
visit in interface OWLEntityVisitor

visit

public void visit(OWLAnnotationPropertyDomainAxiom axiom)
Specified by:
visit in interface OWLAnnotationAxiomVisitor

visit

public void visit(OWLAnnotationPropertyRangeAxiom axiom)
Specified by:
visit in interface OWLAnnotationAxiomVisitor

visit

public void visit(OWLSubAnnotationPropertyOfAxiom axiom)
Specified by:
visit in interface OWLAnnotationAxiomVisitor

visit

public void visit(OWLAnonymousIndividual individual)
Specified by:
visit in interface OWLAnnotationValueVisitor
Specified by:
visit in interface OWLIndividualVisitor

visit

public void visit(IRI iri)
Specified by:
visit in interface OWLAnnotationValueVisitor

visit

public void visit(OWLAnnotation node)
Specified by:
visit in interface OWLAnnotationObjectVisitor

visit

public void visit(SWRLRule rule)
Specified by:
visit in interface OWLAxiomVisitor
Specified by:
visit in interface SWRLObjectVisitor

visit

public void visit(SWRLClassAtom node)
Specified by:
visit in interface SWRLObjectVisitor

visit

public void visit(SWRLDataRangeAtom node)
Specified by:
visit in interface SWRLObjectVisitor

visit

public void visit(SWRLDifferentIndividualsAtom node)
Specified by:
visit in interface SWRLObjectVisitor

visit

public void visit(SWRLSameIndividualAtom node)
Specified by:
visit in interface SWRLObjectVisitor

visit

public void visit(SWRLObjectPropertyAtom node)
Specified by:
visit in interface SWRLObjectVisitor

visit

public void visit(SWRLDataPropertyAtom node)
Specified by:
visit in interface SWRLObjectVisitor

visit

public void visit(SWRLBuiltInAtom node)
Specified by:
visit in interface SWRLObjectVisitor

visit

public void visit(OWLDatatypeDefinitionAxiom axiom)
Specified by:
visit in interface OWLAxiomVisitor

visit

public void visit(SWRLVariable node)
Specified by:
visit in interface SWRLObjectVisitor

visit

public void visit(SWRLIndividualArgument node)
Specified by:
visit in interface SWRLObjectVisitor

visit

public void visit(SWRLLiteralArgument node)
Specified by:
visit in interface SWRLObjectVisitor

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object