Search in sources :

Example 1 with OWLNamedIndividualData

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()));
    });
}
Also used : OWLNamedIndividualData(edu.stanford.bmir.protege.web.shared.entity.OWLNamedIndividualData) GetIndividualsAction(edu.stanford.bmir.protege.web.shared.individualslist.GetIndividualsAction)

Example 2 with OWLNamedIndividualData

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());
}
Also used : OWLEntity(org.semanticweb.owlapi.model.OWLEntity) OWLNamedIndividualData(edu.stanford.bmir.protege.web.shared.entity.OWLNamedIndividualData) DeleteEntitiesAction(edu.stanford.bmir.protege.web.shared.entity.DeleteEntitiesAction)

Example 3 with OWLNamedIndividualData

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;
}
Also used : OWLClassData(edu.stanford.bmir.protege.web.shared.entity.OWLClassData) PropertyValue(edu.stanford.bmir.protege.web.shared.frame.PropertyValue) OWLNamedIndividualData(edu.stanford.bmir.protege.web.shared.entity.OWLNamedIndividualData) HashSet(java.util.HashSet)

Example 4 with OWLNamedIndividualData

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));
}
Also used : OWLClassData(edu.stanford.bmir.protege.web.shared.entity.OWLClassData) NamedIndividualFrame(edu.stanford.bmir.protege.web.shared.frame.NamedIndividualFrame) OWLNamedIndividualData(edu.stanford.bmir.protege.web.shared.entity.OWLNamedIndividualData) PropertyValueList(edu.stanford.bmir.protege.web.shared.frame.PropertyValueList)

Example 5 with OWLNamedIndividualData

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;
}
Also used : OWLNamedIndividualData(edu.stanford.bmir.protege.web.shared.entity.OWLNamedIndividualData) PropertyValueList(edu.stanford.bmir.protege.web.shared.frame.PropertyValueList) OWLPrimitiveData(edu.stanford.bmir.protege.web.shared.entity.OWLPrimitiveData)

Aggregations

OWLNamedIndividualData (edu.stanford.bmir.protege.web.shared.entity.OWLNamedIndividualData)7 OWLClassData (edu.stanford.bmir.protege.web.shared.entity.OWLClassData)3 PropertyValueList (edu.stanford.bmir.protege.web.shared.frame.PropertyValueList)2 GetIndividualsAction (edu.stanford.bmir.protege.web.shared.individualslist.GetIndividualsAction)2 AccessManager (edu.stanford.bmir.protege.web.server.access.AccessManager)1 AbstractProjectActionHandler (edu.stanford.bmir.protege.web.server.dispatch.AbstractProjectActionHandler)1 ExecutionContext (edu.stanford.bmir.protege.web.server.dispatch.ExecutionContext)1 RootOntology (edu.stanford.bmir.protege.web.server.inject.project.RootOntology)1 BROWSING (edu.stanford.bmir.protege.web.server.logging.Markers.BROWSING)1 Pager (edu.stanford.bmir.protege.web.server.pagination.Pager)1 RenderingManager (edu.stanford.bmir.protege.web.server.renderer.RenderingManager)1 BuiltInAction (edu.stanford.bmir.protege.web.shared.access.BuiltInAction)1 VIEW_PROJECT (edu.stanford.bmir.protege.web.shared.access.BuiltInAction.VIEW_PROJECT)1 CreateNamedIndividualsAction (edu.stanford.bmir.protege.web.shared.dispatch.actions.CreateNamedIndividualsAction)1 DeleteEntitiesAction (edu.stanford.bmir.protege.web.shared.entity.DeleteEntitiesAction)1 OWLPrimitiveData (edu.stanford.bmir.protege.web.shared.entity.OWLPrimitiveData)1 NamedIndividualFrame (edu.stanford.bmir.protege.web.shared.frame.NamedIndividualFrame)1 PropertyValue (edu.stanford.bmir.protege.web.shared.frame.PropertyValue)1 GetIndividualsResult (edu.stanford.bmir.protege.web.shared.individualslist.GetIndividualsResult)1 Page (edu.stanford.bmir.protege.web.shared.pagination.Page)1