OWLLiteral l = e.getValue();
OWLDatatype type = l.getDatatype();
checkInconsistentProperty(dp, type);
NamedFeature f = new NamedFeature(dp.toStringID());
Literal lit = getLiteral(l);
if(lit != null) {
push(new Datatype(f, Operator.EQUALS,lit));
} else {
problems.add("Axiom " + e + " will be ignored because of the unsupported literal.");
}
}
public void visit(OWLDataAllValuesFrom e) {
unimplemented(e);
}
public void visit(OWLDataSomeValuesFrom e) {
OWLDataProperty dp = e.getProperty().asOWLDataProperty();
OWLDataRange range = e.getFiller();
/*
* An OWLDataRange can be one of the following:
* Datatype | DataIntersectionOf | DataUnionOf |
* DataComplementOf | DataOneOf | DatatypeRestriction
*
* We initially support only DataOneOf.
*/
if(range instanceof OWLDataOneOf) {
OWLDataOneOf doo = (OWLDataOneOf)range;
Set<OWLLiteral> values = doo.getValues();
if(values.size() != 1) {
problems.add("Expected only a single literal in "+e);
return;
}
OWLLiteral l = (OWLLiteral)values.toArray()[0];
OWLDatatype type = l.getDatatype();
checkInconsistentProperty(dp, type);
NamedFeature f = new NamedFeature(dp.toStringID());
Literal lit = getLiteral(l);
if(lit != null) {
push(new Datatype(f, Operator.EQUALS, lit));
} else {
problems.add("Axiom " + e + " will be ignored because of the unsupported literal.");
}
} else if(range instanceof OWLDatatypeRestriction) {
NamedFeature f = new NamedFeature(dp.toStringID());
OWLDatatypeRestriction dtr = (OWLDatatypeRestriction)range;
Set<OWLFacetRestriction> frs = dtr.getFacetRestrictions();
List<Datatype> conjuncts = new ArrayList<Datatype>();