public static boolean exactlyOneProperty(Resource r, Property p)
{
StmtIterator sIter = r.listProperties(p) ;
try {
if ( ! sIter.hasNext() )
throw new PropertyRequiredException(r, p) ;
sIter.next() ;
if ( sIter.hasNext() )
throw new NotUniqueException(r, p) ;
} finally { sIter.close() ; }
return true ;