directRangesUris = new HashSet<String>();
indirectRangesUris = new HashSet<String>();
allRanges = new HashSet<OntResource>();
allRangesUris = new HashSet<String>();
OntProperty property = this.ontHandler.getOntModel().getOntProperty(propertyUri);
if (property == null || !property.isURIResource())
continue;
// direct domain
ExtendedIterator<? extends OntResource> itrDomains = property.listDomain();
while (itrDomains.hasNext()) {
d = itrDomains.next();
ontHandler.getMembers(d, directDomains, false);
}
directDomainsUris = ontHandler.getResourcesUris(directDomains);
temp = propertyDirectDomains.get(property.getURI());
if (temp == null)
propertyDirectDomains.put(property.getURI(), directDomainsUris);
else
temp.addAll(directDomainsUris);
for (OntResource domain : directDomains) {
temp = directOutDataProperties.get(domain.getURI());
if (temp == null) {
temp = new HashSet<String>();
directOutDataProperties.put(domain.getURI(), temp);
}
temp.add(property.getURI());
}
// all domains
if (directDomainsUris.contains(Uris.THING_URI))
allDomainsUris = new HashSet<String>(this.classes.keySet());
else {
for (OntResource domain : directDomains) {
allDomains.add(domain);
ontHandler.getChildren(domain, allDomains, true);
}
allDomainsUris = ontHandler.getResourcesUris(allDomains);
}
// indirect domains
for (String domainUri : allDomainsUris) {
if (!directDomainsUris.contains(domainUri))
indirectDomainsUris.add(domainUri);
}
temp = propertyIndirectDomains.get(property.getURI());
if (temp == null)
propertyIndirectDomains.put(property.getURI(), indirectDomainsUris);
else
temp.addAll(indirectDomainsUris);
for (String domainUri : indirectDomainsUris) {
temp = indirectOutDataProperties.get(domainUri);
if (temp == null) {
temp = new HashSet<String>();
indirectOutDataProperties.put(domainUri, temp);
}
temp.add(property.getURI());
}
// direct ranges
ExtendedIterator<? extends OntResource> itrRanges = property.listRange();
while (itrRanges.hasNext()) {
r = itrRanges.next();
ontHandler.getMembers(r, directRanges, false);
}
directRangesUris = ontHandler.getResourcesUris(directRanges);
temp = propertyDirectRanges.get(property.getURI());
if (temp == null)
propertyDirectRanges.put(property.getURI(), directRangesUris);
else
temp.addAll(directRangesUris);
// all ranges
for (OntResource range : directRanges) {
allRanges.add(range);
ontHandler.getChildren(range, allRanges, true);
}
allRangesUris = ontHandler.getResourcesUris(allRanges);
// indirect ranges
for (String rangeUri : allRangesUris) {
if (!directRangesUris.contains(rangeUri))
indirectRangesUris.add(rangeUri);
}
temp = propertyIndirectRanges.get(property.getURI());
if (temp == null)
propertyIndirectRanges.put(property.getURI(), indirectRangesUris);
else
temp.addAll(indirectRangesUris);
}
}