/** * @param exps the class expressions * @return the set of modified OWL class expressions */ public Set<OWLClassExpression> replaceBottom(Stream<? extends OWLClassExpression> exps) { checkNotNull(exps, "exps cannot be null"); return asUnorderedSet(exps.map(this::replaceBottom)); }
/** * Gets the objects. * * @return the objects */ protected Set<E> getObjects() { return asUnorderedSet(getOntologies().flatMap(this::getObjects)); }
/** * Gets the objects. * * @return the objects */ protected Set<E> getObjects() { return asUnorderedSet(getOntologies().flatMap(this::getObjects)); }
/** * @param exps the class expressions * @return the set of modified OWL class expressions */ public Set<OWLClassExpression> replaceBottom(Stream<? extends OWLClassExpression> exps) { checkNotNull(exps, "exps cannot be null"); return asUnorderedSet(exps.map(this::replaceBottom)); }
/** * @param axioms The set of axioms to be tested * @return true if axioms are entailed * @see OWLReasoner#isEntailed(Set) */ default boolean isEntailed(Stream<? extends OWLAxiom> axioms) { return isEntailed(asUnorderedSet(axioms)); }
/** * @param elements elements * @param warning warning */ public SetOfIndividualsImpl(NodeSet<OWLNamedIndividual> elements, String warning) { this(asUnorderedSet(elements.entities(), OWLIndividual.class), warning); }
@Override public Set<E> getEntitiesMinusBottom() { Optional<E> bottomEntity = getBottomEntity(); if (bottomEntity.isPresent()) { return getEntitiesMinus(bottomEntity.get()); } return asUnorderedSet(entities.stream()); }
@Override public Set<E> getEntitiesMinusTop() { Optional<E> topEntity = getTopEntity(); if (topEntity.isPresent()) { return getEntitiesMinus(topEntity.get()); } return asUnorderedSet(entities.stream()); }
@Override public Set<E> getEntitiesMinusTop() { Optional<E> topEntity = getTopEntity(); if (topEntity.isPresent()) { return getEntitiesMinus(topEntity.get()); } return asUnorderedSet(entities.stream()); }
@Override public Set<E> getEntitiesMinusBottom() { Optional<E> bottomEntity = getBottomEntity(); if (bottomEntity.isPresent()) { return getEntitiesMinus(bottomEntity.get()); } return asUnorderedSet(entities.stream()); }
private Set<OWLAxiom> build(OWLAxiom parentAxiom) { usedAxioms.add(parentAxiom); OWLAxiomPartExtractor extractor = new OWLAxiomPartExtractor(); parentAxiom.accept(extractor); return asUnorderedSet(extractor.getRHS().stream().flatMap(HasSignature::signature) .flatMap(this::getAxiomsByLHS).filter(usedAxioms::add)); }
@Override protected void addAxioms(OWLDataProperty entity, OWLReasoner reasoner, OWLDataFactory dataFactory, Set<OWLEquivalentDataPropertiesAxiom> result) { Set<OWLDataProperty> props = asUnorderedSet( reasoner.getEquivalentDataProperties(entity).entities()); props.add(entity); if (props.size() > 1) { result.add(dataFactory.getOWLEquivalentDataPropertiesAxiom(props)); } }
@Override protected void addAxioms(OWLClass entity, OWLReasoner reasoner, OWLDataFactory dataFactory, Set<OWLEquivalentClassesAxiom> result) { Set<OWLClassExpression> equivalentClasses = asUnorderedSet( reasoner.getEquivalentClasses(entity).entities(), OWLClassExpression.class); equivalentClasses.add(entity); if (equivalentClasses.size() > 1) { result.add(dataFactory.getOWLEquivalentClassesAxiom(equivalentClasses)); } }
/** * @return entities with invalid qnames */ public Set<OWLEntity> getEntitiesWithInvalidQNames() { return asUnorderedSet( getEntitiesThatRequireNamespaces().stream().filter(e -> !e.getIRI().getRemainder() .isPresent())); } }
/** * @return entities with invalid qnames */ public Set<OWLEntity> getEntitiesWithInvalidQNames() { return asUnorderedSet( getEntitiesThatRequireNamespaces().stream().filter(e -> !e.getIRI().getRemainder() .isPresent())); } }
public void computeHierarchy() { pm.reasonerTaskStarted("Computing " + name + " hierarchy"); pm.reasonerTaskBusy(); nodeCache.clear(); Map<T, Collection<T>> cache = new HashMap<>(); Set<T> entities = asUnorderedSet( getRootOntology().importsClosure().flatMap(this::getEntities)); classificationSize = entities.size(); pm.reasonerTaskProgressChanged(0, classificationSize); updateForSignature(entities, cache); pm.reasonerTaskStopped(); }
public void computeHierarchy() { pm.reasonerTaskStarted("Computing " + name + " hierarchy"); pm.reasonerTaskBusy(); nodeCache.clear(); Map<T, Collection<T>> cache = new HashMap<>(); Set<T> entities = asUnorderedSet( getRootOntology().importsClosure().flatMap(this::getEntities)); classificationSize = entities.size(); pm.reasonerTaskProgressChanged(0, classificationSize); updateForSignature(entities, cache); pm.reasonerTaskStopped(); }
@Override protected Set<OWLEntity> getEntitiesThatRequireNamespaces() { return asUnorderedSet( Stream.of( getOntology().axioms(AxiomType.OBJECT_PROPERTY_ASSERTION).flatMap( ax -> ax.getProperty().objectPropertiesInSignature()), getOntology().axioms(AxiomType.DATA_PROPERTY_ASSERTION) .map(ax -> ax.getProperty().asOWLDataProperty()), getOntology().annotationPropertiesInSignature(Imports.INCLUDED)).flatMap(x -> x)); }
@Override protected Set<OWLEntity> getEntitiesThatRequireNamespaces() { return asUnorderedSet( Stream.of( getOntology().axioms(AxiomType.OBJECT_PROPERTY_ASSERTION).flatMap( ax -> ax.getProperty().objectPropertiesInSignature()), getOntology().axioms(AxiomType.DATA_PROPERTY_ASSERTION) .map(ax -> ax.getProperty().asOWLDataProperty()), getOntology().annotationPropertiesInSignature(Imports.INCLUDED)).flatMap(x -> x)); }
@Override protected Set<OWLEntity> getEntitiesThatRequireNamespaces() { return asUnorderedSet( Stream.of( getOntology().axioms(AxiomType.OBJECT_PROPERTY_ASSERTION).flatMap( ax -> ax.getProperty().objectPropertiesInSignature()), getOntology().axioms(AxiomType.DATA_PROPERTY_ASSERTION) .map(ax -> ax.getProperty().asOWLDataProperty()), getOntology().annotationPropertiesInSignature(Imports.INCLUDED)).flatMap(x -> x)); }