Search in sources :

Example 1 with GetOboTermRelationshipsAction

use of edu.stanford.bmir.protege.web.shared.obo.GetOboTermRelationshipsAction in project webprotege by protegeproject.

the class OBOTermRelationshipPortletPresenter method displayEntity.

@Override
protected void displayEntity(OWLEntity entity) {
    Optional<OWLEntity> current = getSelectedEntity();
    if (!current.isPresent()) {
        editor.clearValue();
        pristineValue = Optional.empty();
        return;
    }
    if (!(current.get() instanceof OWLClass)) {
        editor.clearValue();
        pristineValue = Optional.empty();
        return;
    }
    dispatch.execute(new GetOboTermRelationshipsAction(getProjectId(), entity.asOWLClass()), this, result -> {
        List<OBORelationship> listOfRels = new ArrayList<>(result.getRelationships().getRelationships());
        pristineValue = Optional.of(listOfRels);
        editor.setValue(listOfRels);
    });
}
Also used : OBORelationship(edu.stanford.bmir.protege.web.shared.obo.OBORelationship) OWLEntity(org.semanticweb.owlapi.model.OWLEntity) ArrayList(java.util.ArrayList) GetOboTermRelationshipsAction(edu.stanford.bmir.protege.web.shared.obo.GetOboTermRelationshipsAction) OWLClass(org.semanticweb.owlapi.model.OWLClass)

Aggregations

GetOboTermRelationshipsAction (edu.stanford.bmir.protege.web.shared.obo.GetOboTermRelationshipsAction)1 OBORelationship (edu.stanford.bmir.protege.web.shared.obo.OBORelationship)1 ArrayList (java.util.ArrayList)1 OWLClass (org.semanticweb.owlapi.model.OWLClass)1 OWLEntity (org.semanticweb.owlapi.model.OWLEntity)1