Search in sources :

Example 1 with PropertyValueList

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

Example 2 with PropertyValueList

use of edu.stanford.bmir.protege.web.shared.frame.PropertyValueList 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 3 with PropertyValueList

use of edu.stanford.bmir.protege.web.shared.frame.PropertyValueList in project webprotege by protegeproject.

the class PropertyValueListEditor method getValue.

@Override
public Optional<PropertyValueList> getValue() {
    Optional<List<PropertyValueDescriptor>> value = editor.getValue();
    if (!value.isPresent()) {
        return Optional.empty();
    }
    List<PropertyValue> propertyValues = Lists.newArrayList();
    for (PropertyValueDescriptor val : value.get()) {
        java.util.Optional<PropertyValue> propertyValue = val.toPropertyValue();
        if (propertyValue.isPresent()) {
            propertyValues.add(propertyValue.get());
        }
    }
    return Optional.of(new PropertyValueList(propertyValues));
}
Also used : PropertyValueDescriptor(edu.stanford.bmir.protege.web.shared.frame.PropertyValueDescriptor) PropertyValue(edu.stanford.bmir.protege.web.shared.frame.PropertyValue) List(java.util.List) PropertyValueList(edu.stanford.bmir.protege.web.shared.frame.PropertyValueList) PropertyValueList(edu.stanford.bmir.protege.web.shared.frame.PropertyValueList)

Example 4 with PropertyValueList

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

Aggregations

PropertyValueList (edu.stanford.bmir.protege.web.shared.frame.PropertyValueList)4 PropertyAnnotationValue (edu.stanford.bmir.protege.web.shared.frame.PropertyAnnotationValue)2 OWLClassData (edu.stanford.bmir.protege.web.shared.entity.OWLClassData)1 OWLNamedIndividualData (edu.stanford.bmir.protege.web.shared.entity.OWLNamedIndividualData)1 NamedIndividualFrame (edu.stanford.bmir.protege.web.shared.frame.NamedIndividualFrame)1 PropertyValue (edu.stanford.bmir.protege.web.shared.frame.PropertyValue)1 PropertyValueDescriptor (edu.stanford.bmir.protege.web.shared.frame.PropertyValueDescriptor)1 List (java.util.List)1