|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SSWAPIndividual
Represents an individual in SSWAP, which corresponds to an RDF resource (a
URI or blank node). Individuals can have properties (both object properties
and datatype properties), which in turn have values. An individual is always
in reference to a document; to create a new individual, see SSWAPDocument
.
Method Summary | |
---|---|
SSWAPProperty |
addProperty(SSWAPPredicate predicate,
SSWAPIndividual individual)
Adds a property to this individual with the specified individual as the value. |
SSWAPProperty |
addProperty(SSWAPPredicate predicate,
SSWAPLiteral literal)
Adds a property to this individual with the specified literal value |
SSWAPProperty |
addProperty(SSWAPPredicate predicate,
java.lang.String value)
Adds a property to this individual with the specified value. |
SSWAPProperty |
addProperty(SSWAPPredicate predicate,
java.lang.String value,
java.net.URI datatype)
Adds a property to this individual with the specified literal value with the specified datatype. |
void |
addType(SSWAPType type)
Adds a new declared type to the individual |
void |
clearProperty(SSWAPPredicate predicate)
Removes all property instances of the specified predicate. |
SSWAPType |
getDeclaredType()
Gets a single type for this individual that summarizes all the declared types. |
java.util.Collection<SSWAPType> |
getDeclaredTypes()
Gets all declared types of the individual. |
SSWAPIndividual |
getInferredIndividual()
Retrieves an inferred view (a copy) of the individual. |
java.util.Collection<SSWAPProperty> |
getProperties()
Gets all the properties for this individual. |
java.util.Collection<SSWAPProperty> |
getProperties(SSWAPPredicate predicate)
Gets all the properties (and their values) for the predicate |
SSWAPProperty |
getProperty(SSWAPPredicate predicate)
Gets the property by its Predicate. |
SSWAPType |
getType()
Gets a single type for this individual that summarizes all the types for this individual (both explicitly declared and inferred). |
java.util.Collection<SSWAPType> |
getTypes()
Gets all types for this individual (including both explicitly declared types and inferred types). |
java.util.Collection<SSWAPProperty> |
hasValue(SSWAPElement element)
Retrieves all properties of the individual with the specified value (regardless of the predicate of these properties) |
boolean |
hasValue(SSWAPPredicate predicate,
SSWAPElement element)
Checks whether the individual has a property with the specified value for the predicate. |
boolean |
isAnonymous()
Checks whether this node is a blank node (i.e., it does not have its own URI, but rather it is represented by a blank node in the RDF). |
boolean |
isCompatibleWith(SSWAPType type)
Checks whether this individual is compatible with the argument type; i.e., if the individual is asserted to be of this type (e.g., via addType(SSWAPType) method), would the ontology remain consistent or become inconsistent? |
boolean |
isOfType(SSWAPType type)
Checks whether this individual is of a given type. |
void |
removeProperty(SSWAPPredicate predicate,
SSWAPElement value)
Removes a single property from this individual (property is identified by the predicate and the value) |
void |
removeProperty(SSWAPProperty property)
Removes a single property instance from this individual (identified by the specified SSWAPProperty instance). |
void |
removeType(SSWAPType type)
Removes a type from the individual. |
SSWAPProperty |
setProperty(SSWAPPredicate predicate,
SSWAPIndividual individual)
Sets the value of the property to the individual. |
SSWAPProperty |
setProperty(SSWAPPredicate predicate,
SSWAPLiteral literal)
Sets the value of the property to the literal object. |
SSWAPProperty |
setProperty(SSWAPPredicate predicate,
java.lang.String value)
Sets the value of the property to the specified value. |
SSWAPProperty |
setProperty(SSWAPPredicate predicate,
java.lang.String value,
java.net.URI datatype)
Sets the value of the property to the specified value and datatype URI. |
Methods inherited from interface info.sswap.api.model.SSWAPElement |
---|
addComment, addLabel, asBoolean, asDouble, asIndividual, asInteger, asList, asLiteral, asString, getComment, getLabel, isIndividual, isList, isLiteral |
Methods inherited from interface info.sswap.api.model.SSWAPModel |
---|
addImport, checkProfile, dereference, dereference, doClosure, getDocument, getImports, getInputStream, getNsPrefixMap, getReasoningService, getTypeSignature, getURI, isDereferenced, removeImport, removeNsPrefix, serialize, serialize, setNsPrefix, validate |
Method Detail |
---|
boolean isAnonymous()
java.util.Collection<SSWAPType> getDeclaredTypes()
SSWAPType getDeclaredType()
java.util.Collection<SSWAPType> getTypes()
SSWAPType getType()
void addType(SSWAPType type)
type
- the type to be addedvoid removeType(SSWAPType type)
type
- the type to be removed.java.util.Collection<SSWAPProperty> getProperties()
SSWAPProperty getProperty(SSWAPPredicate predicate)
predicate
- the predicate for which property should be retrieved
java.util.Collection<SSWAPProperty> getProperties(SSWAPPredicate predicate)
predicate
- the predicate for which the properties should be retrieved
void removeProperty(SSWAPProperty property)
property
- property and its value to be removedremoveProperty(SSWAPPredicate, SSWAPElement)
,
clearProperty(SSWAPPredicate)
void removeProperty(SSWAPPredicate predicate, SSWAPElement value)
predicate
- the predicate for the property to be removedvalue
- the value for the property to be removedvoid clearProperty(SSWAPPredicate predicate)
predicate
- the predicate whose all values should be removedremoveProperty(SSWAPProperty)
boolean isOfType(SSWAPType type)
type
- the type to be checked
boolean isCompatibleWith(SSWAPType type)
type
- type whose compatibility with this individual should be
checked
SSWAPProperty addProperty(SSWAPPredicate predicate, SSWAPIndividual individual) throws java.lang.IllegalArgumentException
predicate
- the predicate for the added propertyindividual
- the value for the property
java.lang.IllegalArgumentException
- if the individual is not legal for the predicate (e.g., an
object for a datatype property)SSWAPProperty addProperty(SSWAPPredicate predicate, java.lang.String value) throws java.lang.IllegalArgumentException
rdfs:range
, the system will tag
the value with the appropriate datatype.
predicate
- the predicate for the added propertyvalue
- the literal value for the property
java.lang.IllegalArgumentException
- if the value is not legal for the predicate (e.g., a literal
for an object property)SSWAPProperty addProperty(SSWAPPredicate predicate, java.lang.String value, java.net.URI datatype) throws java.lang.IllegalArgumentException
predicate
- the predicate for the added propertyvalue
- the literal value for the propertydatatype
- URI for typing the literal value (e.g.,
SSWAPDatatype.XSD.anyURI
)
java.lang.IllegalArgumentException
- if the value or datatype is not legal for the predicate
(e.g., a literal for an object property)SSWAPProperty addProperty(SSWAPPredicate predicate, SSWAPLiteral literal) throws java.lang.IllegalArgumentException
predicate
- the predicate for the added propertyliteral
- the literal value for the property
java.lang.IllegalArgumentException
- if the literal is not legal for the predicate (e.g., a
literal for an object property)SSWAPProperty setProperty(SSWAPPredicate predicate, SSWAPIndividual individual) throws java.lang.IllegalArgumentException
predicate
- the predicate for the added propertyindividual
- the individual
java.lang.IllegalArgumentException
- if the individual is not legal for the predicate (e.g., an
object for a datatype property)SSWAPProperty setProperty(SSWAPPredicate predicate, java.lang.String value) throws java.lang.IllegalArgumentException
rdfs:range
, the
system will tag the value with the appropriate datatype.
predicate
- the predicate for the added propertyvalue
- the literal value
java.lang.IllegalArgumentException
- if the value is not legal for the predicate (e.g., a literal
for an object property)SSWAPProperty setProperty(SSWAPPredicate predicate, java.lang.String value, java.net.URI datatype) throws java.lang.IllegalArgumentException
predicate
- the predicate for the added propertyvalue
- the literal valuedatatype
- URI for typing the literal value (e.g.,
SSWAPDatatype.XSD.anyURI
)
java.lang.IllegalArgumentException
- if the value or datatype is not legal for the predicate
(e.g., a literal for an object property)SSWAPProperty setProperty(SSWAPPredicate predicate, SSWAPLiteral literal) throws java.lang.IllegalArgumentException
predicate
- the predicate for the added propertyliteral
- value for the property
java.lang.IllegalArgumentException
- if the literal is not legal for the predicate (e.g., a
literal for an object property)boolean hasValue(SSWAPPredicate predicate, SSWAPElement element)
predicate
- the predicate for the propertyelement
- the value for the property
java.util.Collection<SSWAPProperty> hasValue(SSWAPElement element)
element
- the value for properties to be returned
SSWAPIndividual getInferredIndividual()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |