use of edu.stanford.bmir.protege.web.shared.entity.OWLClassData in project webprotege by protegeproject.
the class ClassNameFieldEditor method getValue.
@Override
public Optional<FormDataValue> getValue() {
Optional<OWLPrimitiveData> value = editor.getValue();
if (!value.isPresent()) {
return Optional.empty();
}
OWLPrimitiveData theValue = value.get();
if (!(theValue instanceof OWLClassData)) {
return Optional.empty();
}
return Optional.of(FormDataPrimitive.get(((OWLClassData) theValue).getEntity()));
}
use of edu.stanford.bmir.protege.web.shared.entity.OWLClassData 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.entity.OWLClassData in project webprotege by protegeproject.
the class ClassFrameTranslator method translateToAxioms.
private Set<OWLAxiom> translateToAxioms(OWLClassData subject, ClassFrame classFrame, Mode mode) {
Set<OWLAxiom> result = new HashSet<>();
for (OWLClassData cls : classFrame.getClassEntries()) {
result.add(DataFactory.get().getOWLSubClassOfAxiom(subject.getEntity(), cls.getEntity()));
}
for (PropertyValue propertyValue : classFrame.getPropertyValues()) {
AxiomPropertyValueTranslator translator = new AxiomPropertyValueTranslator();
result.addAll(translator.getAxioms(subject.getEntity(), propertyValue, mode));
}
return result;
}
use of edu.stanford.bmir.protege.web.shared.entity.OWLClassData in project webprotege by protegeproject.
the class ClassFrame method getSignature.
public Set<OWLEntity> getSignature() {
Set<OWLEntity> result = new HashSet<>();
result.add(subject.getEntity());
for (OWLClassData entry : classEntries) {
result.add(entry.getEntity());
}
for (PropertyValue propertyValue : propertyValues) {
result.addAll(propertyValue.getProperty().getSignature());
result.addAll(propertyValue.getValue().getSignature());
}
return result;
}
use of edu.stanford.bmir.protege.web.shared.entity.OWLClassData in project webprotege by protegeproject.
the class OBOTermCrossProductEditorImpl method getValue.
@Override
public java.util.Optional<OBOTermCrossProduct> getValue() {
if (!genusField.getValue().isPresent()) {
return java.util.Optional.empty();
}
if (!relationshipsField.getValue().isPresent()) {
return java.util.Optional.empty();
}
final OWLClassData genus = (OWLClassData) genusField.getValue().get();
final OBOTermRelationships relationships = new OBOTermRelationships(new HashSet<OBORelationship>(relationshipsField.getValue().get()));
return java.util.Optional.of(new OBOTermCrossProduct(Optional.of(genus), relationships));
}
Aggregations