Пример #1
0
 public Set<OWLDataProperty> getDataPropertiesByDomain(OWLClass domain) {
   Set<OWLDataProperty> propSet = new HashSet<OWLDataProperty>();
   Set<OWLDataProperty> objProps = _ontology.getDataPropertiesInSignature();
   for (OWLDataProperty prop : objProps) {
     for (OWLClass owlClass : _reasoner.getDataPropertyDomains(prop, true).getFlattened()) {
       if (owlClass.equals(domain)) {
         propSet.add(prop);
       }
     }
   }
   return propSet;
 }
Пример #2
0
  public boolean isDomainOfDataProperty(OWLClass clase, OWLDataProperty prop) {

    for (OWLClass owlClass1 : _reasoner.getDataPropertyDomains(prop, false).getFlattened()) {
      if (owlClass1.getIRI().equals(clase.getIRI())) {
        Log.d(
            TAG,
            "<idDomainOfDataProperty> "
                + clase.getIRI().getRemainder().get()
                + " dominio de "
                + prop.getIRI().getRemainder().get()
                + "? SI!");
        return true;
      }
    }
    Log.d(
        TAG,
        "<isDomainOfDataProperty> "
            + clase.getIRI().getRemainder().get()
            + " dominio de "
            + prop.getIRI().getRemainder().get()
            + "? NO");
    return false;
  }