@Override public void print(final Taxonomy<T> taxonomy) { print(taxonomy, new PrintWriter(System.out)); }
/** * Print the _node contents with indentation and newline * * @param set * @param indent */ protected void printNode(final Set<T> set, final String indent) { _out.print(indent); printNode(set); _out.println(); }
@Override public void print(final Taxonomy<T> taxonomy, final PrintWriter out) { _taxonomyImpl = taxonomy; _out = out; out.println(); printTree(); out.println(); out.flush(); }
/** * Print the tree rooted at the given _node * * @param _node * @param indent */ protected void printTree(final Set<T> set, final String indent) { if (set.contains(_taxonomyImpl.getBottomNode().getName())) return; printNode(set, indent); final T c = set.iterator().next(); final Set<Set<T>> subs = ss(_taxonomyImpl.getSubs(c, true)); final Iterator<Set<T>> j = subs.iterator(); while (j.hasNext()) { final Set<T> eqs = j.next(); if (eqs.contains(c)) continue; printTree(s(eqs), indent + " "); } }
@Override public void run() { _timers.execute("reasonerClassify", x -> { // classify ontology _reasoner.flush(); _reasoner.getKB().classify(); }); if (_logger.isLoggable(Level.FINE)) { _logger.fine("Regular taxonomy:"); new TreeTaxonomyPrinter<ATermAppl>().print(_reasoner.getKB().getTaxonomy(), new PrintWriter(System.err)); } _taxonomyImpl = _timers.execute("buildClassHierarchy", () -> buildClassHierarchy(_reasoner)); if (_logger.isLoggable(Level.FINE)) { _logger.fine("Copied taxonomy:"); new TreeTaxonomyPrinter<OWLClass>().print(_taxonomyImpl, new PrintWriter(System.err)); } } };
/** * Print the taxonomy as an indented tree */ protected void printTree() { final Set<T> top = new TreeSet<>(Comparators.stringComparator); top.add(_taxonomyImpl.getTop().getName()); top.addAll(_taxonomyImpl.getTop().getEquivalents()); printTree(top, " "); final Set<T> bottom = new TreeSet<>(Comparators.stringComparator); bottom.add(_taxonomyImpl.getBottomNode().getName()); bottom.addAll(_taxonomyImpl.getBottomNode().getEquivalents()); if (bottom.size() > 1) printNode(bottom, " "); }
new TreeTaxonomyPrinter<ATermAppl>().print(_reasoner.getKB().getTaxonomy(), new PrintWriter(System.err)); new TreeTaxonomyPrinter<OWLClass>().print(_taxonomyImpl, new PrintWriter(System.err));
/** * Print the tree rooted at the given _node * * @param _node * @param indent */ protected void printTree(final Set<T> set, final String indent) { if (set.contains(_taxonomyImpl.getBottomNode().getName())) return; printNode(set, indent); final T c = set.iterator().next(); final Set<Set<T>> subs = ss(_taxonomyImpl.getSubs(c, true)); final Iterator<Set<T>> j = subs.iterator(); while (j.hasNext()) { final Set<T> eqs = j.next(); if (eqs.contains(c)) continue; printTree(s(eqs), indent + " "); } }
@Override public void run() { _timers.execute("reasonerClassify", x -> { // classify ontology _reasoner.flush(); _reasoner.getKB().classify(); }); if (_logger.isLoggable(Level.FINE)) { _logger.fine("Regular taxonomy:"); new TreeTaxonomyPrinter<ATermAppl>().print(_reasoner.getKB().getTaxonomy(), new PrintWriter(System.err)); } _taxonomyImpl = _timers.execute("buildClassHierarchy", () -> buildClassHierarchy(_reasoner)); if (_logger.isLoggable(Level.FINE)) { _logger.fine("Copied taxonomy:"); new TreeTaxonomyPrinter<OWLClass>().print(_taxonomyImpl, new PrintWriter(System.err)); } } };
/** * Print the taxonomy as an indented tree */ protected void printTree() { final Set<T> top = new TreeSet<>(Comparators.stringComparator); top.add(_taxonomyImpl.getTop().getName()); top.addAll(_taxonomyImpl.getTop().getEquivalents()); printTree(top, " "); final Set<T> bottom = new TreeSet<>(Comparators.stringComparator); bottom.add(_taxonomyImpl.getBottomNode().getName()); bottom.addAll(_taxonomyImpl.getBottomNode().getEquivalents()); if (bottom.size() > 1) printNode(bottom, " "); }
new TreeTaxonomyPrinter<ATermAppl>().print(_reasoner.getKB().getTaxonomy(), new PrintWriter(System.err)); new TreeTaxonomyPrinter<OWLClass>().print(_taxonomyImpl, new PrintWriter(System.err));
new TreeTaxonomyPrinter<OWLClass>().print(_taxonomyImpl, new PrintWriter(System.err));
/** * Print the _node contents with indentation and newline * * @param set * @param indent */ protected void printNode(final Set<T> set, final String indent) { _out.print(indent); printNode(set); _out.println(); }
@Override public void print(final Taxonomy<T> taxonomy) { print(taxonomy, new PrintWriter(System.out)); }
@Override public void print(final Taxonomy<T> taxonomy, final PrintWriter out) { _taxonomyImpl = taxonomy; _out = out; out.println(); printTree(); out.println(); out.flush(); }
new TreeTaxonomyPrinter<OWLClass>().print(_taxonomyImpl, new PrintWriter(System.err));
@Override protected void printNode(final Set<OWLClass> set) { super.printNode(set); final Set<OWLNamedIndividual> instances = getDirectInstances(_taxonomyImpl, set.iterator().next()); if (instances.size() > 0) { _out.print(" - ("); boolean printed = false; for (final OWLNamedIndividual x : instances) { if (printed) _out.print(", "); else printed = true; printURI(_out, x); } _out.print(")"); } }
@Override protected void printNode(final Set<OWLClass> set) { super.printNode(set); final Set<OWLNamedIndividual> instances = getDirectInstances(_taxonomyImpl, set.iterator().next()); if (instances.size() > 0) { _out.print(" - ("); boolean printed = false; for (final OWLNamedIndividual x : instances) { if (printed) _out.print(", "); else printed = true; printURI(_out, x); } _out.print(")"); } }