public class RestrictionImpl extends OntClassImpl implements Restriction
Implementation of the ontology abstraction representing restrictions.
| Modifier and Type | Field and Description |
|---|---|
static Implementation |
factory
A factory for generating Restriction facets from nodes in enhanced graphs.
|
KNOWN_LANGUAGESrdfNodeFactory| Constructor and Description |
|---|
RestrictionImpl(Node n,
EnhGraph g)
Construct a restriction node represented by the given node in the given graph.
|
| Modifier and Type | Method and Description |
|---|---|
AllValuesFromRestriction |
asAllValuesFromRestriction()
Answer a view of this restriction as an all values from expression
|
CardinalityRestriction |
asCardinalityRestriction()
Answer a view of this restriction as a cardinality restriction class expression
|
HasValueRestriction |
asHasValueRestriction()
Answer a view of this restriction as a has value expression
|
MaxCardinalityRestriction |
asMaxCardinalityRestriction()
Answer a view of this restriction as a max cardinality restriction class expression
|
MinCardinalityRestriction |
asMinCardinalityRestriction()
Answer a view of this restriction as a min cardinality restriction class expression
|
SomeValuesFromRestriction |
asSomeValuesFromRestriction()
Answer a view of this restriction as a some values from expression
|
AllValuesFromRestriction |
convertToAllValuesFromRestriction(Resource cls)
Convert this restriction to an all values from class expression.
|
CardinalityRestriction |
convertToCardinalityRestriction(int cardinality)
Convert this restriction to a cardinality restriction class expression
|
HasValueRestriction |
convertToHasValueRestriction(RDFNode value)
Convert this restriction to a has value class expression
|
MaxCardinalityRestriction |
convertToMaxCardinalityRestriction(int cardinality)
Convert this restriction to a max cardinality restriction class expression
|
MinCardinalityRestriction |
convertToMinCardinalityRestriction(int cardinality)
Convert this restriction to a min cardinality restriction class expression
|
SomeValuesFromRestriction |
convertToSomeValuesFromRestriction(Resource cls)
Convert this restriction to a some values from class expression
|
OntProperty |
getOnProperty()
Answer the property that this property restriction applies to.
|
boolean |
isAllValuesFromRestriction()
Answer true if this restriction is an all values from restriction
|
boolean |
isCardinalityRestriction()
Answer true if this restriction is a cardinality restriction (ie is a property restriction
constructed with an
owl:cardinality operator, or similar). |
boolean |
isHasValueRestriction()
Answer true if this restriction is a has value restriction
|
boolean |
isMaxCardinalityRestriction()
Answer true if this restriction is a max cardinality restriction (ie is a property restriction
constructed with an
owl:maxCardinality operator, or similar). |
boolean |
isMinCardinalityRestriction()
Answer true if this restriction is a min cardinality restriction (ie is a property restriction
constructed with an
owl:minCardinality operator, or similar). |
boolean |
isSomeValuesFromRestriction()
Answer true if this restriction is a some values from restriction
|
boolean |
onProperty(Property prop)
Answer true if this restriction is a property restriction on the given property.
|
void |
removeOnProperty(Property prop)
Remove the given property as the property that this restriction applies to.
|
void |
setOnProperty(Property prop)
Assert that the property that this restriction applies to is the given property.
|
addDisjointWith, addEquivalentClass, addSubClass, addSuperClass, asComplementClass, asEnumeratedClass, asIntersectionClass, asRestriction, asUnionClass, convertToComplementClass, convertToEnumeratedClass, convertToIntersectionClass, convertToRestriction, convertToUnionClass, createIndividual, createIndividual, dropIndividual, getDisjointWith, getEquivalentClass, getSubClass, getSuperClass, hasDeclaredProperty, hasEquivalentClass, hasSubClass, hasSubClass, hasSubClass, hasSuperClass, hasSuperClass, hasSuperClass, isComplementClass, isDisjointWith, isEnumeratedClass, isHierarchyRoot, isIntersectionClass, isRestriction, isUnionClass, listDeclaredProperties, listDeclaredProperties, listDisjointWith, listEquivalentClasses, listInstances, listInstances, listSubClasses, listSubClasses, listSuperClasses, listSuperClasses, removeDisjointWith, removeEquivalentClass, removeSubClass, removeSuperClass, setDisjointWith, setEquivalentClass, setSubClass, setSuperClassaddComment, addComment, addDifferentFrom, addIsDefinedBy, addLabel, addLabel, addRDFType, addSameAs, addSeeAlso, addVersionInfo, asAllDifferent, asAnnotationProperty, asClass, asDataRange, asDatatypeProperty, asIndividual, asObjectProperty, asOntology, asProperty, getCardinality, getComment, getDifferentFrom, getIsDefinedBy, getLabel, getOntModel, getProfile, getPropertyValue, getRDFType, getRDFType, getSameAs, getSeeAlso, getVersionInfo, hasComment, hasComment, hasLabel, hasLabel, hasRDFType, hasRDFType, hasRDFType, hasSeeAlso, hasVersionInfo, isAllDifferent, isAnnotationProperty, isClass, isDataRange, isDatatypeProperty, isDefinedBy, isDifferentFrom, isIndividual, isObjectProperty, isOntLanguageTerm, isOntology, isProperty, isSameAs, listComments, listDifferentFrom, listIsDefinedBy, listLabels, listPropertyValues, listRDFTypes, listSameAs, listSeeAlso, listVersionInfo, remove, removeComment, removeComment, removeDefinedBy, removeDifferentFrom, removeLabel, removeLabel, removeProperty, removeRDFType, removeSameAs, removeSeeAlso, removeVersionInfo, setComment, setDifferentFrom, setIsDefinedBy, setLabel, setPropertyValue, setRDFType, setSameAs, setSeeAlso, setVersionInfoabort, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, asLiteral, asResource, begin, commit, getId, getLocalName, getModel, getNameSpace, getProperty, getProperty, getPropertyResourceValue, getRequiredProperty, getRequiredProperty, getStmtTerm, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, inModel, listProperties, listProperties, listProperties, removeAll, removeProperties, toString, visitWithas, asNode, canAs, equals, getGraph, hashCode, isAnon, isLiteral, isResource, isStmtResource, isURIResource, isValid, viewAsaddView, supportsaddDisjointWith, addEquivalentClass, addSubClass, addSuperClass, asComplementClass, asEnumeratedClass, asIntersectionClass, asRestriction, asUnionClass, convertToComplementClass, convertToEnumeratedClass, convertToIntersectionClass, convertToRestriction, convertToUnionClass, createIndividual, createIndividual, dropIndividual, getDisjointWith, getEquivalentClass, getSubClass, getSuperClass, hasDeclaredProperty, hasEquivalentClass, hasSubClass, hasSubClass, hasSubClass, hasSuperClass, hasSuperClass, hasSuperClass, isComplementClass, isDisjointWith, isEnumeratedClass, isHierarchyRoot, isIntersectionClass, isRestriction, isUnionClass, listDeclaredProperties, listDeclaredProperties, listDisjointWith, listEquivalentClasses, listInstances, listInstances, listSubClasses, listSubClasses, listSuperClasses, listSuperClasses, removeDisjointWith, removeEquivalentClass, removeSubClass, removeSuperClass, setDisjointWith, setEquivalentClass, setSubClass, setSuperClassaddComment, addComment, addDifferentFrom, addIsDefinedBy, addLabel, addLabel, addRDFType, addSameAs, addSeeAlso, addVersionInfo, asAllDifferent, asAnnotationProperty, asClass, asDataRange, asDatatypeProperty, asIndividual, asObjectProperty, asOntology, asProperty, getCardinality, getComment, getDifferentFrom, getIsDefinedBy, getLabel, getOntModel, getProfile, getPropertyValue, getRDFType, getRDFType, getSameAs, getSeeAlso, getVersionInfo, hasComment, hasComment, hasLabel, hasLabel, hasRDFType, hasRDFType, hasRDFType, hasSeeAlso, hasVersionInfo, isAllDifferent, isAnnotationProperty, isClass, isDataRange, isDatatypeProperty, isDefinedBy, isDifferentFrom, isIndividual, isObjectProperty, isOntLanguageTerm, isOntology, isProperty, isSameAs, listComments, listDifferentFrom, listIsDefinedBy, listLabels, listPropertyValues, listRDFTypes, listSameAs, listSeeAlso, listVersionInfo, remove, removeComment, removeComment, removeDefinedBy, removeDifferentFrom, removeLabel, removeLabel, removeProperty, removeRDFType, removeSameAs, removeSeeAlso, removeVersionInfo, setComment, setDifferentFrom, setIsDefinedBy, setLabel, setPropertyValue, setRDFType, setSameAs, setSeeAlso, setVersionInfoabort, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getId, getLocalName, getNameSpace, getProperty, getProperty, getPropertyResourceValue, getRequiredProperty, getRequiredProperty, getStmtTerm, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, inModel, listProperties, listProperties, listProperties, removeAll, removeProperties, toStringas, asLiteral, asResource, canAs, getModel, isAnon, isLiteral, isResource, isStmtResource, isURIResource, visitWithasNodepublic static Implementation factory
as() instead.public void setOnProperty(Property prop)
Assert that the property that this restriction applies to is the given property. Any existing
statements for onProperty will be removed.
setOnProperty in interface Restrictionprop - The property that this restriction applies toProfileException - If the Profile.ON_PROPERTY() property is not supported in the current language profile.public OntProperty getOnProperty()
Answer the property that this property restriction applies to. If there is
more than one such resource, an arbitrary selection is made (though well-defined property restrictions
should not have more than one onProperty statement.
getOnProperty in interface RestrictionProfileException - If the Profile.ON_PROPERTY() property is not supported in the current language profile.public boolean onProperty(Property prop)
Answer true if this restriction is a property restriction on the given property.
onProperty in interface Restrictionprop - A property to test againstpropProfileException - If the Profile.ON_PROPERTY() property is not supported in the current language profile.public void removeOnProperty(Property prop)
Remove the given property as the property that this restriction applies to. If this statement is not true of the current model, nothing happens.
removeOnProperty in interface Restrictionprop - The property to be removed as a the property that this restriction applies topublic AllValuesFromRestriction asAllValuesFromRestriction()
Answer a view of this restriction as an all values from expression
asAllValuesFromRestriction in interface RestrictionConversionException - if the class cannot be converted to an all values from restriction
given the lanuage profile and the current state of the underlying model.public SomeValuesFromRestriction asSomeValuesFromRestriction()
Answer a view of this restriction as a some values from expression
asSomeValuesFromRestriction in interface RestrictionConversionException - if the class cannot be converted to an all values from restriction
given the lanuage profile and the current state of the underlying model.public HasValueRestriction asHasValueRestriction()
Answer a view of this restriction as a has value expression
asHasValueRestriction in interface RestrictionConversionException - if the class cannot be converted to a has value restriction
given the lanuage profile and the current state of the underlying model.public CardinalityRestriction asCardinalityRestriction()
Answer a view of this restriction as a cardinality restriction class expression
asCardinalityRestriction in interface RestrictionConversionException - if the class cannot be converted to a cardinality restriction
given the lanuage profile and the current state of the underlying model.public MinCardinalityRestriction asMinCardinalityRestriction()
Answer a view of this restriction as a min cardinality restriction class expression
asMinCardinalityRestriction in interface RestrictionConversionException - if the class cannot be converted to a min cardinality restriction
given the lanuage profile and the current state of the underlying model.public MaxCardinalityRestriction asMaxCardinalityRestriction()
Answer a view of this restriction as a max cardinality restriction class expression
asMaxCardinalityRestriction in interface RestrictionConversionException - if the class cannot be converted to a max cardinality restriction
given the lanuage profile and the current state of the underlying model.public boolean isAllValuesFromRestriction()
Answer true if this restriction is an all values from restriction
isAllValuesFromRestriction in interface RestrictionProfileException - if Profile.ALL_VALUES_FROM() is not supported in the current profilepublic boolean isSomeValuesFromRestriction()
Answer true if this restriction is a some values from restriction
isSomeValuesFromRestriction in interface RestrictionProfileException - if Profile.SOME_VALUES_FROM() is not supported in the current profilepublic boolean isHasValueRestriction()
Answer true if this restriction is a has value restriction
isHasValueRestriction in interface RestrictionProfileException - if Profile.HAS_VALUE() is not supported in the current profilepublic boolean isCardinalityRestriction()
Answer true if this restriction is a cardinality restriction (ie is a property restriction
constructed with an owl:cardinality operator, or similar). This is not a test for
a restriction that tests cardinalities in general.
isCardinalityRestriction in interface RestrictionProfileException - if Profile.CARDINALITY() is not supported in the current profilepublic boolean isMinCardinalityRestriction()
Answer true if this restriction is a min cardinality restriction (ie is a property restriction
constructed with an owl:minCardinality operator, or similar). This is not a test for
a restriction that tests cardinalities in general.
isMinCardinalityRestriction in interface RestrictionProfileException - if Profile.MIN_CARDINALITY() is not supported in the current profilepublic boolean isMaxCardinalityRestriction()
Answer true if this restriction is a max cardinality restriction (ie is a property restriction
constructed with an owl:maxCardinality operator, or similar). This is not a test for
a restriction that tests cardinalities in general.
isMaxCardinalityRestriction in interface RestrictionProfileException - if Profile.MAX_CARDINALITY() is not supported in the current profilepublic AllValuesFromRestriction convertToAllValuesFromRestriction(Resource cls)
Convert this restriction to an all values from class expression.
convertToAllValuesFromRestriction in interface Restrictioncls - The class to which all values of the restricted property must belong, to be in the
extension of this restrictionProfileException - if Profile.ALL_VALUES_FROM() is not supported in the current profilepublic SomeValuesFromRestriction convertToSomeValuesFromRestriction(Resource cls)
Convert this restriction to a some values from class expression
convertToSomeValuesFromRestriction in interface Restrictioncls - The class to which at least one value of the restricted property must belong, to be in the
extension of this restrictionProfileException - if Profile.SOME_VALUES_FROM() is not supported in the current profilepublic HasValueRestriction convertToHasValueRestriction(RDFNode value)
Convert this restriction to a has value class expression
convertToHasValueRestriction in interface Restrictionvalue - The value which the restricted property must have, for resource to be
in the extension of this restrictionProfileException - if Profile.HAS_VALUE() is not supported in the current profilepublic CardinalityRestriction convertToCardinalityRestriction(int cardinality)
Convert this restriction to a cardinality restriction class expression
convertToCardinalityRestriction in interface Restrictioncardinality - The exact cardinality for the restricted propertyProfileException - if Profile.CARDINALITY() is not supported in the current profilepublic MinCardinalityRestriction convertToMinCardinalityRestriction(int cardinality)
Convert this restriction to a min cardinality restriction class expression
convertToMinCardinalityRestriction in interface Restrictioncardinality - The minimum cardinality for the restricted propertyProfileException - if Profile.MIN_CARDINALITY() is not supported in the current profilepublic MaxCardinalityRestriction convertToMaxCardinalityRestriction(int cardinality)
Convert this restriction to a max cardinality restriction class expression
convertToMaxCardinalityRestriction in interface Restrictioncardinality - The maximum cardinality for the restricted propertyProfileException - if Profile.MAX_CARDINALITY() is not supported in the current profileLicenced under the Apache License, Version 2.0