use of org.semanticweb.owlapi.model.OWLDataPropertyRangeAxiom in project webprotege by protegeproject.
the class DataPropertyFrameTranslator method getFrame.
@Override
public DataPropertyFrame getFrame(OWLDataPropertyData subject) {
Set<OWLAxiom> propertyValueAxioms = new HashSet<>();
Set<OWLClassData> domains = new HashSet<>();
Set<OWLDatatypeData> ranges = new HashSet<>();
boolean functional = false;
for (OWLOntology ontology : rootOntology.getImportsClosure()) {
propertyValueAxioms.addAll(ontology.getAnnotationAssertionAxioms(subject.getEntity().getIRI()));
for (OWLDataPropertyDomainAxiom ax : ontology.getDataPropertyDomainAxioms(subject.getEntity())) {
if (!ax.getDomain().isAnonymous()) {
domains.add(renderingManager.getRendering(ax.getDomain().asOWLClass()));
}
}
for (OWLDataPropertyRangeAxiom ax : ontology.getDataPropertyRangeAxioms(subject.getEntity())) {
if (ax.getRange().isDatatype()) {
ranges.add(renderingManager.getRendering(ax.getRange().asOWLDatatype()));
}
}
if (EntitySearcher.isFunctional(subject.getEntity(), ontology)) {
functional = true;
}
}
Set<PropertyValue> propertyValues = new HashSet<>();
AxiomPropertyValueTranslator translator = new AxiomPropertyValueTranslator();
for (OWLAxiom ax : propertyValueAxioms) {
propertyValues.addAll(translator.getPropertyValues(subject.getEntity(), ax, rootOntology, State.ASSERTED, renderingManager));
}
PropertyValueList pvl = new PropertyValueList(propertyValues);
return new DataPropertyFrame(subject, pvl, domains, ranges, functional);
}
Aggregations