use of edu.stanford.bmir.protege.web.shared.entity.OWLNamedIndividualData in project webprotege by protegeproject.
the class IndividualsListPresenter method updateList.
private void updateList() {
GetIndividualsAction action = new GetIndividualsAction(projectId, currentType.orElse(DataFactory.getOWLThing()), view.getSearchString(), Optional.of(PageRequest.requestPageWithSize(view.getPageNumber(), PAGE_SIZE)));
dispatchServiceManager.execute(action, view, result -> {
view.setListData(result.getIndividuals());
view.setStatusMessageVisible(true);
int displayedIndividuals = result.getIndividuals().size();
int totalIndividuals = result.getTotalIndividuals();
Page<OWLNamedIndividualData> paginatedResult = result.getPaginatedResult();
view.setPageCount(paginatedResult.getPageCount());
view.setPageNumber(paginatedResult.getPageNumber());
updateStatusLabel(displayedIndividuals, totalIndividuals);
entityDisplay.setDisplayedEntity(Optional.of(result.getType()));
});
}
use of edu.stanford.bmir.protege.web.shared.entity.OWLNamedIndividualData in project webprotege by protegeproject.
the class IndividualsListPresenter method deleteSelectedIndividuals.
private void deleteSelectedIndividuals() {
Collection<OWLNamedIndividualData> selection = view.getSelectedIndividuals();
Set<OWLEntity> entities = view.getSelectedIndividuals().stream().map(OWLNamedIndividualData::getEntity).collect(toSet());
dispatchServiceManager.execute(new DeleteEntitiesAction(projectId, entities), view, result -> updateList());
}
use of edu.stanford.bmir.protege.web.shared.entity.OWLNamedIndividualData in project webprotege by protegeproject.
the class NamedIndividualFrameTranslator method translateToAxioms.
private Set<OWLAxiom> translateToAxioms(OWLNamedIndividual subject, NamedIndividualFrame frame, Mode mode) {
Set<OWLAxiom> result = new HashSet<>();
for (OWLClassData cls : frame.getClasses()) {
result.add(DataFactory.get().getOWLClassAssertionAxiom(cls.getEntity(), subject));
}
for (PropertyValue propertyValue : frame.getPropertyValues()) {
AxiomPropertyValueTranslator translator = new AxiomPropertyValueTranslator();
result.addAll(translator.getAxioms(subject, propertyValue, mode));
}
for (OWLNamedIndividualData individual : frame.getSameIndividuals()) {
result.add(DataFactory.get().getOWLSameIndividualAxiom(subject, individual.getEntity()));
}
return result;
}
use of edu.stanford.bmir.protege.web.shared.entity.OWLNamedIndividualData in project webprotege by protegeproject.
the class NamedIndividualFrameEditor method getValue.
@Override
public Optional<LabelledFrame<NamedIndividualFrame>> getValue() {
GWT.log("[NamedIndividualFrameEditor] Get value: Dirty: " + isDirty() + " Edited frame: " + editedFrame);
if (!editedFrame.isPresent()) {
return Optional.empty();
}
PropertyValueList propertyValueList = assertions.getValue().get();
Set<OWLClassData> rawTypes = getRawTypes();
Set<OWLNamedIndividualData> sameAs = getRawSameAs();
NamedIndividualFrame reference = new NamedIndividualFrame(editedFrame.get().getFrame().getSubject(), rawTypes, propertyValueList, sameAs);
return Optional.of(new LabelledFrame<>(editedFrame.get().getDisplayName(), reference));
}
use of edu.stanford.bmir.protege.web.shared.entity.OWLNamedIndividualData in project webprotege by protegeproject.
the class NamedIndividualFrameEditor method getRawSameAs.
private Set<OWLNamedIndividualData> getRawSameAs() {
Set<OWLNamedIndividualData> rawSameAs = new HashSet<>();
Optional<List<OWLPrimitiveData>> sameAsList = sameAs.getValue();
if (sameAsList.isPresent()) {
for (OWLPrimitiveData data : sameAsList.get()) {
rawSameAs.add((OWLNamedIndividualData) data);
}
}
return rawSameAs;
}
Aggregations