/** * @param axiom axiom to check * @return true iff an AXIOM is local wrt signature */ boolean local(OWLAxiom axiom) { axiom.accept(this); return isLocal; }
/** * Convert. * * @param axiom axiom to convert * @return converted class expression */ public OWLClassExpression convert(OWLAxiom axiom) { return checkNotNull(axiom, "axiom cannot be null").accept(converter); } }
/** * Returns the entities referenced in an axiom. * * @param axiom axiom whose signature is being computed * @return the entities referenced in the axiom */ private static Set<OWLEntity> getSignature(OWLAxiom axiom) { Set<OWLEntity> toReturn = new HashSet<>(); OWLEntityCollector collector = new OWLEntityCollector(toReturn); axiom.accept(collector); return toReturn; }
/** * @param axiom the axiom to visit * @return the subject */ public static OWLObject getSubject(OWLAxiom axiom) { return checkNotNull(axiom, "axiom cannot be null").accept(visitor); }
/** * Retrieve equivalent entities from an axiom, including individuals from sameAs axioms. * * @param axiom axiom * @param <C> type contained in the returned collection * @return equivalent entities */ public static <C extends OWLObject> Stream<C> equivalent(OWLAxiom axiom) { return axiom.accept(new EquivalentVisitor<C>(true)); }
/** * Retrieve equivalent entities from an axiom, including individuals from sameAs axioms. * * @param axiom axiom * @param type type returned * @param <C> type contained in the returned collection * @return equivalent entities */ public static <C extends OWLObject> Stream<C> equivalent(OWLAxiom axiom, @SuppressWarnings("unused") Class<C> type) { return axiom.accept(new EquivalentVisitor<C>(true)); }
/** * Retrieve the sub part of an axiom, i.e., subclass or subproperty. A mixture of axiom types * can be passed in, as long as the entity type they contain is compatible with the return type * for the collection. * * @param <C> returned type * @param axiom axiom * @return sub expressions */ public static <C extends OWLObject> C sub(OWLAxiom axiom) { return axiom.accept(new SupSubVisitor<C>(false)); }
/** * Retrieve the ranges from a range axiom. A mixture of axiom types can be passed in. * * @param <C> returned type * @param axiom axiom * @param type witness for returned type * @return sub expressions */ public static <C extends OWLObject> C range(OWLAxiom axiom, @SuppressWarnings("unused") Class<C> type) { return axiom.accept(new RangeVisitor<C>()); }
/** * Retrieve disjoint entities from an axiom, including individuals from differentFrom axioms. * * @param <C> returned type * @param axiom axiom * @return disjoint entities */ public static <C extends OWLObject> Stream<C> different(OWLAxiom axiom) { return axiom.accept(new EquivalentVisitor<C>(false)); }
/** * Retrieve disjoint entities from an axiom, including individuals from differentFrom axioms. * * @param <C> returned type * @param axiom axiom * @param type witness for returned type * @return disjoint entities */ public static <C extends OWLObject> Stream<C> different(OWLAxiom axiom, @SuppressWarnings("unused") Class<C> type) { return axiom.accept(new EquivalentVisitor<C>(false)); }
/** * Retrieve the super part of an axiom, i.e., superclass or superproperty. A mixture of axiom * types can be passed in, as long as the entity type they contain is compatible with the return * type for the collection. * * @param <C> returned type * @param axiom axiom * @return sub expressions */ public static <C extends OWLObject> C sup(OWLAxiom axiom) { return axiom.accept(new SupSubVisitor<C>(true)); }
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)); }
@Deprecated protected void handleChanges(List<? extends OWLOntologyChange> changes) { for (OWLOntologyChange change : changes) { if (change.isAxiomChange()) { change.getAxiom().accept(AbstractOWLFrameSection.this); } } }
public void visit(RemoveAxiom removeAxiom) { if (ontologies.contains(removeAxiom.getOntology())){ handleAxiomChange(removeAxiom); removeAxiom.getAxiom().accept(removeAxiomVisitor); } }
public void visit(AddAxiom addAxiom) { if (ontologies.contains(addAxiom.getOntology())){ handleAxiomChange(addAxiom); addAxiom.getAxiom().accept(addAxiomVisitor); } }
protected void writeEntity(LatexWriter w, LatexObjectVisitor renderer, OWLEntity cls, Collection<? extends OWLAxiom> axioms) { writeEntitySection(cls, w); for (OWLAxiom ax : axioms) { renderer.setSubject(cls); ax.accept(renderer); w.write("\n\n"); } }
@Override public void visit(OWLClassAssertionAxiom axiom) { OWLClassExpression sub = dataFactory.getOWLObjectOneOf(axiom.getIndividual()); OWLAxiom ax = dataFactory.getOWLSubClassOfAxiom(sub, axiom.getClassExpression()); ax.accept(this); }
private Collection<OWLClass> extractChildren(OWLClass parent) { childClassExtractor.setCurrentParentClass(parent); for (OWLOntology ont : ontologies) { for (OWLAxiom ax : ont.getReferencingAxioms(parent)) { if (ax.isLogicalAxiom()) { ax.accept(childClassExtractor); } } } return childClassExtractor.getResult(); }
private Set<OWLObjectProperty> getPropertiesFromSelection() { ClosureSourceIdentifier closureSourceIdentifier = new ClosureSourceIdentifier(); for (Object selVal : getFrameList().getSelectedValues()){ if (selVal instanceof OWLFrameSectionRow) { OWLAxiom ax = ((OWLFrameSectionRow) selVal).getAxiom(); ax.accept(closureSourceIdentifier); } } return closureSourceIdentifier.getPropertiesToClose(); }
@Override public void visit(OWLDataPropertyDomainAxiom axiom) { OWLClassExpression sub = dataFactory .getOWLDataSomeValuesFrom(axiom.getProperty(), dataFactory .getTopDatatype()); OWLAxiom ax = dataFactory.getOWLSubClassOfAxiom(sub, axiom.getDomain()); ax.accept(this); }