/** * <p>Assert that this property is super-property of the given property. Any existing * statements for <code>subPropertyOf</code> on <code>prop</code> will be removed.</p> * @param prop The property that is a sub-property of this property * @exception ProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile. */ @Override public void setSubProperty( Property prop ) { // first we have to remove all of the inverse sub-prop links checkProfile( getProfile().SUB_PROPERTY_OF(), "SUB_PROPERTY_OF" ); for (StmtIterator i = getModel().listStatements( null, getProfile().SUB_PROPERTY_OF(), this ); i.hasNext(); ) { i.removeNext(); } prop.as( OntProperty.class ).addSuperProperty( 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>Assert that this property is super-property of the given property. Any existing * statements for <code>subPropertyOf</code> on <code>prop</code> will be removed.</p> * @param prop The property that is a sub-property of this property * @exception ProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile. */ @Override public void setSubProperty( Property prop ) { // first we have to remove all of the inverse sub-prop links checkProfile( getProfile().SUB_PROPERTY_OF(), "SUB_PROPERTY_OF" ); for (StmtIterator i = getModel().listStatements( null, getProfile().SUB_PROPERTY_OF(), this ); i.hasNext(); ) { i.removeNext(); } prop.as( OntProperty.class ).addSuperProperty( 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 ); }