/** * <p>Answer a property that is the sub-property of this property. If there is * more than one such property, an arbitrary selection is made.</p> * @return 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 OntProperty getSubProperty() { checkProfile( getProfile().SUB_PROPERTY_OF(), "SUB_PROPERTY_OF" ); return getModel().listStatements( null, getProfile().SUB_PROPERTY_OF(), this ) .nextStatement() .getSubject() .as( OntProperty.class ); }
/** * <p>Answer a property that is the sub-property of this property. If there is * more than one such property, an arbitrary selection is made.</p> * @return 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 OntProperty getSubProperty() { checkProfile( getProfile().SUB_PROPERTY_OF(), "SUB_PROPERTY_OF" ); return getModel().listStatements( null, getProfile().SUB_PROPERTY_OF(), this ) .nextStatement() .getSubject() .as( OntProperty.class ); }
/** * <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 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 ); }