public static <T> Taxonomy<T> build(final Collection<? extends T> elements, final PartialOrderComparator<T> comparator, final T top, final T bottom) { final Taxonomy<T> hierarchy = new TaxonomyImpl<>(null, top, bottom); final PartialOrderBuilder<T> builder = new PartialOrderBuilder<>(hierarchy, comparator); builder.addAll(elements); return hierarchy; }
@Override public void classify(final ATermAppl c) { _builder.add(c); }
public static <T> Taxonomy<T> build(final Collection<? extends T> elements, final PartialOrderComparator<T> comparator) { return build(elements, comparator, null, null); }
/** * {@inheritDoc} */ @Override public NodeSet<OWLClass> getDisjointClasses(final OWLClassExpression ce) { final DisjointClassComparator disjointClassComparator = new DisjointClassComparator(_taxonomyImpl, ce); if (!_taxonomyImpl.contains(disjointClassComparator.getComplementRepresentation())) { _reasoner.flush(); final PartialOrderBuilder<OWLClass> orderBuilder = new PartialOrderBuilder<>(_taxonomyImpl, disjointClassComparator); orderBuilder.add(disjointClassComparator.getComplementRepresentation(), true); } final OWLClassNodeSet result = new OWLClassNodeSet(); for (final Set<OWLClass> equivSet : _taxonomyImpl.getSubs(disjointClassComparator.getComplementRepresentation(), false)) result.addSameEntities(equivSet); return result; }
public PartialOrderTaxonomyBuilder(final KnowledgeBase kb, final PartialOrderComparator<ATermAppl> comparator) { _kb = kb; _tax = new TaxonomyImpl<>(null, ATermUtils.TOP, ATermUtils.BOTTOM); _builder = new PartialOrderBuilder<>(_tax, comparator); }
@Override public boolean classify() { _builder.addAll(_kb.getClasses()); return true; }
public PartialOrderComparator<ATermAppl> getComparator() { return _builder.getComparator(); }
/** * {@inheritDoc} */ @Override public NodeSet<OWLClass> getDisjointClasses(final OWLClassExpression ce) { final DisjointClassComparator disjointClassComparator = new DisjointClassComparator(_taxonomyImpl, ce); if (!_taxonomyImpl.contains(disjointClassComparator.getComplementRepresentation())) { _reasoner.flush(); final PartialOrderBuilder<OWLClass> orderBuilder = new PartialOrderBuilder<>(_taxonomyImpl, disjointClassComparator); orderBuilder.add(disjointClassComparator.getComplementRepresentation(), true); } final OWLClassNodeSet result = new OWLClassNodeSet(); for (final Set<OWLClass> equivSet : _taxonomyImpl.getSubs(disjointClassComparator.getComplementRepresentation(), false)) result.addSameEntities(equivSet); return result; }
public PartialOrderTaxonomyBuilder(final KnowledgeBase kb, final PartialOrderComparator<ATermAppl> comparator) { _kb = kb; _tax = new TaxonomyImpl<>(null, ATermUtils.TOP, ATermUtils.BOTTOM); _builder = new PartialOrderBuilder<>(_tax, comparator); }
@Override public boolean classify() { _builder.addAll(_kb.getClasses()); return true; }
public PartialOrderComparator<ATermAppl> getComparator() { return _builder.getComparator(); }
@Override public void classify(final ATermAppl c) { _builder.add(c); }
public static <T> Taxonomy<T> build(final Collection<? extends T> elements, final PartialOrderComparator<T> comparator, final T top, final T bottom) { final Taxonomy<T> hierarchy = new TaxonomyImpl<>(null, top, bottom); final PartialOrderBuilder<T> builder = new PartialOrderBuilder<>(hierarchy, comparator); builder.addAll(elements); return hierarchy; }
public static <T> Taxonomy<T> build(final Collection<? extends T> elements, final PartialOrderComparator<T> comparator) { return build(elements, comparator, null, null); }
public void add(final T toAdd) { add(toAdd, false); }
/** * Adds a collection of elements to the partial _order. * * @param elements new elements to add */ public void addAll(final Collection<? extends T> elements) { for (final T toInsert : elements) add(toInsert); }
/** * Adds a collection of elements to the partial _order. * * @param elements new elements to add */ public void addAll(final Collection<? extends T> elements) { for (final T toInsert : elements) add(toInsert); }
public void add(final T toAdd) { add(toAdd, false); }