/** * <p>Answer a class description defined as the class of those individuals that have exactly * the given number of values for the given property.</p> * * @param uri The optional URI for the restriction, or null for an anonymous restriction (which * should be the normal case) * @param prop The property the restriction applies to * @param cardinality The exact cardinality of the property * @return A new resource representing a has-value restriction */ @Override public CardinalityRestriction createCardinalityRestriction( String uri, Property prop, int cardinality ) { checkProfileEntry( getProfile().RESTRICTION(), "RESTRICTION" ); Restriction r = createOntResource( Restriction.class, getProfile().RESTRICTION(), uri ); if (prop == null) { throw new IllegalArgumentException( "Cannot create cardinalityRestriction with a null property" ); } checkProfileEntry( getProfile().CARDINALITY(), "CARDINALITY" ); r.addProperty( getProfile().ON_PROPERTY(), prop ); r.addProperty( getProfile().CARDINALITY(), createTypedLiteral( cardinality ) ); return r.as( CardinalityRestriction.class ); }
/** * <p>Answer a class description defined as the class of those individuals that have at most * the given number of values for the given property.</p> * * @param uri The optional URI for the restriction, or null for an anonymous restriction (which * should be the normal case) * @param prop The property the restriction applies to * @param cardinality The maximum cardinality of the property * @return A new resource representing a mas-cardinality restriction */ @Override public MaxCardinalityRestriction createMaxCardinalityRestriction( String uri, Property prop, int cardinality ) { checkProfileEntry( getProfile().RESTRICTION(), "RESTRICTION" ); Restriction r = createOntResource( Restriction.class, getProfile().RESTRICTION(), uri ); if (prop == null) { throw new IllegalArgumentException( "Cannot create maxCardinalityRestriction with a null property" ); } checkProfileEntry( getProfile().MAX_CARDINALITY(), "MAX_CARDINALITY" ); r.addProperty( getProfile().ON_PROPERTY(), prop ); r.addProperty( getProfile().MAX_CARDINALITY(), createTypedLiteral( cardinality ) ); return r.as( MaxCardinalityRestriction.class ); }
/** * <p>Answer a class description defined as the class of those individuals that have at least * the given number of values for the given property.</p> * * @param uri The optional URI for the restriction, or null for an anonymous restriction (which * should be the normal case) * @param prop The property the restriction applies to * @param cardinality The minimum cardinality of the property * @return A new resource representing a min-cardinality restriction */ @Override public MinCardinalityRestriction createMinCardinalityRestriction( String uri, Property prop, int cardinality ) { checkProfileEntry( getProfile().RESTRICTION(), "RESTRICTION" ); Restriction r = createOntResource( Restriction.class, getProfile().RESTRICTION(), uri ); if (prop == null) { throw new IllegalArgumentException( "Cannot create minCardinalityRestriction with a null property" ); } checkProfileEntry( getProfile().MIN_CARDINALITY(), "MIN_CARDINALITY" ); r.addProperty( getProfile().ON_PROPERTY(), prop ); r.addProperty( getProfile().MIN_CARDINALITY(), createTypedLiteral( cardinality ) ); return r.as( MinCardinalityRestriction.class ); }
/** * <p>Answer a class description defined as the class of those individuals that have exactly * the given number of values for the given property.</p> * * @param uri The optional URI for the restriction, or null for an anonymous restriction (which * should be the normal case) * @param prop The property the restriction applies to * @param cardinality The exact cardinality of the property * @return A new resource representing a has-value restriction */ @Override public CardinalityRestriction createCardinalityRestriction( String uri, Property prop, int cardinality ) { checkProfileEntry( getProfile().RESTRICTION(), "RESTRICTION" ); Restriction r = createOntResource( Restriction.class, getProfile().RESTRICTION(), uri ); if (prop == null) { throw new IllegalArgumentException( "Cannot create cardinalityRestriction with a null property" ); } checkProfileEntry( getProfile().CARDINALITY(), "CARDINALITY" ); r.addProperty( getProfile().ON_PROPERTY(), prop ); r.addProperty( getProfile().CARDINALITY(), createTypedLiteral( cardinality ) ); return r.as( CardinalityRestriction.class ); }
/** * <p>Answer a class description defined as the class of those individuals that have at least * the given number of values for the given property.</p> * * @param uri The optional URI for the restriction, or null for an anonymous restriction (which * should be the normal case) * @param prop The property the restriction applies to * @param cardinality The minimum cardinality of the property * @return A new resource representing a min-cardinality restriction */ @Override public MinCardinalityRestriction createMinCardinalityRestriction( String uri, Property prop, int cardinality ) { checkProfileEntry( getProfile().RESTRICTION(), "RESTRICTION" ); Restriction r = createOntResource( Restriction.class, getProfile().RESTRICTION(), uri ); if (prop == null) { throw new IllegalArgumentException( "Cannot create minCardinalityRestriction with a null property" ); } checkProfileEntry( getProfile().MIN_CARDINALITY(), "MIN_CARDINALITY" ); r.addProperty( getProfile().ON_PROPERTY(), prop ); r.addProperty( getProfile().MIN_CARDINALITY(), createTypedLiteral( cardinality ) ); return r.as( MinCardinalityRestriction.class ); }
/** * <p>Answer a class description defined as the class of those individuals that have at most * the given number of values for the given property.</p> * * @param uri The optional URI for the restriction, or null for an anonymous restriction (which * should be the normal case) * @param prop The property the restriction applies to * @param cardinality The maximum cardinality of the property * @return A new resource representing a mas-cardinality restriction */ @Override public MaxCardinalityRestriction createMaxCardinalityRestriction( String uri, Property prop, int cardinality ) { checkProfileEntry( getProfile().RESTRICTION(), "RESTRICTION" ); Restriction r = createOntResource( Restriction.class, getProfile().RESTRICTION(), uri ); if (prop == null) { throw new IllegalArgumentException( "Cannot create maxCardinalityRestriction with a null property" ); } checkProfileEntry( getProfile().MAX_CARDINALITY(), "MAX_CARDINALITY" ); r.addProperty( getProfile().ON_PROPERTY(), prop ); r.addProperty( getProfile().MAX_CARDINALITY(), createTypedLiteral( cardinality ) ); return r.as( MaxCardinalityRestriction.class ); }
/** * <p>Answer a class description defined as the class of those individuals that have at least * the given number of values for the given property, all values of which belong to the given * class.</p> * * @param uri The optional URI for the restriction, or null for an anonymous restriction (which * should be the normal case) * @param prop The property the restriction applies to * @param cardinality The minimun cardinality of the property * @param cls The class to which all values of the restricted property should belong * @return A new resource representing a mas-cardinality restriction */ @Override public MinCardinalityQRestriction createMinCardinalityQRestriction( String uri, Property prop, int cardinality, OntClass cls ) { checkProfileEntry( getProfile().RESTRICTION(), "RESTRICTION" ); checkProfileEntry( getProfile().ON_PROPERTY(), "ON_PROPERTY" ); checkProfileEntry( getProfile().MIN_CARDINALITY_Q(), "MIN_CARDINALITY_Q" ); checkProfileEntry( getProfile().HAS_CLASS_Q(), "HAS_CLASS_Q" ); if (prop == null) { throw new IllegalArgumentException( "Cannot create MinCardinalityQRestriction with a null property" ); } if (cls == null) { throw new IllegalArgumentException( "Cannot create MinCardinalityQRestriction with a null class" ); } Restriction r = createOntResource( Restriction.class, getProfile().RESTRICTION(), uri ); r.addProperty( getProfile().ON_PROPERTY(), prop ); r.addProperty( getProfile().MIN_CARDINALITY_Q(), createTypedLiteral( cardinality ) ); r.addProperty( getProfile().HAS_CLASS_Q(), cls ); return r.as( MinCardinalityQRestriction.class ); }
/** * <p>Answer a class description defined as the class of those individuals that have exactly * the given number of values for the given property, all values of which belong to the given * class.</p> * * @param uri The optional URI for the restriction, or null for an anonymous restriction (which * should be the normal case) * @param prop The property the restriction applies to * @param cardinality The cardinality of the property * @param cls The class to which all values of the restricted property should belong * @return A new resource representing a mas-cardinality restriction */ @Override public CardinalityQRestriction createCardinalityQRestriction( String uri, Property prop, int cardinality, OntClass cls ) { checkProfileEntry( getProfile().RESTRICTION(), "RESTRICTION" ); checkProfileEntry( getProfile().ON_PROPERTY(), "ON_PROPERTY" ); checkProfileEntry( getProfile().CARDINALITY_Q(), "CARDINALITY_Q" ); checkProfileEntry( getProfile().HAS_CLASS_Q(), "HAS_CLASS_Q" ); if (prop == null) { throw new IllegalArgumentException( "Cannot create CardinalityQRestriction with a null property" ); } if (cls == null) { throw new IllegalArgumentException( "Cannot create CardinalityQRestriction with a null class" ); } Restriction r = createOntResource( Restriction.class, getProfile().RESTRICTION(), uri ); r.addProperty( getProfile().ON_PROPERTY(), prop ); r.addProperty( getProfile().CARDINALITY_Q(), createTypedLiteral( cardinality ) ); r.addProperty( getProfile().HAS_CLASS_Q(), cls ); return r.as( CardinalityQRestriction.class ); }
/** * <p>Answer a class description defined as the class of those individuals that have exactly * the given number of values for the given property, all values of which belong to the given * class.</p> * * @param uri The optional URI for the restriction, or null for an anonymous restriction (which * should be the normal case) * @param prop The property the restriction applies to * @param cardinality The cardinality of the property * @param cls The class to which all values of the restricted property should belong * @return A new resource representing a mas-cardinality restriction */ @Override public CardinalityQRestriction createCardinalityQRestriction( String uri, Property prop, int cardinality, OntClass cls ) { checkProfileEntry( getProfile().RESTRICTION(), "RESTRICTION" ); checkProfileEntry( getProfile().ON_PROPERTY(), "ON_PROPERTY" ); checkProfileEntry( getProfile().CARDINALITY_Q(), "CARDINALITY_Q" ); checkProfileEntry( getProfile().HAS_CLASS_Q(), "HAS_CLASS_Q" ); if (prop == null) { throw new IllegalArgumentException( "Cannot create CardinalityQRestriction with a null property" ); } if (cls == null) { throw new IllegalArgumentException( "Cannot create CardinalityQRestriction with a null class" ); } Restriction r = createOntResource( Restriction.class, getProfile().RESTRICTION(), uri ); r.addProperty( getProfile().ON_PROPERTY(), prop ); r.addProperty( getProfile().CARDINALITY_Q(), createTypedLiteral( cardinality ) ); r.addProperty( getProfile().HAS_CLASS_Q(), cls ); return r.as( CardinalityQRestriction.class ); }
/** * <p>Answer a class description defined as the class of those individuals that have at most * the given number of values for the given property, all values of which belong to the given * class.</p> * * @param uri The optional URI for the restriction, or null for an anonymous restriction (which * should be the normal case) * @param prop The property the restriction applies to * @param cardinality The maximum cardinality of the property * @param cls The class to which all values of the restricted property should belong * @return A new resource representing a mas-cardinality restriction */ @Override public MaxCardinalityQRestriction createMaxCardinalityQRestriction( String uri, Property prop, int cardinality, OntClass cls ) { checkProfileEntry( getProfile().RESTRICTION(), "RESTRICTION" ); checkProfileEntry( getProfile().ON_PROPERTY(), "ON_PROPERTY" ); checkProfileEntry( getProfile().MAX_CARDINALITY_Q(), "MAX_CARDINALITY_Q" ); checkProfileEntry( getProfile().HAS_CLASS_Q(), "HAS_CLASS_Q" ); if (prop == null) { throw new IllegalArgumentException( "Cannot create MaxCardinalityQRestriction with a null property" ); } if (cls == null) { throw new IllegalArgumentException( "Cannot create MaxCardinalityQRestriction with a null class" ); } Restriction r = createOntResource( Restriction.class, getProfile().RESTRICTION(), uri ); r.addProperty( getProfile().ON_PROPERTY(), prop ); r.addProperty( getProfile().MAX_CARDINALITY_Q(), createTypedLiteral( cardinality ) ); r.addProperty( getProfile().HAS_CLASS_Q(), cls ); return r.as( MaxCardinalityQRestriction.class ); }
/** * <p>Answer a class description defined as the class of those individuals that have at least * the given number of values for the given property, all values of which belong to the given * class.</p> * * @param uri The optional URI for the restriction, or null for an anonymous restriction (which * should be the normal case) * @param prop The property the restriction applies to * @param cardinality The minimun cardinality of the property * @param cls The class to which all values of the restricted property should belong * @return A new resource representing a mas-cardinality restriction */ @Override public MinCardinalityQRestriction createMinCardinalityQRestriction( String uri, Property prop, int cardinality, OntClass cls ) { checkProfileEntry( getProfile().RESTRICTION(), "RESTRICTION" ); checkProfileEntry( getProfile().ON_PROPERTY(), "ON_PROPERTY" ); checkProfileEntry( getProfile().MIN_CARDINALITY_Q(), "MIN_CARDINALITY_Q" ); checkProfileEntry( getProfile().HAS_CLASS_Q(), "HAS_CLASS_Q" ); if (prop == null) { throw new IllegalArgumentException( "Cannot create MinCardinalityQRestriction with a null property" ); } if (cls == null) { throw new IllegalArgumentException( "Cannot create MinCardinalityQRestriction with a null class" ); } Restriction r = createOntResource( Restriction.class, getProfile().RESTRICTION(), uri ); r.addProperty( getProfile().ON_PROPERTY(), prop ); r.addProperty( getProfile().MIN_CARDINALITY_Q(), createTypedLiteral( cardinality ) ); r.addProperty( getProfile().HAS_CLASS_Q(), cls ); return r.as( MinCardinalityQRestriction.class ); }
/** * <p>Answer a class description defined as the class of those individuals that have at most * the given number of values for the given property, all values of which belong to the given * class.</p> * * @param uri The optional URI for the restriction, or null for an anonymous restriction (which * should be the normal case) * @param prop The property the restriction applies to * @param cardinality The maximum cardinality of the property * @param cls The class to which all values of the restricted property should belong * @return A new resource representing a mas-cardinality restriction */ @Override public MaxCardinalityQRestriction createMaxCardinalityQRestriction( String uri, Property prop, int cardinality, OntClass cls ) { checkProfileEntry( getProfile().RESTRICTION(), "RESTRICTION" ); checkProfileEntry( getProfile().ON_PROPERTY(), "ON_PROPERTY" ); checkProfileEntry( getProfile().MAX_CARDINALITY_Q(), "MAX_CARDINALITY_Q" ); checkProfileEntry( getProfile().HAS_CLASS_Q(), "HAS_CLASS_Q" ); if (prop == null) { throw new IllegalArgumentException( "Cannot create MaxCardinalityQRestriction with a null property" ); } if (cls == null) { throw new IllegalArgumentException( "Cannot create MaxCardinalityQRestriction with a null class" ); } Restriction r = createOntResource( Restriction.class, getProfile().RESTRICTION(), uri ); r.addProperty( getProfile().ON_PROPERTY(), prop ); r.addProperty( getProfile().MAX_CARDINALITY_Q(), createTypedLiteral( cardinality ) ); r.addProperty( getProfile().HAS_CLASS_Q(), cls ); return r.as( MaxCardinalityQRestriction.class ); }