public Object visit(OWLDatatype node) {
   if (!allowedDatatypes.contains(node.getIRI())) {
     profileViolations.add(
         new UseOfIllegalDataRange(getCurrentOntology(), getCurrentAxiom(), node));
   }
   return null;
 }
 protected PropertyType getPropertyType(OWLOntology o, OWLDataProperty dataTypeProperty) {
   Set<OWLDataRange> ranges = dataTypeProperty.getRanges(o);
   if (ranges.size() == 0) {
     return null;
   }
   if (ranges.size() > 1) {
     throw new LumifyException(
         "Unexpected number of ranges on data property " + dataTypeProperty.getIRI().toString());
   }
   for (OWLDataRange range : ranges) {
     if (range instanceof OWLDatatype) {
       OWLDatatype datatype = (OWLDatatype) range;
       return getPropertyType(datatype.getIRI().toString());
     }
   }
   throw new LumifyException(
       "Could not find range on data property " + dataTypeProperty.getIRI().toString());
 }
Example #3
0
 public boolean equals(Object obj) {
   if (super.equals(obj)) {
     if (!(obj instanceof OWLLiteral)) {
       return false;
     }
     OWLLiteral other = (OWLLiteral) obj;
     return literal.equals(other.getLiteral())
         && datatype.equals(other.getDatatype())
         && lang.equals(other.getLang());
   }
   return false;
 }
Example #4
0
 @Override
 protected int compareObjectOfSameType(OWLObject object) {
   OWLLiteral other = (OWLLiteral) object;
   int diff = literal.compareTo(other.getLiteral());
   if (diff != 0) {
     return diff;
   }
   diff = datatype.compareTo(other.getDatatype());
   if (diff != 0) {
     return diff;
   }
   return lang.compareTo(other.getLang());
 }
Example #5
0
 public boolean isBoolean() {
   return datatype.equals(getOWLDataFactory().getBooleanOWLDatatype());
 }
Example #6
0
 public boolean isInteger() {
   return datatype.equals(getOWLDataFactory().getIntegerOWLDatatype());
 }
Example #7
0
 public boolean isRDFPlainLiteral() {
   return datatype.equals(getOWLDataFactory().getRDFPlainLiteral());
 }
Example #8
0
 public boolean isFloat() {
   return datatype.equals(getOWLDataFactory().getFloatOWLDatatype());
 }
Example #9
0
 public boolean isDouble() {
   return datatype.equals(getOWLDataFactory().getDoubleOWLDatatype());
 }
 @Override
 public void visit(OWLDatatype node) {
   write("Datatype");
   write(node.getIRI());
 }