/** * Checks if c is defined (is included in equivalent axioms) in o. * * @param o ontology * @param c class * @return true for defined classes */ public static boolean isDefined(OWLClass c, OWLOntology o) { return o.equivalentClassesAxioms(c).findAny().isPresent(); }
/** * Checks if c is defined (is included in equivalent axioms) in o. * * @param o ontology * @param c class * @return true for defined classes */ public static boolean isDefined(OWLClass c, OWLOntology o) { return o.equivalentClassesAxioms(c).findAny().isPresent(); }
/** * Checks if c is defined (is included in equivalent axioms) in o. * * @param o ontology * @param c class * @return true for defined classes */ public static boolean isDefined(OWLClass c, OWLOntology o) { return o.equivalentClassesAxioms(c).findAny().isPresent(); }
@Override public Stream<OWLEquivalentClassesAxiom> equivalentClassesAxioms(OWLClass cls) { return withReadLock(() -> delegate.equivalentClassesAxioms(cls)); }
/** * A convenience method that examines the axioms in the specified ontology and returns the class * expressions corresponding to equivalent classes of this class. * * @param e entity * @param ontology The ontology to be examined for axioms * @return A {@code Set} of {@code OWLClassExpression}s that represent the equivalent classes of * this class, that have been asserted in the specified ontology. */ public static Stream<OWLClassExpression> getEquivalentClasses(OWLClass e, OWLOntology ontology) { return Searcher.equivalent(ontology.equivalentClassesAxioms(e)).filter(c -> !c.equals(e)) .map(c -> (OWLClassExpression) c); }
/** * A convenience method that examines the axioms in the specified ontology and returns the class * expressions corresponding to equivalent classes of this class. * * @param e entity * @param ontology The ontology to be examined for axioms * @return A {@code Set} of {@code OWLClassExpression}s that represent the equivalent classes of * this class, that have been asserted in the specified ontology. */ public static Stream<OWLClassExpression> getEquivalentClasses(OWLClass e, OWLOntology ontology) { return Searcher.equivalent(ontology.equivalentClassesAxioms(e)).filter(c -> !c.equals(e)) .map(c -> (OWLClassExpression) c); }
@Override public Stream<OWLEquivalentClassesAxiom> equivalentClassesAxioms(OWLClass cls) { return withReadLock(() -> delegate.equivalentClassesAxioms(cls)); }
@Override public Stream<OWLEquivalentClassesAxiom> equivalentClassesAxioms(OWLClass cls) { return withReadLock(() -> delegate.equivalentClassesAxioms(cls)); }
/** * A convenience method that examines the axioms in the specified ontology and returns the class * expressions corresponding to equivalent classes of this class. * * @param e entity * @param ontology The ontology to be examined for axioms * @return A {@code Set} of {@code OWLClassExpression}s that represent the equivalent classes of * this class, that have been asserted in the specified ontology. */ public static Stream<OWLClassExpression> getEquivalentClasses(OWLClass e, OWLOntology ontology) { return Searcher.equivalent(ontology.equivalentClassesAxioms(e)).filter(c -> !c.equals(e)) .map(c -> (OWLClassExpression) c); }
@Override public Stream<OWLEquivalentClassesAxiom> equivalentClassesAxioms(OWLClass cls) { return withReadLock(() -> delegate.equivalentClassesAxioms(cls)); }
@Override public Integer recomputeMetric() { Set<OWLClass> processedClasses = new HashSet<>(); OptionalLong max = getOntologies() .flatMapToLong(o -> o.classesInSignature().filter(processedClasses::add) .mapToLong( cls -> equivalent(o.equivalentClassesAxioms(cls), OWLClassExpression.class) .filter(d -> !d.isAnonymous()).count())) .max(); return Integer.valueOf((int) max.orElse(0L)); }
@Override public Integer recomputeMetric() { Set<OWLClass> processedClasses = new HashSet<>(); OptionalLong max = getOntologies() .flatMapToLong(o -> o.classesInSignature().filter(processedClasses::add) .mapToLong( cls -> equivalent(o.equivalentClassesAxioms(cls), OWLClassExpression.class) .filter(d -> !d.isAnonymous()).count())) .max(); return Integer.valueOf((int) max.orElse(0L)); }
@Override public Integer recomputeMetric() { Set<OWLClass> processedClasses = new HashSet<>(); OptionalLong max = getOntologies() .flatMapToLong(o -> o.classesInSignature().filter(processedClasses::add) .mapToLong( cls -> equivalent(o.equivalentClassesAxioms(cls), OWLClassExpression.class) .filter(d -> !d.isAnonymous()).count())) .max(); return Integer.valueOf((int) max.orElse(0L)); }
@Override public Integer recomputeMetric() { Set<OWLClass> processedClasses = new HashSet<>(); OptionalLong max = getOntologies() .flatMapToLong(o -> o.classesInSignature().filter(processedClasses::add) .mapToLong( cls -> equivalent(o.equivalentClassesAxioms(cls), OWLClassExpression.class) .filter(d -> !d.isAnonymous()).count())) .max(); return Integer.valueOf((int) max.orElse(0L)); }
private void generateChanges() { Set<OWLClassExpression> supers = new HashSet<>(); for (OWLOntology o : ontologies) { o.equivalentClassesAxioms(cls).forEach(ax -> { addChange(new RemoveAxiom(o, ax)); ax.classExpressions().forEach(c -> collectClassExpressions(c, supers)); }); } supers.remove(cls); supers.forEach( sup -> addChange(new AddAxiom(targetOntology, df.getOWLSubClassOfAxiom(cls, sup)))); }
private void generateChanges() { Set<OWLClassExpression> supers = new HashSet<>(); for (OWLOntology o : ontologies) { o.equivalentClassesAxioms(cls).forEach(ax -> { addChange(new RemoveAxiom(o, ax)); ax.classExpressions().forEach(c -> collectClassExpressions(c, supers)); }); } supers.remove(cls); supers.forEach( sup -> addChange(new AddAxiom(targetOntology, df.getOWLSubClassOfAxiom(cls, sup)))); }
private void generateChanges() { Set<OWLClassExpression> supers = new HashSet<>(); for (OWLOntology o : ontologies) { o.equivalentClassesAxioms(cls).forEach(ax -> { addChange(new RemoveAxiom(o, ax)); ax.classExpressions().forEach(c -> collectClassExpressions(c, supers)); }); } supers.remove(cls); supers.forEach( sup -> addChange(new AddAxiom(targetOntology, df.getOWLSubClassOfAxiom(cls, sup)))); }
@Override public Integer recomputeMetric() { Set<OWLClass> processed = new HashSet<>(); Set<OWLClass> clses = new HashSet<>(); NamedConjunctChecker checker = new NamedConjunctChecker(); for (OWLOntology ont : asList(getOntologies())) { for (OWLClass cls : asList(ont.classesInSignature())) { if (processed.contains(cls)) { continue; } processed.add(cls); int count = 0; for (OWLClassExpression sup : asList( equivalent(ont.equivalentClassesAxioms(cls), OWLClassExpression.class))) { if (checker.hasNamedConjunct(sup)) { count++; } if (count > 1) { clses.add(cls); break; } } } } return Integer.valueOf(clses.size()); }
@Override public Integer recomputeMetric() { Set<OWLClass> processed = new HashSet<>(); Set<OWLClass> clses = new HashSet<>(); NamedConjunctChecker checker = new NamedConjunctChecker(); for (OWLOntology ont : asList(getOntologies())) { for (OWLClass cls : asList(ont.classesInSignature())) { if (processed.contains(cls)) { continue; } processed.add(cls); int count = 0; for (OWLClassExpression sup : asList( equivalent(ont.equivalentClassesAxioms(cls), OWLClassExpression.class))) { if (checker.hasNamedConjunct(sup)) { count++; } if (count > 1) { clses.add(cls); break; } } } } return Integer.valueOf(clses.size()); }
@Override public Integer recomputeMetric() { Set<OWLClass> processed = new HashSet<>(); Set<OWLClass> clses = new HashSet<>(); NamedConjunctChecker checker = new NamedConjunctChecker(); for (OWLOntology ont : asList(getOntologies())) { for (OWLClass cls : asList(ont.classesInSignature())) { if (processed.contains(cls)) { continue; } processed.add(cls); int count = 0; for (OWLClassExpression sup : asList( equivalent(ont.equivalentClassesAxioms(cls), OWLClassExpression.class))) { if (checker.hasNamedConjunct(sup)) { count++; } if (count > 1) { clses.add(cls); break; } } } } return Integer.valueOf(clses.size()); }