public POTaxonomyBuilder(KnowledgeBase kb, PartialOrderComparator<ATermAppl> comparator) { this.kb = kb; this.tax = new Taxonomy<ATermAppl>( null, ATermUtils.TOP, ATermUtils.BOTTOM ); this.builder = new PartialOrderBuilder<ATermAppl>( tax, comparator ); }
public POTaxonomyBuilder(KnowledgeBase kb, PartialOrderComparator<ATermAppl> comparator) { this.kb = kb; this.tax = new Taxonomy<ATermAppl>( null, ATermUtils.TOP, ATermUtils.BOTTOM ); this.builder = new PartialOrderBuilder<ATermAppl>( tax, comparator ); }
public static <T> Taxonomy<T> build(Collection<? extends T> elements, PartialOrderComparator<T> comparator, T top, T bottom) { Taxonomy<T> hierarchy = new Taxonomy<T>( null, top, bottom ); PartialOrderBuilder<T> builder = new PartialOrderBuilder<T>( hierarchy, comparator ); builder.addAll( elements ); return hierarchy; }
public static <T> Taxonomy<T> build(Collection<? extends T> elements, PartialOrderComparator<T> comparator, T top, T bottom) { Taxonomy<T> hierarchy = new Taxonomy<T>( null, top, bottom ); PartialOrderBuilder<T> builder = new PartialOrderBuilder<T>( hierarchy, comparator ); builder.addAll( elements ); return hierarchy; }
/** * {@inheritDoc} */ public NodeSet<OWLClass> getDisjointClasses(OWLClassExpression ce) { DisjointClassComparator disjointClassComparator = new DisjointClassComparator( taxonomy, ce ); if( !taxonomy.contains( disjointClassComparator.getComplementRepresentation() ) ) { reasoner.flush(); PartialOrderBuilder<OWLClass> orderBuilder = new PartialOrderBuilder<OWLClass>(taxonomy, disjointClassComparator); orderBuilder.add( disjointClassComparator.getComplementRepresentation(), true ); } OWLClassNodeSet result = new OWLClassNodeSet(); for (Set<OWLClass> equivSet : taxonomy.getSubs( disjointClassComparator.getComplementRepresentation(), false ) ) { result.addSameEntities( equivSet ); } return result; }