}
@Override
public void visit(OWLDataSomeValuesFrom desc) {
if(desc.getFiller().isDatatype()) {
PropertyEntityData propertyEntityData = rm.getPropertyEntityData(desc.getProperty().asOWLDataProperty());
propertyEntityData.setMinCardinality(1);
result.add(new Triple(rm.getEntityData(cls), propertyEntityData, rm.getEntityData(desc.getFiller().asOWLDatatype())));
}
}
@Override
public void visit(OWLDataHasValue desc) {
PropertyEntityData propertyEntityData = rm.getPropertyEntityData(desc.getProperty().asOWLDataProperty());
propertyEntityData.setMinCardinality(1);
result.add(new Triple(rm.getEntityData(cls), propertyEntityData, rm.getEntityData(desc.getValue())));
}
@Override
public void visit(OWLObjectMinCardinality desc) {
processAsExistential(desc);
}
@Override
public void visit(OWLObjectExactCardinality desc) {
desc.asIntersectionOfMinMax().accept(this);
}
private OWLObjectProperty getSimpleNamedProperty(OWLRestriction<?, OWLObjectPropertyExpression, ?> ce) {
return ce.getProperty().getSimplified().asOWLObjectProperty();
}
private boolean isSimpleNamedPropertyRestriction(OWLRestriction<?, OWLObjectPropertyExpression, ?> ce) {
return !ce.getProperty().getSimplified().isAnonymous();
}
private void processAsExistential(OWLQuantifiedRestriction<OWLClassExpression, OWLObjectPropertyExpression, OWLClassExpression> ce) {
if (isSimpleNamedPropertyRestriction(ce)) {
for(OWLClassExpression filler : ce.getFiller().asConjunctSet()) {
OWLEntity entityFiller = filler.accept(new OWLClassExpressionVisitorExAdapter<OWLEntity>() {
@Override
public OWLEntity visit(OWLClass ce) {
return ce;
}
@Override
public OWLEntity visit(OWLObjectOneOf ce) {
Set<OWLIndividual> individuals = ce.getIndividuals();
if(individuals.size() == 1) {
OWLIndividual ind = individuals.iterator().next();
if(!ind.isAnonymous()) {
return ind.asOWLNamedIndividual();
}
}
return null;
}
});
if(entityFiller != null) {
OWLObjectProperty property = getSimpleNamedProperty(ce);
PropertyEntityData propertyEntityData = rm.getPropertyEntityData(property);
propertyEntityData.setMinCardinality(1);
result.add(new Triple(rm.getEntityData(cls), propertyEntityData, rm.getEntityData(entityFiller)));
}
}
}