public abstract class PropertyRestriction extends TypeExpression
TypeExpression
s that impose a restriction on a
property. Subclasses will implement the functionality for specific OWL
restrictions.
All property restrictions are defined by a property and one ore more constraints and describe those individuals that are connected by the defined property to individuals/literals under the condition that the defined constraint is fulfilled.
MergedRestriction
Modifier and Type | Field and Description |
---|---|
static String |
MY_URI
URI for owl:Restriction.
|
static String |
PROP_OWL_ON_PROPERTY
URI for owl:onProperty.
|
protected static Set<String> |
propMap
Set of all property URIs that are used in the different property
restrictions.
|
EXCEPTION_TTL, OWL_CLASS, OWL_NAMESPACE, PROP_RDFS_SUB_CLASS_OF, RDFS_DATATYPE, TYPE_OWL_THING
ANON_URI_PREFIX, blockAddingTypes, isXMLLiteral, NAMESPACE_PREFIX, ns_delim_index, PROP_INVOLVED_HUMAN_USER, PROP_RDF_FIRST, PROP_RDF_REST, PROP_RDF_TYPE, PROP_RDFS_COMMENT, PROP_RDFS_LABEL, PROP_SERIALIZATION_FULL, PROP_SERIALIZATION_OPTIONAL, PROP_SERIALIZATION_REDUCED, PROP_SERIALIZATION_UNDEFINED, props, RDF_EMPTY_LIST, RDF_NAMESPACE, RDFS_NAMESPACE, SERVICE_NAMESPACE, TYPE_RDF_LIST, TYPE_RDFS_CLASS, uri, VOCABULARY_NAMESPACE
Modifier and Type | Method and Description |
---|---|
boolean |
addToList(ArrayList a)
Add this restriction to the given set of restrictions.
|
protected TypeExpression |
copyTo(PropertyRestriction copy)
Helper method to copy Restrictions.
|
String |
getClassURI()
Get the class URI for this
PropertyRestriction . |
Object |
getConstraint()
Get the constraint of all value restrictions (
HasValueRestriction
, SomeValuesFromRestriction , or AllValuesFromRestriction ,
but none of the cardinality restrictions). |
String[] |
getNamedSuperclasses()
Get the set of class URIs for all super classes of the individuals of
this class expression.
|
String |
getOnProperty()
Get the property for which this restriction is defined.
|
static PropertyRestriction |
getRestriction(ArrayList a,
String restrictionURI)
Get a restriction with the given class URI from the given set of
restrictions.
|
AllValuesFromRestriction |
getRestrictionOnProperty(String propURI)
This method is specifically defined for working with property paths,
hence whenever it is called it means that the path is already processed
until the 'onProperty' of this Restriction and now we are interested in
the restrictions defined for the next property in the path (the property
given as input parameter).
|
Object[] |
getUpperEnumeration()
Each type expression can contain multiple objects; this method returns
this set of objects.
|
protected Object |
matchesNonRestriction(TypeExpression subtype,
HashMap context,
int ttl,
List<MatchLogEntry> log)
Check all cases where the subtype is not a subclass of
PropertyRestriction() . |
protected void |
setOnProperty(String propURI)
Set the property for which this restriction is defined.
|
boolean |
setProperty(String propURI,
Object value)
Adds a statement with this resource as the subject, the given
propURI as the predicate and the given value as the object. |
checkTTL, collectTypesMinimized, copy, getDefaultMatchmakingTTL, hasMember, hasMember, hasMember, isDisjointWith, isDisjointWith, isDisjointWith, isWellFormed, matches, matches, matches, synchronize
addMultiLangProp, addType, asList, asList, asRDFList, changeProperty, copy, deepCopy, equals, generateAnonURI, getDefaultLang, getFilename, getLocalName, getMultiLangProp, getNamespace, getOrConstructLabel, getOrConstructLabel, getProperty, getPropertyURIs, getPropSerializationType, getResource, getResourceComment, getResourceLabel, getResourceLabel, getStaticFieldValue, getType, getTypes, getURI, hashCode, hasProperty, hasQualifiedName, isAnon, isAnon, isBlockingAddingTypes, isClosedCollection, isQualifiedName, literal, numberOfProperties, representsQualifiedURI, serializesAsXMLLiteral, setPropertyPath, setPropertyPath, setPropertyPathFromOffset, setResourceComment, setResourceLabel, toString, toStringRecursive, toStringRecursive, unliteral
public static final String MY_URI
public static final String PROP_OWL_ON_PROPERTY
protected static final Set<String> propMap
setProperty(String, Object)
method to avoid setting two or more of those properties because they
should uniquely identify the type of the restriction.public String getClassURI()
PropertyRestriction
.public Object getConstraint()
HasValueRestriction
, SomeValuesFromRestriction
, or AllValuesFromRestriction
,
but none of the cardinality restrictions). Subclasses should override
this method if they have a constraint.protected void setOnProperty(String propURI)
propURI
- URI of the property.public String getOnProperty()
protected TypeExpression copyTo(PropertyRestriction copy)
copy
- An instance of the class to which to copy all properties.TypeExpression.copy()
public String[] getNamedSuperclasses()
TypeExpression
getNamedSuperclasses
in class TypeExpression
public Object[] getUpperEnumeration()
TypeExpression
getUpperEnumeration
in class TypeExpression
protected Object matchesNonRestriction(TypeExpression subtype, HashMap context, int ttl, List<MatchLogEntry> log)
PropertyRestriction()
. Helper method for
TypeExpression.matches(TypeExpression, HashMap, int, List)
in subclasses.public boolean setProperty(String propURI, Object value)
Resource
propURI
as the predicate and the given value as the object.
Subclasses must override this in order to decide if the statement to be
added fits the general class constraints. If not, the call of this method
should be ignored. For each property only one single call may be made to
this method, unless subsequent calls to this method for setting the value
of the same property are treated as an update for an update-able
property. Multi-valued properties must be set using an instance of
List
. The differentiation, if a such list should be
treated as an rdf:List, can be made with the help of
Resource.isClosedCollection(String)
. The default implementation here
accepts all property-value pairs blindly except for rdf:type which is
handled if the value is a type URI, a Resource or a java.util.List of
them.
Note: The setting of the property rdf:type is being handled by this class
via the final methods Resource.addType(String, boolean)
,
Resource.getType()
, and Resource.getTypes()
. Although these methods give
the view of handling type URIs as strings, but in reality the types are
stored as direct instances of this class. So, the subclasses should
ignore calls for setting rdf:type; if not, then the subclass must pay
attention that the value should be a List
of direct instances of
this class so that (1) the Resource.toString()
method returns just the
URI and (2) the serializers get no problems with the value. Also,
settings via subclasses may be overwritten by this class if a subsequent
call to Resource.addType(String, boolean)
is made.
setProperty
in class Resource
public boolean addToList(ArrayList a)
a
- The set of Restrictions.public static PropertyRestriction getRestriction(ArrayList a, String restrictionURI)
#getClassURI()
.a
- The set of Restrictions.restrictionURI
- The URI of the Restriction class to search for.public AllValuesFromRestriction getRestrictionOnProperty(String propURI)
Copyright © 2018 universAAL Consortium. All rights reserved.