use of edu.stanford.bmir.protege.web.shared.frame.PropertyAnnotationValue in project webprotege by protegeproject.
the class AnnotationsViewImpl method setValue.
@Override
public void setValue(Set<PropertyAnnotationValue> object) {
List<PropertyAnnotationValue> values = new ArrayList<>();
for (PropertyAnnotationValue annotation : object) {
values.add(new PropertyAnnotationValue(annotation.getProperty(), annotation.getValue(), State.ASSERTED));
}
editor.setValue(new PropertyValueList(values));
}
use of edu.stanford.bmir.protege.web.shared.frame.PropertyAnnotationValue in project webprotege by protegeproject.
the class AnnotationPropertyFrameTranslator method getFrame.
@Override
public AnnotationPropertyFrame getFrame(OWLAnnotationPropertyData subject) {
Set<PropertyAnnotationValue> propertyValues = new HashSet<>();
Set<OWLEntityData> domains = new HashSet<>();
Set<OWLEntityData> ranges = new HashSet<>();
for (OWLOntology ont : rootOntology.getImportsClosure()) {
for (OWLAnnotationAssertionAxiom ax : ont.getAnnotationAssertionAxioms(subject.getEntity().getIRI())) {
if (!(ax.getValue() instanceof OWLAnonymousIndividual)) {
propertyValues.add(new PropertyAnnotationValue(renderingManager.getRendering(ax.getProperty()), renderingManager.getRendering(ax.getValue()), State.ASSERTED));
}
}
for (OWLAnnotationPropertyDomainAxiom ax : ont.getAnnotationPropertyDomainAxioms(subject.getEntity())) {
rootOntology.getEntitiesInSignature(ax.getDomain(), Imports.INCLUDED).stream().map(renderingManager::getRendering).forEach(domains::add);
}
for (OWLAnnotationPropertyRangeAxiom ax : ont.getAnnotationPropertyRangeAxioms(subject.getEntity())) {
rootOntology.getEntitiesInSignature(ax.getRange(), Imports.INCLUDED).stream().map(renderingManager::getRendering).forEach(ranges::add);
}
}
return new AnnotationPropertyFrame(renderingManager.getRendering(subject.getEntity()), propertyValues, domains, ranges);
}
use of edu.stanford.bmir.protege.web.shared.frame.PropertyAnnotationValue 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());
}
use of edu.stanford.bmir.protege.web.shared.frame.PropertyAnnotationValue in project webprotege by protegeproject.
the class AnnotationsViewImpl method getValue.
@Override
public Optional<Set<PropertyAnnotationValue>> getValue() {
Optional<PropertyValueList> valueList = editor.getValue();
if (!valueList.isPresent()) {
return Optional.empty();
}
Set<PropertyAnnotationValue> result = new HashSet<PropertyAnnotationValue>();
for (PropertyAnnotationValue value : valueList.get().getAnnotationPropertyValues()) {
result.add(value);
}
return Optional.of(result);
}
use of edu.stanford.bmir.protege.web.shared.frame.PropertyAnnotationValue in project webprotege by protegeproject.
the class OntologyAnnotationsPortletPresenter method updateView.
private void updateView() {
dispatchServiceManager.execute(new GetOntologyAnnotationsAction(getProjectId()), result -> {
LinkedHashSet<PropertyAnnotationValue> object = new LinkedHashSet<>(result.getAnnotations());
if (!lastSet.isPresent() || !annotationsView.getValue().equals(Optional.of(object))) {
lastSet = Optional.of(new ArrayList<>(object));
annotationsView.setValue(object);
}
});
}
Aggregations