/** * @param o axioms to wrap * @return axioms wrapped as AxiomWrapper */ public static List<AxiomWrapper> wrap(List<OWLAxiom> o) { return asList(o.stream().map(AxiomWrapper::new)); } }
/** * @param arg head atom * @return builder */ public BuilderSWRLRule withHead(Stream<SWRLAtom> arg) { add(head, arg); return this; }
/** * @param input collection to partition * @return a stream of elements for a triangular matrix of size {@code l.size()}, where l is the * list corresponding to the input collection. For input of length 3, the values are * (l.get(1),l.get(2)), (l.get(1),l.get(3)), (l.get(2),l.get(3)) */ public static <T> Stream<Pair<T>> pairs(Stream<T> input) { return pairs(asList(input)); }
/** * @param input collection to partition * @return a stream of coordinates for a symmetric matrix of size {@code l.size()}, where l is * the list corresponding to the input collection, excluding main diagonal. For input 3, * the values are (l.get(1),l.get(2)), (l.get(1),l.get(3)), (l.get(2),l.get(3)), * (l.get(2),l.get(1)),(l.get(3),l.get(1)), (l.get(3),l.get(2)) */ public static <T> Stream<Pair<T>> allPairs(Stream<T> input) { return allPairs(asList(input)); }
/** * Gets the has key axioms that have the specified class as their subject. * * @param cls The subject of the has key axioms * @return the axioms matching the search. The set is a copy of the data. * @deprecated use the stream method */ @Deprecated default Set<OWLHasKeyAxiom> getHasKeyAxioms(OWLClass cls) { return asSet(hasKeyAxioms(cls)); }
/** * @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 visitor visitor to apply to all pairwise elements in this axiom; pairs are not * ordered, i.e., only (i,j) will be considered, for i!=j; (j, i) is not considered. * @return true if all pairs evaluation is true */ default boolean allMatch(OWLPairwiseBooleanVisitor<C> visitor) { return pairs(operands()).allMatch(v -> visitor.visit(v.i, v.j)); }
/** * A convenience method that obtains the annotation properties that are in * the signature of this object. * * @return A stream of the annotation properties that are in the signature of this object. */ default Stream<OWLAnnotationProperty> annotationPropertiesInSignature() { return empty(); } }
/** * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are ordered, * i.e., (i, j) and (j, i) will be considered. (i,i) is skipped. */ default void forEachAllPairs(OWLPairwiseVoidVisitor<C> visitor) { allPairs(operands()).forEach(v -> visitor.visit(v.i, v.j)); }
/** * Gets the datatype definition axioms for the specified datatype. * * @param datatype The datatype * @return The set of datatype definition axioms for the specified datatype. The set is a copy * of the data. * @deprecated use the stream method */ @Deprecated default Set<OWLDatatypeDefinitionAxiom> getAxioms(OWLDatatype datatype) { return asSet(axioms(datatype)); }
/** * @param input collection to partition * @return a stream of coordinates for a symmetric matrix of size {@code l.size()}, where l is * the list corresponding to the input collection, excluding main diagonal. For input 3, * the values are (l.get(1),l.get(2)), (l.get(1),l.get(3)), (l.get(2),l.get(3)), * (l.get(2),l.get(1)),(l.get(3),l.get(1)), (l.get(3),l.get(2)) */ public static <T> Stream<Pair<T>> allPairs(Stream<T> input) { return allPairs(asList(input)); }
/** * Gets the objects. * * @return the objects */ protected Set<E> getObjects() { return asUnorderedSet(getOntologies().flatMap(this::getObjects)); }
/** * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are not * ordered, i.e., only (i,j) will be considered, for i!=j; (j, i) is not considered. */ default void forEach(OWLPairwiseVoidVisitor<C> visitor) { pairs(operands()).forEach(v -> visitor.visit(v.i, v.j)); }
@Override public Stream<? extends OWLClassExpression> doDefault(Object o) { return empty(); } };
/** * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are ordered, * i.e., (i, j) and (j, i) will be considered. (i,i) is skipped. * @return true if at least one pair evaluation is true */ default boolean anyMatchAllPairs(OWLPairwiseBooleanVisitor<C> visitor) { return allPairs(operands()).anyMatch(v -> visitor.visit(v.i, v.j)); }
/** * @param o ontology of interest * @return the violations found, filtered by ontology */ public List<OWLProfileViolation> getViolations(OWLOntology o) { return asList(violations.stream().filter(v -> Objects.equals(v.getOntology(), o))); }
/** * @return the individuals * @deprecated use the stream method */ @Deprecated default Set<OWLIndividual> getIndividuals() { return asSet(individuals()); }
/** * @param arg items to add * @return builder */ @SuppressWarnings({"unchecked"}) public B withItems(Stream<? extends I> arg) { add(items, arg); return (B) this; }
/** * @param input collection to partition * @return a stream of coordinates for a symmetric matrix of size {@code l.size()}, where l is * the list corresponding to the input collection, excluding main diagonal. For input 3, * the values are (l.get(1),l.get(2)), (l.get(1),l.get(3)), (l.get(2),l.get(3)), * (l.get(2),l.get(1)),(l.get(3),l.get(1)), (l.get(3),l.get(2)) */ public static <T> Stream<Pair<T>> allPairs(Stream<T> input) { return allPairs(asList(input)); }
/** * @param <T> type returned by visitor * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are not * ordered, i.e., only (i,j) will be considered, for i!=j; (j, i) is not considered. * @return collection of all visitor return values that are not null */ default <T> Collection<T> walkPairwise(OWLPairwiseVisitor<T, C> visitor) { return asList(pairs(operands()).map(v -> visitor.visit(v.i, v.j)).filter(Objects::nonNull)); }