Interface StatementDocument
- All Superinterfaces:
EntityDocument
- All Known Subinterfaces:
FormDocument
,ItemDocument
,LabeledStatementDocument
,LexemeDocument
,MediaInfoDocument
,PropertyDocument
,SenseDocument
,TermedStatementDocument
- All Known Implementing Classes:
FormDocumentImpl
,ItemDocumentImpl
,LexemeDocumentImpl
,MediaInfoDocumentImpl
,PropertyDocumentImpl
,SenseDocumentImpl
,TermedStatementDocumentImpl
- Author:
- Markus Kroetzsch
-
Method Summary
Modifier and TypeMethodDescriptiondefault Statement
findStatement
(String propertyId) Returns the uniqueStatement
for the given property, or null if there are zero or many statements for this property.default Statement
findStatement
(PropertyIdValue propertyIdValue) Returns the uniqueStatement
for the given property, or null if there are zero or many statements for this property.default EntityIdValue
findStatementEntityIdValue
(String propertyId) Returns the uniqueEntityIdValue
for the given property, or null if there are zero or many such values given in statements for this property.default EntityIdValue
findStatementEntityIdValue
(PropertyIdValue propertyIdValue) Returns the uniqueEntityIdValue
for the given property, or null if there are zero or many such values given in statements for this property.default GlobeCoordinatesValue
findStatementGlobeCoordinatesValue
(String propertyId) Returns the uniqueGlobeCoordinatesValue
for the given property, or null if there are zero or many such values given in statements for this property.default GlobeCoordinatesValue
findStatementGlobeCoordinatesValue
(PropertyIdValue propertyIdValue) Returns the uniqueGlobeCoordinatesValue
for the given property, or null if there are zero or many such values given in statements for this property.default StatementGroup
findStatementGroup
(String propertyId) Returns theStatementGroup
for the given property, or null if there are no statements for this property.default StatementGroup
findStatementGroup
(PropertyIdValue propertyIdValue) Returns theStatementGroup
for the given property, or null if there are no statements for this property.default ItemIdValue
findStatementItemIdValue
(String propertyId) Returns the uniqueItemIdValue
for the given property, or null if there are zero or many such values given in statements for this property.default ItemIdValue
findStatementItemIdValue
(PropertyIdValue propertyIdValue) Returns the uniqueItemIdValue
for the given property, or null if there are zero or many such values given in statements for this property.default MonolingualTextValue
findStatementMonolingualTextValue
(String propertyId) Returns the uniqueMonolingualTextValue
for the given property, or null if there are zero or many such values given in statements for this property.default MonolingualTextValue
findStatementMonolingualTextValue
(PropertyIdValue propertyIdValue) Returns the uniqueMonolingualTextValue
for the given property, or null if there are zero or many such values given in statements for this property.default PropertyIdValue
findStatementPropertyIdValue
(String propertyId) Returns the uniquePropertyIdValue
for the given property, or null if there are zero or many such values given in statements for this property.default PropertyIdValue
findStatementPropertyIdValue
(PropertyIdValue propertyIdValue) Returns the uniquePropertyIdValue
for the given property, or null if there are zero or many such values given in statements for this property.default QuantityValue
findStatementQuantityValue
(String propertyId) Returns the uniqueQuantityValue
for the given property, or null if there are zero or many such values given in statements for this property.default QuantityValue
findStatementQuantityValue
(PropertyIdValue propertyIdValue) Returns the uniqueQuantityValue
for the given property, or null if there are zero or many such values given in statements for this property.default StringValue
findStatementStringValue
(String propertyId) Returns the uniqueStringValue
for the given property, or null if there are zero or many such values given in statements for this property.default StringValue
findStatementStringValue
(PropertyIdValue propertyIdValue) Returns the uniqueStringValue
for the given property, or null if there are zero or many such values given in statements for this property.default TimeValue
findStatementTimeValue
(String propertyId) Returns the uniqueTimeValue
for the given property, or null if there are zero or many such values given in statements for this property.default TimeValue
findStatementTimeValue
(PropertyIdValue propertyIdValue) Returns the uniqueTimeValue
for the given property, or null if there are zero or many such values given in statements for this property.default Value
findStatementValue
(String propertyId) Returns the uniqueValue
for the given property, or null if there are zero or many values given in statements for this property.default Value
findStatementValue
(PropertyIdValue propertyIdValue) Returns the uniqueValue
for the given property, or null if there are zero or many values given in statements for this property.Returns an iterator that provides access to all statements, without considering the statement groups.Return the list of all StatementGroups stored for this item.default boolean
hasStatement
(String propertyId) Returns true if there is a statement for the given property.default boolean
hasStatement
(PropertyIdValue propertyIdValue) Returns true if there is a statement for the given property.default boolean
hasStatementValue
(String propertyId, Set<? extends Value> values) Returns true if there is a statement for the given property and one of the given values.default boolean
hasStatementValue
(String propertyId, Value value) Returns true if there is a statement for the given property and value.default boolean
hasStatementValue
(PropertyIdValue propertyIdValue, Set<? extends Value> values) Returns true if there is a statement for the given property and one of the given values.default boolean
hasStatementValue
(PropertyIdValue propertyIdValue, Value value) Returns true if there is a statement for the given property and value.withoutStatementIds
(Set<String> statementIds) Returns a new version of this document where all statements matching any of the statement ids provided have been removed.withRevisionId
(long newRevisionId) Returns a copy of this document with an updated revision id.withStatement
(Statement statement) Returns a new version of this document which includes the statement provided.Methods inherited from interface org.wikidata.wdtk.datamodel.interfaces.EntityDocument
getEntityId, getRevisionId
-
Method Details
-
getStatementGroups
List<StatementGroup> getStatementGroups()Return the list of all StatementGroups stored for this item. The order of StatementGroups is significant.- Returns:
- list of StatementGroups
-
getAllStatements
Returns an iterator that provides access to all statements, without considering the statement groups. The order of statements is preserved.- Returns:
- iterator over all statements
-
findStatementGroup
Returns theStatementGroup
for the given property, or null if there are no statements for this property. This is a convenience method for accessing the data that can be obtained viagetStatementGroups()
.- Parameters:
propertyIdValue
- the property to search for- Returns:
StatementGroup
or null
-
findStatementGroup
Returns theStatementGroup
for the given property, or null if there are no statements for this property. Only the string id of the property is compared, not the site id. This is useful in situations where all data is known to come from a single site.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyId
- the property to search for- Returns:
StatementGroup
or null
-
hasStatement
Returns true if there is a statement for the given property. This is a convenience method for accessing the data that can be obtained viagetStatementGroups()
.- Parameters:
propertyIdValue
- the property to search for- Returns:
- true if a statement for this property exists
-
hasStatement
Returns true if there is a statement for the given property. Only the string id of the property is compared, not the site id. This is useful in situations where all data is known to come from a single site.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyId
- the property to search for- Returns:
- true if a statement for this property exists
-
hasStatementValue
Returns true if there is a statement for the given property and value. This is a convenience method for accessing the data that can be obtained viagetStatementGroups()
.- Parameters:
propertyIdValue
- the property to search forvalue
- the value to search- Returns:
- true if a statement for this property and value exists
-
hasStatementValue
Returns true if there is a statement for the given property and value. Only the string id of the property is compared, not the site id. This is useful in situations where all data is known to come from a single site.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyId
- the property to search forvalue
- the value to search- Returns:
- true if a statement for this property and value exists
-
hasStatementValue
Returns true if there is a statement for the given property and one of the given values. This is a convenience method for accessing the data that can be obtained viagetStatementGroups()
.- Parameters:
propertyIdValue
- the property to search forvalues
- the set of values to search- Returns:
- true if a statement for this property and value exists
-
hasStatementValue
Returns true if there is a statement for the given property and one of the given values. Only the string id of the property is compared, not the site id. This is useful in situations where all data is known to come from a single site.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyId
- the property to search forvalues
- the set of values to search- Returns:
- true if a statement for this property and value exists
-
findStatement
Returns the uniqueStatement
for the given property, or null if there are zero or many statements for this property. This is a convenience method for accessing the data that can be obtained viagetStatementGroups()
.- Parameters:
propertyIdValue
- the property to search for- Returns:
Statement
or null
-
findStatement
Returns the uniqueStatement
for the given property, or null if there are zero or many statements for this property. Only the string id of the property is compared, not the site id. This is useful in situations where all data is known to come from a single site.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyId
- the property to search for- Returns:
Statement
or null
-
findStatementValue
Returns the uniqueValue
for the given property, or null if there are zero or many values given in statements for this property.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyIdValue
- the property to search for- Returns:
Value
or null
-
findStatementValue
Returns the uniqueValue
for the given property, or null if there are zero or many values given in statements for this property. Only the string id of the property is compared, not the site id. This is useful in situations where all data is known to come from a single site.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyId
- the property to search for- Returns:
Value
or null
-
findStatementStringValue
Returns the uniqueStringValue
for the given property, or null if there are zero or many such values given in statements for this property.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyIdValue
- the property to search for- Returns:
StringValue
or null
-
findStatementStringValue
Returns the uniqueStringValue
for the given property, or null if there are zero or many such values given in statements for this property. Only the string id of the property is compared, not the site id. This is useful in situations where all data is known to come from a single site.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyId
- the property to search for- Returns:
StringValue
or null
-
findStatementQuantityValue
Returns the uniqueQuantityValue
for the given property, or null if there are zero or many such values given in statements for this property.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyIdValue
- the property to search for- Returns:
QuantityValue
or null
-
findStatementQuantityValue
Returns the uniqueQuantityValue
for the given property, or null if there are zero or many such values given in statements for this property. Only the string id of the property is compared, not the site id. This is useful in situations where all data is known to come from a single site.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyId
- the property to search for- Returns:
QuantityValue
or null
-
findStatementGlobeCoordinatesValue
Returns the uniqueGlobeCoordinatesValue
for the given property, or null if there are zero or many such values given in statements for this property.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyIdValue
- the property to search for- Returns:
GlobeCoordinatesValue
or null
-
findStatementGlobeCoordinatesValue
Returns the uniqueGlobeCoordinatesValue
for the given property, or null if there are zero or many such values given in statements for this property. Only the string id of the property is compared, not the site id. This is useful in situations where all data is known to come from a single site.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyId
- the property to search for- Returns:
GlobeCoordinatesValue
or null
-
findStatementTimeValue
Returns the uniqueTimeValue
for the given property, or null if there are zero or many such values given in statements for this property.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyIdValue
- the property to search for- Returns:
TimeValue
or null
-
findStatementTimeValue
Returns the uniqueTimeValue
for the given property, or null if there are zero or many such values given in statements for this property. Only the string id of the property is compared, not the site id. This is useful in situations where all data is known to come from a single site.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyId
- the property to search for- Returns:
TimeValue
or null
-
findStatementMonolingualTextValue
Returns the uniqueMonolingualTextValue
for the given property, or null if there are zero or many such values given in statements for this property.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyIdValue
- the property to search for- Returns:
MonolingualTextValue
or null
-
findStatementMonolingualTextValue
Returns the uniqueMonolingualTextValue
for the given property, or null if there are zero or many such values given in statements for this property. Only the string id of the property is compared, not the site id. This is useful in situations where all data is known to come from a single site.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyId
- the property to search for- Returns:
MonolingualTextValue
or null
-
findStatementItemIdValue
Returns the uniqueItemIdValue
for the given property, or null if there are zero or many such values given in statements for this property.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyIdValue
- the property to search for- Returns:
ItemIdValue
or null
-
findStatementItemIdValue
Returns the uniqueItemIdValue
for the given property, or null if there are zero or many such values given in statements for this property. Only the string id of the property is compared, not the site id. This is useful in situations where all data is known to come from a single site.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyId
- the property to search for- Returns:
ItemIdValue
or null
-
findStatementPropertyIdValue
Returns the uniquePropertyIdValue
for the given property, or null if there are zero or many such values given in statements for this property.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyIdValue
- the property to search for- Returns:
PropertyIdValue
or null
-
findStatementPropertyIdValue
Returns the uniquePropertyIdValue
for the given property, or null if there are zero or many such values given in statements for this property. Only the string id of the property is compared, not the site id. This is useful in situations where all data is known to come from a single site.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyId
- the property to search for- Returns:
PropertyIdValue
or null
-
findStatementEntityIdValue
Returns the uniqueEntityIdValue
for the given property, or null if there are zero or many such values given in statements for this property.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyIdValue
- the property to search for- Returns:
EntityIdValue
or null
-
findStatementEntityIdValue
Returns the uniqueEntityIdValue
for the given property, or null if there are zero or many such values given in statements for this property. Only the string id of the property is compared, not the site id. This is useful in situations where all data is known to come from a single site.This is a convenience method for accessing the data that can be obtained via
getStatementGroups()
.- Parameters:
propertyId
- the property to search for- Returns:
EntityIdValue
or null
-
withRevisionId
Returns a copy of this document with an updated revision id.- Specified by:
withRevisionId
in interfaceEntityDocument
-
withStatement
Returns a new version of this document which includes the statement provided. If the identifier of this statement matches that of any other statement for the same property, then the existing statement will be replaced by the new one. Otherwise, the new statement will be added at the end of the list of statements in this group.- Parameters:
statement
- the statement to add or update in the document
-
withoutStatementIds
Returns a new version of this document where all statements matching any of the statement ids provided have been removed. These statements can use different properties.- Parameters:
statementIds
- the identifiers of the statements to remove
-