private MetadataProperty createMetadataProperty(KBObject property) { if (property == null) return null; int proptype = this.kb.isDatatypeProperty(property) ? MetadataProperty.DATATYPE : MetadataProperty.OBJECT; MetadataProperty prop = new MetadataProperty(property.getID(), proptype); // Query for domain and range from the non-inference ontkb model (otherwise we get inferenced // domains as well) ArrayList<KBObject> domains = this.ontkb.getPropertyDomainsDisjunctive(property); KBObject range = this.ontkb.getPropertyRange(property); for (KBObject domain : domains) prop.addDomain(domain.getID()); if (range != null) { prop.setRange(range.getID()); } return prop; }