Search in sources :

Example 1 with GetOntologyAnnotationsResult

use of edu.stanford.bmir.protege.web.shared.dispatch.actions.GetOntologyAnnotationsResult in project webprotege by protegeproject.

the class GetOntologyAnnotationsActionHandler method execute.

@Nonnull
@Override
public GetOntologyAnnotationsResult execute(@Nonnull GetOntologyAnnotationsAction action, @Nonnull ExecutionContext executionContext) {
    List<OWLAnnotation> result = new ArrayList<>(rootOntology.getAnnotations());
    ImmutableList.Builder<PropertyAnnotationValue> annotationValues = ImmutableList.builder();
    result.stream().map(annotation -> new PropertyAnnotationValue(renderingManager.getRendering(annotation.getProperty()), renderingManager.getRendering(annotation.getValue()), State.ASSERTED)).sorted(propertyValueComparator).forEach(annotationValues::add);
    return new GetOntologyAnnotationsResult(annotationValues.build());
}
Also used : GetOntologyAnnotationsResult(edu.stanford.bmir.protege.web.shared.dispatch.actions.GetOntologyAnnotationsResult) OWLAnnotation(org.semanticweb.owlapi.model.OWLAnnotation) ImmutableList(com.google.common.collect.ImmutableList) ArrayList(java.util.ArrayList) PropertyAnnotationValue(edu.stanford.bmir.protege.web.shared.frame.PropertyAnnotationValue) Nonnull(javax.annotation.Nonnull)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 GetOntologyAnnotationsResult (edu.stanford.bmir.protege.web.shared.dispatch.actions.GetOntologyAnnotationsResult)1 PropertyAnnotationValue (edu.stanford.bmir.protege.web.shared.frame.PropertyAnnotationValue)1 ArrayList (java.util.ArrayList)1 Nonnull (javax.annotation.Nonnull)1 OWLAnnotation (org.semanticweb.owlapi.model.OWLAnnotation)1