@Override protected void refillInferred() { getOWLModelManager().getReasonerPreferences().executeTask(OptionalInferenceTask.SHOW_INFERRED_SAMEAS_INDIVIDUAL_ASSERTIONS, () -> { if (!getOWLModelManager().getReasoner().isConsistent()) { return; } Set<OWLIndividual> existingSameIndividuals = getCurrentlyDisplayedSameIndividuals(); Set<OWLNamedIndividual> newSameIndividuals = new HashSet<>(); for (OWLNamedIndividual i : getCurrentReasoner().getSameIndividuals(getRootObject()).getEntities()) { if (!i.equals(getRootObject()) && !existingSameIndividuals.contains(i)) { newSameIndividuals.add(i); } } if (!newSameIndividuals.isEmpty()) { newSameIndividuals.add(getRootObject()); addRow(new OWLSameIndividualsAxiomFrameSectionRow(getOWLEditorKit(), OWLSameIndividualsAxiomFrameSection.this, null, getRootObject(), getOWLDataFactory().getOWLSameIndividualAxiom(newSameIndividuals) )); } }); }
public Set<OWLIndividual> getCurrentlyDisplayedSameIndividuals() { Set<OWLIndividual> existingSameIndividuals = new HashSet<>(); for (OWLFrameSectionRow<OWLNamedIndividual, OWLSameIndividualAxiom, Set<OWLNamedIndividual>> existingRow : getRows()) { OWLSameIndividualAxiom existingAxiom = existingRow.getAxiom(); for (OWLIndividual existingSameIndividual : existingAxiom.getIndividuals()) { existingSameIndividuals.add(existingSameIndividual); } } return existingSameIndividuals; }
/** * Refills the section with rows. This method will be called * by the system and should be directly called. */ protected void refill(OWLOntology ontology) { for (OWLSameIndividualAxiom ax : ontology.getSameIndividualAxioms(getRootObject())) { addRow(new OWLSameIndividualsAxiomFrameSectionRow(getOWLEditorKit(), this, ontology, getRootObject(), ax)); } }
protected OWLSameIndividualAxiom createAxiom(Set<OWLNamedIndividual> object) { object.add(getRootObject()); OWLSameIndividualAxiom ax = getOWLDataFactory().getOWLSameIndividualAxiom(object); return ax; }
public void visit(OWLSameIndividualAxiom axiom) { if (axiom.getIndividuals().contains(getRootObject())) { reset(); } }
owlIndividualSections.add(new OWLDataPropertyAssertionAxiomFrameSection(editorKit, this)); owlIndividualSections.add(new OWLNegativeDataPropertyAssertionFrameSection(editorKit, this)); owlIndividualSections.add(new OWLSameIndividualsAxiomFrameSection(editorKit, this)); owlIndividualSections.add(new OWLDifferentIndividualsAxiomFrameSection(editorKit, this));
@Override public boolean checkEditorResults(OWLObjectEditor<Set<OWLNamedIndividual>> editor) { Set<OWLNamedIndividual> equivalents = editor.getEditedObject(); return !equivalents.contains(getRootObject()); }
public OWLObjectEditor<Set<OWLNamedIndividual>> getObjectEditor() { return new OWLIndividualSetEditor(getOWLEditorKit()); }
@Override protected void refillInferred() { getOWLModelManager().getReasonerPreferences().executeTask(OptionalInferenceTask.SHOW_INFERRED_SAMEAS_INDIVIDUAL_ASSERTIONS, new Runnable() { public void run() { if (!getOWLModelManager().getReasoner().isConsistent()) { return; } Set<OWLIndividual> existingSameIndividuals = getCurrentlyDisplayedSameIndividuals(); Set<OWLNamedIndividual> newSameIndividuals = new HashSet<OWLNamedIndividual>(); for (OWLNamedIndividual i : getCurrentReasoner().getSameIndividuals(getRootObject()).getEntities()) { if (!i.equals(getRootObject()) && !existingSameIndividuals.contains(i)) { newSameIndividuals.add(i); } } if (!newSameIndividuals.isEmpty()) { newSameIndividuals.add(getRootObject()); addRow(new OWLSameIndividualsAxiomFrameSectionRow(getOWLEditorKit(), OWLSameIndividualsAxiomFrameSection.this, null, getRootObject(), getOWLDataFactory().getOWLSameIndividualAxiom(newSameIndividuals) )); } } }); }
public void run() { if (!getOWLModelManager().getReasoner().isConsistent()) { return; } Set<OWLIndividual> existingSameIndividuals = getCurrentlyDisplayedSameIndividuals(); Set<OWLNamedIndividual> newSameIndividuals = new HashSet<OWLNamedIndividual>(); for (OWLNamedIndividual i : getCurrentReasoner().getSameIndividuals(getRootObject()).getEntities()) { if (!i.equals(getRootObject()) && !existingSameIndividuals.contains(i)) { newSameIndividuals.add(i); } } if (!newSameIndividuals.isEmpty()) { newSameIndividuals.add(getRootObject()); addRow(new OWLSameIndividualsAxiomFrameSectionRow(getOWLEditorKit(), OWLSameIndividualsAxiomFrameSection.this, null, getRootObject(), getOWLDataFactory().getOWLSameIndividualAxiom(newSameIndividuals) )); } } });
/** * Refills the section with rows. This method will be called * by the system and should be directly called. */ protected void refill(OWLOntology ontology) { for (OWLSameIndividualAxiom ax : ontology.getSameIndividualAxioms(getRootObject())) { addRow(new OWLSameIndividualsAxiomFrameSectionRow(getOWLEditorKit(), this, ontology, getRootObject(), ax)); } }
protected OWLSameIndividualAxiom createAxiom(Set<OWLNamedIndividual> object) { object.add(getRootObject()); OWLSameIndividualAxiom ax = getOWLDataFactory().getOWLSameIndividualAxiom(object); return ax; }
owlIndividualSections.add(new OWLDataPropertyAssertionAxiomFrameSection(editorKit, this)); owlIndividualSections.add(new OWLNegativeDataPropertyAssertionFrameSection(editorKit, this)); owlIndividualSections.add(new OWLSameIndividualsAxiomFrameSection(editorKit, this)); owlIndividualSections.add(new OWLDifferentIndividualsAxiomFrameSection(editorKit, this));
@Override public boolean checkEditorResults(OWLObjectEditor<Set<OWLNamedIndividual>> editor) { Set<OWLNamedIndividual> equivalents = editor.getEditedObject(); return !equivalents.contains(getRootObject()); }
public OWLObjectEditor<Set<OWLNamedIndividual>> getObjectEditor() { return new OWLIndividualSetEditor(getOWLEditorKit()); }
@Override protected void refillInferred() { getOWLModelManager().getReasonerPreferences().executeTask(OptionalInferenceTask.SHOW_INFERRED_SAMEAS_INDIVIDUAL_ASSERTIONS, new Runnable() { public void run() { if (!getOWLModelManager().getReasoner().isConsistent()) { return; } Set<OWLIndividual> existingSameIndividuals = getCurrentlyDisplayedSameIndividuals(); Set<OWLNamedIndividual> newSameIndividuals = new HashSet<OWLNamedIndividual>(); for (OWLNamedIndividual i : getCurrentReasoner().getSameIndividuals(getRootObject()).getEntities()) { if (!i.equals(getRootObject()) && !existingSameIndividuals.contains(i)) { newSameIndividuals.add(i); } } if (!newSameIndividuals.isEmpty()) { newSameIndividuals.add(getRootObject()); addRow(new OWLSameIndividualsAxiomFrameSectionRow(getOWLEditorKit(), OWLSameIndividualsAxiomFrameSection.this, null, getRootObject(), getOWLDataFactory().getOWLSameIndividualAxiom(newSameIndividuals) )); } } }); }
public void run() { if (!getOWLModelManager().getReasoner().isConsistent()) { return; } Set<OWLIndividual> existingSameIndividuals = getCurrentlyDisplayedSameIndividuals(); Set<OWLNamedIndividual> newSameIndividuals = new HashSet<OWLNamedIndividual>(); for (OWLNamedIndividual i : getCurrentReasoner().getSameIndividuals(getRootObject()).getEntities()) { if (!i.equals(getRootObject()) && !existingSameIndividuals.contains(i)) { newSameIndividuals.add(i); } } if (!newSameIndividuals.isEmpty()) { newSameIndividuals.add(getRootObject()); addRow(new OWLSameIndividualsAxiomFrameSectionRow(getOWLEditorKit(), OWLSameIndividualsAxiomFrameSection.this, null, getRootObject(), getOWLDataFactory().getOWLSameIndividualAxiom(newSameIndividuals) )); } } });
/** * Refills the section with rows. This method will be called * by the system and should be directly called. */ protected void refill(OWLOntology ontology) { for (OWLSameIndividualAxiom ax : ontology.getSameIndividualAxioms(getRootObject())) { addRow(new OWLSameIndividualsAxiomFrameSectionRow(getOWLEditorKit(), this, ontology, getRootObject(), ax)); } }
protected OWLSameIndividualAxiom createAxiom(Set<OWLNamedIndividual> object) { object.add(getRootObject()); OWLSameIndividualAxiom ax = getOWLDataFactory().getOWLSameIndividualAxiom(object); return ax; }
owlIndividualSections.add(new OWLDataPropertyAssertionAxiomFrameSection(editorKit, this)); owlIndividualSections.add(new OWLNegativeDataPropertyAssertionFrameSection(editorKit, this)); owlIndividualSections.add(new OWLSameIndividualsAxiomFrameSection(editorKit, this)); owlIndividualSections.add(new OWLDifferentIndividualsAxiomFrameSection(editorKit, this));