Search in sources :

Example 1 with PropertyValueDescriptor

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

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

the class PropertyValueDescriptorEditorImpl method getValue.

@Override
public Optional<PropertyValueDescriptor> getValue() {
    if (state == State.DERIVED) {
        return currentValue;
    } else {
        if (propertyField.getValue().isPresent() && valueField.getValue().isPresent()) {
            Set<OWLAxiom> augmentingAxioms = Sets.newHashSet();
            java.util.Optional<EntitySuggestion> selectedSuggestion = valueField.getSelectedSuggestion();
            if (selectedSuggestion.isPresent()) {
                if (selectedSuggestion.get() instanceof FreshEntitySuggestion) {
                    augmentingAxioms.addAll(((FreshEntitySuggestion) selectedSuggestion.get()).getAugmentingAxioms());
                }
            }
            return Optional.of(new PropertyValueDescriptor((OWLPropertyData) propertyField.getValue().get(), valueField.getValue().get(), state, false, augmentingAxioms));
        } else {
            return Optional.empty();
        }
    }
}
Also used : OWLPropertyData(edu.stanford.bmir.protege.web.shared.entity.OWLPropertyData) EntitySuggestion(edu.stanford.bmir.protege.web.client.library.suggest.EntitySuggestion) PropertyValueDescriptor(edu.stanford.bmir.protege.web.shared.frame.PropertyValueDescriptor) OWLAxiom(org.semanticweb.owlapi.model.OWLAxiom)

Example 3 with PropertyValueDescriptor

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

the class PropertyValueListEditor method fillUp.

private void fillUp(PropertyValueList propertyValueList) {
    List<PropertyValueDescriptor> vals = Lists.newArrayList();
    for (PropertyValue propertyValue : propertyValueList.getPropertyValues()) {
        // if (propertyValue.getState() == State.ASSERTED) {
        Optional<PropertyValueDescriptor> val = addRelationship(propertyValue);
        if (val.isPresent()) {
            vals.add(val.get());
        }
    // }
    }
    editor.setValue(vals);
}
Also used : PropertyValueDescriptor(edu.stanford.bmir.protege.web.shared.frame.PropertyValueDescriptor) PropertyValue(edu.stanford.bmir.protege.web.shared.frame.PropertyValue)

Aggregations

PropertyValueDescriptor (edu.stanford.bmir.protege.web.shared.frame.PropertyValueDescriptor)3 PropertyValue (edu.stanford.bmir.protege.web.shared.frame.PropertyValue)2 EntitySuggestion (edu.stanford.bmir.protege.web.client.library.suggest.EntitySuggestion)1 OWLPropertyData (edu.stanford.bmir.protege.web.shared.entity.OWLPropertyData)1 PropertyValueList (edu.stanford.bmir.protege.web.shared.frame.PropertyValueList)1 List (java.util.List)1 OWLAxiom (org.semanticweb.owlapi.model.OWLAxiom)1