use of edu.stanford.bmir.protege.web.shared.entity.OWLObjectPropertyData in project webprotege by protegeproject.
the class TermRelationshipsManager method getRelationships.
public OBOTermRelationships getRelationships(OWLClass term) {
OWLClass cls = dataFactory.getOWLClass(term.getIRI());
Set<OWLSubClassOfAxiom> subClassOfAxioms = rootOntology.getSubClassAxiomsForSubClass(cls);
Set<OBORelationship> rels = new HashSet<>();
for (OWLSubClassOfAxiom ax : subClassOfAxioms) {
Set<OWLObjectSomeValuesFrom> relationships = new HashSet<>();
Set<OWLClassExpression> conjuncts = ax.getSuperClass().asConjunctSet();
for (OWLClassExpression conjunct : conjuncts) {
if (conjunct instanceof OWLObjectSomeValuesFrom) {
OWLObjectSomeValuesFrom svf = (OWLObjectSomeValuesFrom) conjunct;
if (!svf.getProperty().isAnonymous() && !svf.getFiller().isAnonymous()) {
relationships.add((OWLObjectSomeValuesFrom) conjunct);
}
}
}
if (relationships.size() == conjuncts.size()) {
for (OWLObjectSomeValuesFrom rel : relationships) {
OWLObjectPropertyData property = renderingManager.getRendering(rel.getProperty().asOWLObjectProperty());
OWLClassData filler = renderingManager.getRendering(rel.getFiller().asOWLClass());
OBORelationship oboRel = new OBORelationship(property, filler);
rels.add(oboRel);
}
}
}
return new OBOTermRelationships(rels);
}
use of edu.stanford.bmir.protege.web.shared.entity.OWLObjectPropertyData 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));
}
use of edu.stanford.bmir.protege.web.shared.entity.OWLObjectPropertyData in project webprotege by protegeproject.
the class RelationshipConverter method toOboRelationship.
@Nonnull
public OBORelationship toOboRelationship(@Nonnull OWLObjectSomeValuesFrom someValuesFrom) {
OWLObjectPropertyData property = renderingManager.getRendering(someValuesFrom.getProperty().asOWLObjectProperty());
OWLClassData filler = renderingManager.getRendering(someValuesFrom.getFiller().asOWLClass());
return new OBORelationship(property, filler);
}
Aggregations