public class TaxonomyPrinter extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static Comparator<ElkClass> |
CLASS_COMPARATOR |
protected static Comparator<ElkNamedIndividual> |
INDIVIDUAL_COMPARATOR |
| Constructor and Description |
|---|
TaxonomyPrinter() |
| Modifier and Type | Method and Description |
|---|---|
static void |
dumpClassTaxomomy(Taxonomy<ElkClass> taxonomy,
Writer writer,
boolean addHash)
Print the contents of the given
Taxonomy to the specified Writer. |
static void |
dumpClassTaxomomyToFile(Taxonomy<ElkClass> taxonomy,
String fileName,
boolean addHash)
Convenience method for printing a
Taxonomy to a file at the given
location. |
static void |
dumpInstanceTaxomomy(InstanceTaxonomy<ElkClass,ElkNamedIndividual> taxonomy,
Writer writer,
boolean addHash)
Print the contents of the given
InstanceTaxonomy to the specified
Writer. |
static void |
dumpInstanceTaxomomyToFile(InstanceTaxonomy<ElkClass,ElkNamedIndividual> taxonomy,
String fileName,
boolean addHash)
Convenience method for printing an
InstanceTaxonomy to a file at
the given location. |
static String |
getHashString(Taxonomy<ElkClass> taxonomy)
Get a has string for the given
Taxonomy. |
static String |
getInstanceHashString(InstanceTaxonomy<ElkClass,ElkNamedIndividual> taxonomy) |
protected static void |
printClassAxioms(ElkClass elkClass,
ArrayList<ElkClass> orderedEquivalentClasses,
TreeSet<ElkClass> orderedSubClasses,
Appendable writer)
Process axioms related to one
ElkClass, where the relevant
related classes are given in two ordered collections of equivalent
classes and subclasses, respectively. |
protected static void |
printDeclarations(Taxonomy<ElkClass> classTaxonomy,
ElkObjectFactory objectFactory,
Appendable writer)
Prints class declarations
|
protected static void |
printIndividualAxioms(ElkNamedIndividual individual,
ArrayList<ElkNamedIndividual> orderedSameIndividuals,
TreeSet<ElkClass> orderedDirectClasses,
ElkObjectFactory objectFactory,
Writer writer) |
protected static void |
printIndividualDeclarations(Set<? extends InstanceNode<ElkClass,ElkNamedIndividual>> individualNodes,
ElkObjectFactory objectFactory,
Writer writer) |
protected static void |
processInstanceTaxomomy(InstanceTaxonomy<ElkClass,ElkNamedIndividual> taxonomy,
Writer writer) |
protected static void |
processTaxomomy(Taxonomy<ElkClass> classTaxonomy,
Appendable writer)
Process a taxonomy and write a normalized serialization.
|
protected static Comparator<ElkClass> CLASS_COMPARATOR
protected static Comparator<ElkNamedIndividual> INDIVIDUAL_COMPARATOR
public static void dumpClassTaxomomyToFile(Taxonomy<ElkClass> taxonomy, String fileName, boolean addHash) throws IOException
Taxonomy to a file at the given
location.taxonomy - fileName - addHash - if true, a hash string will be added at the end of the output
using comment syntax of OWL 2 Functional StyleIOException - If an I/O error occursdumpClassTaxomomy(org.semanticweb.elk.reasoner.taxonomy.model.Taxonomy<org.semanticweb.elk.owl.interfaces.ElkClass>, java.io.Writer, boolean)public static void dumpClassTaxomomy(Taxonomy<ElkClass> taxonomy, Writer writer, boolean addHash) throws IOException
Taxonomy to the specified Writer.
Expressions are ordered for generating the output, ensuring that the
output is deterministic.taxonomy - writer - addHash - if true, a hash string will be added at the end of the output
using comment syntax of OWL 2 Functional StyleIOException - If an I/O error occurspublic static void dumpInstanceTaxomomyToFile(InstanceTaxonomy<ElkClass,ElkNamedIndividual> taxonomy, String fileName, boolean addHash) throws IOException
InstanceTaxonomy to a file at
the given location.taxonomy - fileName - addHash - if true, a hash string will be added at the end of the output
using comment syntax of OWL 2 Functional StyleIOException - If an I/O error occursdumpInstanceTaxomomy(org.semanticweb.elk.reasoner.taxonomy.model.InstanceTaxonomy<org.semanticweb.elk.owl.interfaces.ElkClass, org.semanticweb.elk.owl.interfaces.ElkNamedIndividual>, java.io.Writer, boolean)public static void dumpInstanceTaxomomy(InstanceTaxonomy<ElkClass,ElkNamedIndividual> taxonomy, Writer writer, boolean addHash) throws IOException
InstanceTaxonomy to the specified
Writer. Expressions are ordered for generating the output, ensuring that
the output is deterministic.taxonomy - writer - addHash - if true, a hash string will be added at the end of the output
using comment syntax of OWL 2 Functional StyleIOException - If an I/O error occurspublic static String getHashString(Taxonomy<ElkClass> taxonomy)
Taxonomy. Besides possible hash
collisions (which have very low probability) the hash string is the same
for two inputs if and only if the inputs describe the same taxonomy. So
it can be used to compare classification results.taxonomy - public static String getInstanceHashString(InstanceTaxonomy<ElkClass,ElkNamedIndividual> taxonomy)
protected static void processTaxomomy(Taxonomy<ElkClass> classTaxonomy, Appendable writer) throws IOException
classTaxonomy - writer - IOExceptionprotected static void printDeclarations(Taxonomy<ElkClass> classTaxonomy, ElkObjectFactory objectFactory, Appendable writer) throws IOException
classTaxonomy - objectFactory - writer - IOExceptionprotected static void printIndividualDeclarations(Set<? extends InstanceNode<ElkClass,ElkNamedIndividual>> individualNodes, ElkObjectFactory objectFactory, Writer writer) throws IOException
IOExceptionprotected static void printClassAxioms(ElkClass elkClass, ArrayList<ElkClass> orderedEquivalentClasses, TreeSet<ElkClass> orderedSubClasses, Appendable writer) throws IOException
ElkClass, where the relevant
related classes are given in two ordered collections of equivalent
classes and subclasses, respectively. The method serializes the axioms to
the Writer.elkClass - orderedEquivalentClasses - orderedSubClasses - writer - IOExceptionprotected static void printIndividualAxioms(ElkNamedIndividual individual, ArrayList<ElkNamedIndividual> orderedSameIndividuals, TreeSet<ElkClass> orderedDirectClasses, ElkObjectFactory objectFactory, Writer writer) throws IOException
IOExceptionprotected static void processInstanceTaxomomy(InstanceTaxonomy<ElkClass,ElkNamedIndividual> taxonomy, Writer writer) throws IOException
IOExceptionCopyright © 2011-2015 Department of Computer Science, University of Oxford. All Rights Reserved.