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()));
}
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));
}
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));
}
Aggregations