Search in sources :

Example 1 with DataPropertyFrame

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

the class DataPropertyFrameEditor method setValue.

@Override
public void setValue(LabelledFrame<DataPropertyFrame> object) {
    dirty = false;
    lastDataPropertyFrame = Optional.of(object);
    final DataPropertyFrame frame = object.getFrame();
    String decodedIri = URL.decode(object.getFrame().getSubject().getEntity().getIRI().toString());
    iriField.setValue(decodedIri);
    annotations.setValue(frame.getPropertyValueList());
    domains.setValue(new ArrayList<>(frame.getDomains()));
    ranges.setValue(new ArrayList<>(frame.getRanges()));
    functionalCheckBox.setValue(frame.isFunctional());
    entityDisplay.setDisplayedEntity(java.util.Optional.of(object.getFrame().getSubject()));
}
Also used : DataPropertyFrame(edu.stanford.bmir.protege.web.shared.frame.DataPropertyFrame)

Example 2 with DataPropertyFrame

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

the class DataPropertyFrameEditor method getValue.

@Override
public Optional<LabelledFrame<DataPropertyFrame>> getValue() {
    if (!lastDataPropertyFrame.isPresent()) {
        return Optional.empty();
    }
    final Set<OWLClassData> domainsClasses = Sets.newHashSet();
    if (domains.getValue().isPresent()) {
        for (OWLPrimitiveData primitiveData : domains.getValue().get()) {
            domainsClasses.add(((OWLClassData) primitiveData));
        }
    }
    final Set<OWLDatatypeData> rangeTypes = Sets.newHashSet();
    if (ranges.getValue().isPresent()) {
        for (OWLPrimitiveData primitiveData : ranges.getValue().get()) {
            rangeTypes.add(((OWLDatatypeData) primitiveData));
        }
    }
    DataPropertyFrame frame = new DataPropertyFrame(lastDataPropertyFrame.get().getFrame().getSubject(), annotations.getValue().get(), domainsClasses, rangeTypes, functionalCheckBox.getValue());
    return Optional.of(new LabelledFrame<>(lastDataPropertyFrame.get().getDisplayName(), frame));
}
Also used : OWLClassData(edu.stanford.bmir.protege.web.shared.entity.OWLClassData) OWLDatatypeData(edu.stanford.bmir.protege.web.shared.entity.OWLDatatypeData) DataPropertyFrame(edu.stanford.bmir.protege.web.shared.frame.DataPropertyFrame) OWLPrimitiveData(edu.stanford.bmir.protege.web.shared.entity.OWLPrimitiveData)

Example 3 with DataPropertyFrame

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

the class GetDataPropertyFrameActionHandler method execute.

@Nonnull
@Override
public GetDataPropertyFrameResult execute(@Nonnull GetDataPropertyFrameAction action, @Nonnull ExecutionContext executionContext) {
    DataPropertyFrameTranslator translator = translatorProvider.get();
    final DataPropertyFrame frame = translator.getFrame(renderingManager.getRendering(action.getSubject()));
    String displayName = renderingManager.getBrowserText(action.getSubject());
    logger.info(BROWSING, "{} {} retrieved DataProperty frame for {} ({})", action.getProjectId(), executionContext.getUserId(), action.getSubject(), displayName);
    return new GetDataPropertyFrameResult(new LabelledFrame<>(displayName, frame));
}
Also used : DataPropertyFrame(edu.stanford.bmir.protege.web.shared.frame.DataPropertyFrame) GetDataPropertyFrameResult(edu.stanford.bmir.protege.web.shared.frame.GetDataPropertyFrameResult) Nonnull(javax.annotation.Nonnull)

Aggregations

DataPropertyFrame (edu.stanford.bmir.protege.web.shared.frame.DataPropertyFrame)3 OWLClassData (edu.stanford.bmir.protege.web.shared.entity.OWLClassData)1 OWLDatatypeData (edu.stanford.bmir.protege.web.shared.entity.OWLDatatypeData)1 OWLPrimitiveData (edu.stanford.bmir.protege.web.shared.entity.OWLPrimitiveData)1 GetDataPropertyFrameResult (edu.stanford.bmir.protege.web.shared.frame.GetDataPropertyFrameResult)1 Nonnull (javax.annotation.Nonnull)1