while (it.hasNext())
{
Restriction restriction = it.next();
if (restriction.canAs(AllValuesFromRestriction.class))
{
AllValuesFromRestriction avfr = restriction.asAllValuesFromRestriction();
if (avfr.getOnProperty().equals(property) && avfr.hasAllValuesFrom(ontClass))
{
ExtendedIterator<OntClass> classIt = avfr.listSubClasses(true);
try
{
if (classIt.hasNext())
{
OntClass matchingClass = classIt.next();