Search in sources :

Example 11 with OWLPrimitiveData

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));
}
Also used : OWLClassData(edu.stanford.bmir.protege.web.shared.entity.OWLClassData) OWLObjectPropertyData(edu.stanford.bmir.protege.web.shared.entity.OWLObjectPropertyData) OWLPrimitiveData(edu.stanford.bmir.protege.web.shared.entity.OWLPrimitiveData)

Example 12 with OWLPrimitiveData

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);
    }
}
Also used : OWLClassData(edu.stanford.bmir.protege.web.shared.entity.OWLClassData) OWLPrimitiveData(edu.stanford.bmir.protege.web.shared.entity.OWLPrimitiveData)

Aggregations

OWLPrimitiveData (edu.stanford.bmir.protege.web.shared.entity.OWLPrimitiveData)12 OWLClassData (edu.stanford.bmir.protege.web.shared.entity.OWLClassData)5 OWLLiteralData (edu.stanford.bmir.protege.web.shared.entity.OWLLiteralData)3 ColumnType (edu.stanford.bmir.protege.web.shared.csv.ColumnType)2 PropertyValueList (edu.stanford.bmir.protege.web.shared.frame.PropertyValueList)2 OWLEntity (org.semanticweb.owlapi.model.OWLEntity)2 UiHandler (com.google.gwt.uibinder.client.UiHandler)1 OWLAnnotationPropertyData (edu.stanford.bmir.protege.web.shared.entity.OWLAnnotationPropertyData)1 OWLDatatypeData (edu.stanford.bmir.protege.web.shared.entity.OWLDatatypeData)1 OWLEntityData (edu.stanford.bmir.protege.web.shared.entity.OWLEntityData)1 OWLNamedIndividualData (edu.stanford.bmir.protege.web.shared.entity.OWLNamedIndividualData)1 OWLObjectPropertyData (edu.stanford.bmir.protege.web.shared.entity.OWLObjectPropertyData)1 OWLPropertyData (edu.stanford.bmir.protege.web.shared.entity.OWLPropertyData)1 AnnotationPropertyFrame (edu.stanford.bmir.protege.web.shared.frame.AnnotationPropertyFrame)1 DataPropertyFrame (edu.stanford.bmir.protege.web.shared.frame.DataPropertyFrame)1 ArrayList (java.util.ArrayList)1 EntityType (org.semanticweb.owlapi.model.EntityType)1 OWLLiteral (org.semanticweb.owlapi.model.OWLLiteral)1