/** * <p>Answer the class or datarange to which all values of the restricted property belong.</p> * @return The ontology class of the restricted property values * @exception ProfileException If the {@link Profile#HAS_CLASS_Q()} property is not supported in the current language profile. */ @Override public OntResource getHasClassQ() { checkProfile( getProfile().HAS_CLASS_Q(), "HAS_CLASS_Q" ); Resource r = getProperty( getProfile().HAS_CLASS_Q() ).getResource(); if (r.canAs( OntClass.class )) { return r.as( OntClass.class ); } else if (r.canAs( DataRange.class )) { return r.as( DataRange.class ); } else { return r.as( OntResource.class ); } }
/** * <p>Answer the class or datarange to which all values of the restricted property belong.</p> * @return The ontology class of the restricted property values * @exception ProfileException If the {@link Profile#HAS_CLASS_Q()} property is not supported in the current language profile. */ @Override public OntResource getHasClassQ() { checkProfile( getProfile().HAS_CLASS_Q(), "HAS_CLASS_Q" ); Resource r = getProperty( getProfile().HAS_CLASS_Q() ).getResource(); if (r.canAs( OntClass.class )) { return r.as( OntClass.class ); } else if (r.canAs( DataRange.class )) { return r.as( DataRange.class ); } else { return r.as( OntResource.class ); } }