/** * <p>Answer true if this class is an enumerated class expression</p> * @return True if this is an enumerated class expression */ @Override public boolean isEnumeratedClass() { checkProfile( getProfile().ONE_OF(), "ONE_OF" ); return hasProperty( getProfile().ONE_OF() ); }
/** * <p>Answer true if this class is a union class expression</p> * @return True if this is a union class expression */ @Override public boolean isUnionClass() { checkProfile( getProfile().UNION_OF(), "UNION_OF" ); return hasProperty( getProfile().UNION_OF() ); }
/** * <p>Answer true if this class is a union class expression</p> * @return True if this is a union class expression */ @Override public boolean isUnionClass() { checkProfile( getProfile().UNION_OF(), "UNION_OF" ); return hasProperty( getProfile().UNION_OF() ); }
/** * <p>Answer true if this class is an enumerated class expression</p> * @return True if this is an enumerated class expression */ @Override public boolean isEnumeratedClass() { checkProfile( getProfile().ONE_OF(), "ONE_OF" ); return hasProperty( getProfile().ONE_OF() ); }
/** * <p>Answer true if this class is an intersection class expression</p> * @return True if this is an intersection class expression */ @Override public boolean isIntersectionClass() { checkProfile( getProfile().INTERSECTION_OF(), "INTERSECTION_OF" ); return hasProperty( getProfile().INTERSECTION_OF() ); }
/** * <p>Answer true if this class is an intersection class expression</p> * @return True if this is an intersection class expression */ @Override public boolean isIntersectionClass() { checkProfile( getProfile().INTERSECTION_OF(), "INTERSECTION_OF" ); return hasProperty( getProfile().INTERSECTION_OF() ); }
/** * <p>Answer true if this class is a complement class expression</p> * @return True if this is a complement class expression */ @Override public boolean isComplementClass() { checkProfile( getProfile().COMPLEMENT_OF(), "COMPLEMENT_OF" ); return hasProperty( getProfile().COMPLEMENT_OF() ); }
/** * <p>Answer true if this class is a complement class expression</p> * @return True if this is a complement class expression */ @Override public boolean isComplementClass() { checkProfile( getProfile().COMPLEMENT_OF(), "COMPLEMENT_OF" ); return hasProperty( getProfile().COMPLEMENT_OF() ); }
/** * <p>Answer true if this class is a property restriction</p> * @return True if this is a restriction */ @Override public boolean isRestriction() { checkProfile( getProfile().RESTRICTION(), "RESTRICTION" ); return hasProperty( getProfile().ON_PROPERTY() ) || hasProperty( RDF.type, getProfile().RESTRICTION() ); }
/** * <p>Answer true if this class is a property restriction</p> * @return True if this is a restriction */ @Override public boolean isRestriction() { checkProfile( getProfile().RESTRICTION(), "RESTRICTION" ); return hasProperty( getProfile().ON_PROPERTY() ) || hasProperty( RDF.type, getProfile().RESTRICTION() ); }
/** * <p>Assert that this class is super-class of the given class. Any existing * statements for <code>subClassOf</code> on <code>prop</code> will be removed.</p> * @param cls The class that is a sub-class of this class * @exception ProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile. */ @Override public void setSubClass( Resource cls ) { // first we have to remove all of the inverse sub-class links checkProfile( getProfile().SUB_CLASS_OF(), "SUB_CLASS_OF" ); for (StmtIterator i = getModel().listStatements( null, getProfile().SUB_CLASS_OF(), this ); i.hasNext(); ) { i.removeNext(); } cls.as( OntClass.class ).addSuperClass( this ); }
/** * <p>Assert that this class is super-class of the given class. Any existing * statements for <code>subClassOf</code> on <code>prop</code> will be removed.</p> * @param cls The class that is a sub-class of this class * @exception ProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile. */ @Override public void setSubClass( Resource cls ) { // first we have to remove all of the inverse sub-class links checkProfile( getProfile().SUB_CLASS_OF(), "SUB_CLASS_OF" ); for (StmtIterator i = getModel().listStatements( null, getProfile().SUB_CLASS_OF(), this ); i.hasNext(); ) { i.removeNext(); } cls.as( OntClass.class ).addSuperClass( this ); }
/** * <p>Answer a class that is the sub-class of this class. If there is * more than one such class, an arbitrary selection is made. If * there is no such class, return null.</p> * @return A sub-class of this class or null * @exception ProfileException If the {@link Profile#SUB_CLASS_OF()} * property is not supported in the current language profile. */ @Override public OntClass getSubClass() { checkProfile( getProfile().SUB_CLASS_OF(), "SUB_CLASS_OF" ); StmtIterator i = getModel().listStatements( null, getProfile().SUB_CLASS_OF(), this ); try { if (i.hasNext()) { return i.nextStatement() .getSubject() .as( OntClass.class ); } else { return null; } } finally { i.close(); } }
/** * <p>Answer a class that is the sub-class of this class. If there is * more than one such class, an arbitrary selection is made. If * there is no such class, return null.</p> * @return A sub-class of this class or null * @exception ProfileException If the {@link Profile#SUB_CLASS_OF()} * property is not supported in the current language profile. */ @Override public OntClass getSubClass() { checkProfile( getProfile().SUB_CLASS_OF(), "SUB_CLASS_OF" ); StmtIterator i = getModel().listStatements( null, getProfile().SUB_CLASS_OF(), this ); try { if (i.hasNext()) { return i.nextStatement() .getSubject() .as( OntClass.class ); } else { return null; } } finally { i.close(); } }