public class OwlRestriction extends java.lang.Object implements Validating
Modifier and Type | Class and Description |
---|---|
static class |
OwlRestriction.ValueRange
Restriction type enumeration.
|
Constructor and Description |
---|
OwlRestriction(org.w3c.dom.Element element)
Create a DataType property from an owl:Restriction Element.
|
OwlRestriction(java.lang.String propertyName,
OwlRestriction.ValueRange resType,
java.util.Set<java.lang.String> values)
Create a restriction from a property name, type, and range of values
|
Modifier and Type | Method and Description |
---|---|
boolean |
canAssign(OwlThing owlThing,
java.lang.String value)
Determine whether the OwlThing can be assigned the value for the
property associated with this restriction.
|
OwlRestriction |
getInverse()
Create a restriction which is the inverse of this restriction.
|
int |
getMaxCardinality()
Get the maximum cardinality for this restriction.
|
int |
getMinCardinality()
Get the minimum cardinality for this restriction.
|
java.lang.String |
getPropertyName()
Get the name of the property this restriction applies to.
|
OwlRestriction |
getRangeRestriction()
Get a restriction which applies to the allowed values.
|
OwlRestriction.ValueRange |
getRangeType()
Return the type of restriction
|
OwlClass |
getRestrictionClass()
Get the class of objects this restriction restricts the values to.
|
java.util.Set<java.lang.String> |
getValues()
Get the set of values which the property can take.
|
boolean |
isInEquivalence()
Return whether this restriction is in an equivalence clause for its
containing OwlClass
|
boolean |
isValid(OwlThing owlThing)
Determine whether the specified OwlThing conforms to this restriction.
|
boolean |
isValidProperty(java.lang.String propertyName,
OwlThing owlThing)
Determines whether the given OwlThing may be assigned to the property in
a valid way according to this restriction.
|
void |
setInEquivalence(boolean equivFlag)
Set whether this restriction is in an equivalence clause
|
java.lang.String |
toString()
Return a string representation of this OwlRestriction
|
public OwlRestriction(org.w3c.dom.Element element)
element
- the restriction elementpublic OwlRestriction(java.lang.String propertyName, OwlRestriction.ValueRange resType, java.util.Set<java.lang.String> values)
propertyName
- the property nameresType
- the restriction typevalues
- the range of values allowedpublic boolean canAssign(OwlThing owlThing, java.lang.String value)
owlThing
- the OwlThing to checkvalue
- the value for the propertypublic OwlRestriction getInverse()
public int getMaxCardinality()
public int getMinCardinality()
public java.lang.String getPropertyName()
public OwlRestriction getRangeRestriction()
public OwlRestriction.ValueRange getRangeType()
public OwlClass getRestrictionClass()
public java.util.Set<java.lang.String> getValues()
public boolean isInEquivalence()
public boolean isValid(OwlThing owlThing)
isValid
in interface Validating
owlThing
- the OwlThing to checkpublic boolean isValidProperty(java.lang.String propertyName, OwlThing owlThing)
isValidProperty
in interface Validating
propertyName
- the name of the propertyowlThing
- the OwlThing to test for assignment to the propertypublic void setInEquivalence(boolean equivFlag)
equivFlag
- the equivalence clause flagpublic java.lang.String toString()
toString
in class java.lang.Object