/** * Checks if o contains axiom a, with or without imports closure. * * @param o ontology * @param a axiom * @param imports true if imports closure is included * @return true if a is contained */ public static boolean containsAxiom(OWLAxiom a, OWLOntology o, Imports imports) { return o.containsAxiom(a, imports, CONSIDER_AXIOM_ANNOTATIONS); }
@Override public boolean contains(OWLOntology o, OWLAxiom ax) { return o.containsAxiom(ax); } };
@Override @Deprecated public boolean containsAxiom(OWLAxiom owlAxiom, boolean b) { return withBooleanReadLock(() -> delegate.containsAxiom(owlAxiom, b)); }
@Override public boolean isEntailed(Set<? extends OWLAxiom> axioms) { for (OWLAxiom ax : axioms) { if (!getRootOntology() .containsAxiom(ax, INCLUDED, AxiomAnnotations.IGNORE_AXIOM_ANNOTATIONS)) { return false; } } return true; }
/** * Gets the ontologies that are managed by this manager that contain the specified axiom. * * @param axiom The axioms * @return The set of ontologies such that for each ontology, O the specified axiom is contained * in O. */ default Stream<OWLOntology> ontologies(OWLAxiom axiom) { return ontologies().filter(o -> o.containsAxiom(axiom)); }
/** * Checks if o contains axiom a, with or without imports closure, ignoring annotations. * * @param o ontology * @param a axiom * @param imports true if imports closure is included * @return true if a is contained */ public static boolean containsAxiomIgnoreAnnotations(OWLAxiom a, OWLOntology o, boolean imports) { return o.containsAxiom(a, fromBoolean(imports), IGNORE_AXIOM_ANNOTATIONS); }
/** * Gets the ontologies that are managed by this manager that contain the specified axiom. * * @param axiom The axioms * @return The set of ontologies such that for each ontology, O the specified axiom is contained * in O. */ default Stream<OWLOntology> ontologies(OWLAxiom axiom) { return ontologies().filter(o -> o.containsAxiom(axiom)); }
/** * Checks if o contains axiom a, with or without imports closure, ignoring annotations. * * @param o ontology * @param a axiom * @param imports true if imports closure is included * @return true if a is contained */ public static boolean containsAxiomIgnoreAnnotations(OWLAxiom a, OWLOntology o, boolean imports) { return o.containsAxiom(a, fromBoolean(imports), IGNORE_AXIOM_ANNOTATIONS); }
@Override public boolean isEntailed(OWLAxiom axiom) { return getRootOntology() .containsAxiom(axiom, INCLUDED, AxiomAnnotations.IGNORE_AXIOM_ANNOTATIONS); }
@Override public boolean isEntailed(Set<? extends OWLAxiom> axioms) { for (OWLAxiom ax : axioms) { if (!getRootOntology() .containsAxiom(ax, INCLUDED, AxiomAnnotations.IGNORE_AXIOM_ANNOTATIONS)) { return false; } } return true; }
@Override public boolean hasSuitableServerTransport(OWLIndividual i) { OWLAxiom rightType = factory.getOWLClassAssertionAxiom(RMI_TRANSPORT, i); boolean hasRightType = ontology.containsAxiom(rightType); return hasRightType; }
/** * @param rule the rule * @return written axioms */ public Collection<OWLAxiom> write(SWRLRule rule) { List<OWLAxiom> axioms = new ArrayList<>(1); if (o.containsAxiom(rule)) { writeSection(RULE, CollectionFactory.createSet(rule).iterator(), "", true); axioms.add(rule); } return axioms; }
/** * @param rule the rule * @return written axioms */ public Collection<OWLAxiom> write(SWRLRule rule) { List<OWLAxiom> axioms = new ArrayList<>(1); if (o.containsAxiom(rule)) { writeSection(RULE, CollectionFactory.createSet(rule).iterator(), "", true); axioms.add(rule); } return axioms; }
private boolean cameFromSourceOntology(OWLAxiom axiom, OWLOntology sourceOntology, OWLClass child, Set<OWLClassExpression> inferredParents) { if (sourceOntology.containsAxiom(axiom)) { return true; } else if (axiom instanceof OWLSubClassOfAxiom) { return ((OWLSubClassOfAxiom) axiom).getSubClass().equals(child) && inferredParents.contains(((OWLSubClassOfAxiom) axiom).getSuperClass()); } else { return false; } }
/* package */ static void checkEditedAxiom(OWLEditorKit editorKit, Set<OWLClassAxiom> editedObjects) { OWLClassAxiom axiom = editedObjects.iterator().next(); OWLOntology ontology = editorKit.getOWLModelManager().getActiveOntology(); if (ontology.containsAxiom(axiom) && !ontology.getGeneralClassAxioms().contains(axiom)) { JOptionPane.showMessageDialog(editorKit.getOWLWorkspace(), "Edited axiom is not a general class axiom. It has been added to\n"+ "the ontology but will not show in the General Class Axiom Window."); } }
public String getTooltip() { if (ontology.containsAxiom(axiom)) { return "Asserted in " + ontology.getOntologyID(); } else { return "Deleted. (Was asserted in " + ontology.getOntologyID() + ")"; } } }
private void searchForOrphanedAnnotations(EntityBasedDiff diff, OWLEntity sourceEntity, OWLEntity targetEntity) { Set<OWLAnnotationAssertionAxiom> orphans = new HashSet<OWLAnnotationAssertionAxiom>(); for (OWLAnnotationAssertionAxiom axiom : sourceOntology.getAnnotationAssertionAxioms(sourceEntity.getIRI())) { if (targetOntology.containsAxiom(axiom)) { orphans.add(axiom); } } for (OWLAnnotationAssertionAxiom orphan : orphans) { changes.addMatch(new MatchedAxiom(orphan, orphan, ORPHANED_ANNOTATION)); } }
@Override public boolean hasSuitableServerFilter(OWLIndividual i) { OWLDataFactory factory = configuration.getOWLOntologyManager().getOWLDataFactory(); return context != null && configuration.containsAxiom(factory.getOWLClassAssertionAxiom(OSGI_SHUTDOWN_FILTER, i)); }
protected void refill(OWLOntology ontology) { Set<OWLAxiom> axs = getRootObject(); for(OWLAxiom ax : axs) { if (ontology.containsAxiom(ax)) { addRow(new AxiomListFrameSectionRow(getOWLEditorKit(), this, ontology, getRootObject(), ax)); added.add(ax); } } }
private void addAsserted(List<OWLOntologyChange> changes) { for (OWLOntology o : getOWLModelManager().getReasoner().getRootOntology().getImportsClosure()) { for (OWLLogicalAxiom ax : o.getLogicalAxioms()) { if (ax.isAnnotated() && exportedOntology.containsAxiom(ax.getAxiomWithoutAnnotations())) { changes.add(new RemoveAxiom(exportedOntology, ax.getAxiomWithoutAnnotations())); } changes.add(new AddAxiom(exportedOntology, ax)); } } }