Search in sources :

Example 6 with OWLClassData

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

Example 7 with OWLClassData

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));
}
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 8 with OWLClassData

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

Example 9 with OWLClassData

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

Example 10 with OWLClassData

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

Aggregations

OWLClassData (edu.stanford.bmir.protege.web.shared.entity.OWLClassData)20 HashSet (java.util.HashSet)6 OWLPrimitiveData (edu.stanford.bmir.protege.web.shared.entity.OWLPrimitiveData)5 OBORelationship (edu.stanford.bmir.protege.web.shared.obo.OBORelationship)5 Nonnull (javax.annotation.Nonnull)4 OWLDatatypeData (edu.stanford.bmir.protege.web.shared.entity.OWLDatatypeData)3 OWLNamedIndividualData (edu.stanford.bmir.protege.web.shared.entity.OWLNamedIndividualData)3 OWLObjectPropertyData (edu.stanford.bmir.protege.web.shared.entity.OWLObjectPropertyData)3 OBOTermRelationships (edu.stanford.bmir.protege.web.shared.obo.OBOTermRelationships)3 PropertyValue (edu.stanford.bmir.protege.web.shared.frame.PropertyValue)2 PropertyValueList (edu.stanford.bmir.protege.web.shared.frame.PropertyValueList)2 OBOTermCrossProduct (edu.stanford.bmir.protege.web.shared.obo.OBOTermCrossProduct)2 ProjectId (edu.stanford.bmir.protege.web.shared.project.ProjectId)2 OWLAxiom (org.semanticweb.owlapi.model.OWLAxiom)2 OWLOntology (org.semanticweb.owlapi.model.OWLOntology)2 AccessManager (edu.stanford.bmir.protege.web.server.access.AccessManager)1 AbstractProjectActionHandler (edu.stanford.bmir.protege.web.server.dispatch.AbstractProjectActionHandler)1 ExecutionContext (edu.stanford.bmir.protege.web.server.dispatch.ExecutionContext)1 RootOntology (edu.stanford.bmir.protege.web.server.inject.project.RootOntology)1 BROWSING (edu.stanford.bmir.protege.web.server.logging.Markers.BROWSING)1