use of edu.stanford.bmir.protege.web.shared.entity.OWLPrimitiveData in project webprotege by protegeproject.
the class ObjectPropertyFrameEditor method getValue.
@Override
public Optional<LabelledFrame<ObjectPropertyFrame>> getValue() {
if (!previouslySetValue.isPresent()) {
return previouslySetValue;
}
Set<PropertyAnnotationValue> annotationValueSet = new HashSet<PropertyAnnotationValue>();
annotationValueSet.addAll(annotations.getValue().get().getAnnotationPropertyValues());
final ObjectPropertyFrame previousFrame = previouslySetValue.get().getFrame();
OWLObjectPropertyData subject = previousFrame.getSubject();
List<OWLClassData> editedDomains = Lists.newArrayList();
for (OWLPrimitiveData data : domains.getValue().get()) {
editedDomains.add((OWLClassData) data);
}
List<OWLClassData> editedRanges = Lists.newArrayList();
for (OWLPrimitiveData data : ranges.getValue().get()) {
editedRanges.add((OWLClassData) data);
}
ObjectPropertyFrame frame = new ObjectPropertyFrame(subject, annotationValueSet, new HashSet<>(editedDomains), new HashSet<>(editedRanges), Collections.emptySet(), characteristics);
return Optional.of(new LabelledFrame<>(previouslySetValue.get().getDisplayName(), frame));
}
use of edu.stanford.bmir.protege.web.shared.entity.OWLPrimitiveData in project webprotege by protegeproject.
the class ClassFrameEditor method getValue.
@Override
public Optional<LabelledFrame<ClassFrame>> getValue() {
if (currentSubject == null) {
return Optional.empty();
} else {
Set<OWLClassData> classesData = new HashSet<>();
for (OWLPrimitiveData cls : classes.getValue().get()) {
classesData.add((OWLClassData) cls);
}
Set<PropertyValue> propertyValues = new TreeSet<>();
propertyValues.addAll(annotations.getValue().get().getPropertyValues());
propertyValues.addAll(properties.getValue().get().getPropertyValues());
ClassFrame cf = new ClassFrame(currentSubject, classesData, propertyValues);
LabelledFrame<ClassFrame> labelledClassFrame = new LabelledFrame<>(lastClassFrame.getDisplayName(), cf);
return Optional.of(labelledClassFrame);
}
}
Aggregations