Class Assertion
- All Implemented Interfaces:
Serializable
Defines just whether the assertion uses inferred values and existing types of assertions.
The usage of types may seem as not being very object-oriented, but since the hierarchy is fixed (there aren't any other kinds of assertions in ontologies) and since the subclasses essentially don't contain any behavior, we can use this way.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AssertioncreateAnnotationPropertyAssertion(URI assertionIdentifier, boolean isInferred) Creates new annotation property assertion.static AssertioncreateAnnotationPropertyAssertion(URI assertionIdentifier, String language, boolean isInferred) Creates new annotation property assertion.static AssertioncreateClassAssertion(boolean isInferred) Creates new class assertion.static AssertioncreateDataPropertyAssertion(URI assertionIdentifier, boolean isInferred) Creates new data property assertion.static AssertioncreateDataPropertyAssertion(URI assertionIdentifier, String language, boolean isInferred) Creates new data property assertion.static AssertioncreateObjectPropertyAssertion(URI assertionIdentifier, boolean isInferred) Creates new object property assertion.static AssertioncreatePropertyAssertion(URI assertionIdentifier, boolean isInferred) Creates new property assertion without specifying what kind of property it is.static AssertioncreatePropertyAssertion(URI assertionIdentifier, String language, boolean isInferred) Creates new property assertion without specifying what kind of property it is.static AssertioncreateUnspecifiedPropertyAssertion(boolean isInferred) Creates a property assertion without specifying the assertion identifier.static AssertioncreateUnspecifiedPropertyAssertion(String language, boolean isInferred) Creates a property assertion without specifying the assertion identifier.booleanGets the language tag carried by this assertion.abstract Assertion.AssertionTypegetType()Gets type of this assertion.inthashCode()booleanChecks whether a language tag was set for this assertion.booleanWhether this assertion is a class assertion.booleanWhether this assertion is based on inferred values.toString()Methods inherited from class cz.cvut.kbss.ontodriver.model.NamedResource
create, create, getIdentifier
-
Field Details
-
language
-
-
Constructor Details
-
Assertion
-
Assertion
-
-
Method Details
-
isInferred
public boolean isInferred()Whether this assertion is based on inferred values.- Returns:
- True if inferred, false otherwise
-
isClassAssertion
public boolean isClassAssertion()Whether this assertion is a class assertion.This is a convenience method, its functionality could be emulated by retrieving this assertion's identifier and checking whether it equals to the rdf:type URI.
- Returns:
- True if this assertion is a class assertion, false otherwise.
-
getType
Gets type of this assertion.- Returns:
- Assertion type
-
getLanguage
Gets the language tag carried by this assertion.The language tag applies only to string-based literals.
- Returns:
- Language tag, e.g.
en, can benull
-
hasLanguage
public boolean hasLanguage()Checks whether a language tag was set for this assertion.- Returns:
trueif a language tag was set,falseotherwise
-
equals
- Overrides:
equalsin classNamedResource
-
hashCode
public int hashCode()- Overrides:
hashCodein classNamedResource
-
toString
- Overrides:
toStringin classNamedResource
-
createClassAssertion
Creates new class assertion.Class assertions use the rdf:type identifier.
- Parameters:
isInferred- Whether the assertion uses inferred values- Returns:
- Assertion
-
createUnspecifiedPropertyAssertion
Creates a property assertion without specifying the assertion identifier.Note that the returned instances have the same identifier throughout one JVM - a randomly generated URI.
- Parameters:
isInferred- Whether the assertion uses inferred values- Returns:
- Assertion
-
createUnspecifiedPropertyAssertion
Creates a property assertion without specifying the assertion identifier.Note that the returned instances have the same identifier throughout one JVM - a randomly generated URI.
- Parameters:
language- Language tag, optionalisInferred- Whether the assertion uses inferred values- Returns:
- Assertion
-
createPropertyAssertion
Creates new property assertion without specifying what kind of property it is.- Parameters:
assertionIdentifier- Assertion identifierisInferred- Whether the assertion uses inferred values- Returns:
- Assertion
-
createPropertyAssertion
public static Assertion createPropertyAssertion(URI assertionIdentifier, String language, boolean isInferred) Creates new property assertion without specifying what kind of property it is.- Parameters:
assertionIdentifier- Assertion identifierlanguage- Language tag. Passingnullexplicitly specifies that any language tag is supportedisInferred- Whether the assertion uses inferred values- Returns:
- Assertion
-
createObjectPropertyAssertion
Creates new object property assertion.- Parameters:
assertionIdentifier- Assertion identifierisInferred- Whether the assertion uses inferred values- Returns:
- Assertion
-
createDataPropertyAssertion
Creates new data property assertion.- Parameters:
assertionIdentifier- Assertion identifierisInferred- Whether the assertion uses inferred values- Returns:
- Assertion
-
createDataPropertyAssertion
public static Assertion createDataPropertyAssertion(URI assertionIdentifier, String language, boolean isInferred) Creates new data property assertion.- Parameters:
assertionIdentifier- Assertion identifierlanguage- Language tag. Passingnullexplicitly specifies that any language tag is supportedisInferred- Whether the assertion uses inferred values- Returns:
- Assertion
-
createAnnotationPropertyAssertion
public static Assertion createAnnotationPropertyAssertion(URI assertionIdentifier, boolean isInferred) Creates new annotation property assertion.- Parameters:
assertionIdentifier- Assertion identifierisInferred- Whether the assertion uses inferred values- Returns:
- Assertion
-
createAnnotationPropertyAssertion
public static Assertion createAnnotationPropertyAssertion(URI assertionIdentifier, String language, boolean isInferred) Creates new annotation property assertion.- Parameters:
assertionIdentifier- Assertion identifierlanguage- Language tag. Passingnullexplicitly specifies that any language tag is supportedisInferred- Whether the assertion uses inferred values- Returns:
- Assertion
-