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 StatementfindStatement(String propertyId) Returns the uniqueStatementfor the given property, or null if there are zero or many statements for this property.default StatementfindStatement(PropertyIdValue propertyIdValue) Returns the uniqueStatementfor the given property, or null if there are zero or many statements for this property.default EntityIdValuefindStatementEntityIdValue(String propertyId) Returns the uniqueEntityIdValuefor the given property, or null if there are zero or many such values given in statements for this property.default EntityIdValuefindStatementEntityIdValue(PropertyIdValue propertyIdValue) Returns the uniqueEntityIdValuefor the given property, or null if there are zero or many such values given in statements for this property.default GlobeCoordinatesValuefindStatementGlobeCoordinatesValue(String propertyId) Returns the uniqueGlobeCoordinatesValuefor the given property, or null if there are zero or many such values given in statements for this property.default GlobeCoordinatesValuefindStatementGlobeCoordinatesValue(PropertyIdValue propertyIdValue) Returns the uniqueGlobeCoordinatesValuefor the given property, or null if there are zero or many such values given in statements for this property.default StatementGroupfindStatementGroup(String propertyId) Returns theStatementGroupfor the given property, or null if there are no statements for this property.default StatementGroupfindStatementGroup(PropertyIdValue propertyIdValue) Returns theStatementGroupfor the given property, or null if there are no statements for this property.default ItemIdValuefindStatementItemIdValue(String propertyId) Returns the uniqueItemIdValuefor the given property, or null if there are zero or many such values given in statements for this property.default ItemIdValuefindStatementItemIdValue(PropertyIdValue propertyIdValue) Returns the uniqueItemIdValuefor the given property, or null if there are zero or many such values given in statements for this property.default MonolingualTextValuefindStatementMonolingualTextValue(String propertyId) Returns the uniqueMonolingualTextValuefor the given property, or null if there are zero or many such values given in statements for this property.default MonolingualTextValuefindStatementMonolingualTextValue(PropertyIdValue propertyIdValue) Returns the uniqueMonolingualTextValuefor the given property, or null if there are zero or many such values given in statements for this property.default PropertyIdValuefindStatementPropertyIdValue(String propertyId) Returns the uniquePropertyIdValuefor the given property, or null if there are zero or many such values given in statements for this property.default PropertyIdValuefindStatementPropertyIdValue(PropertyIdValue propertyIdValue) Returns the uniquePropertyIdValuefor the given property, or null if there are zero or many such values given in statements for this property.default QuantityValuefindStatementQuantityValue(String propertyId) Returns the uniqueQuantityValuefor the given property, or null if there are zero or many such values given in statements for this property.default QuantityValuefindStatementQuantityValue(PropertyIdValue propertyIdValue) Returns the uniqueQuantityValuefor the given property, or null if there are zero or many such values given in statements for this property.default StringValuefindStatementStringValue(String propertyId) Returns the uniqueStringValuefor the given property, or null if there are zero or many such values given in statements for this property.default StringValuefindStatementStringValue(PropertyIdValue propertyIdValue) Returns the uniqueStringValuefor the given property, or null if there are zero or many such values given in statements for this property.default TimeValuefindStatementTimeValue(String propertyId) Returns the uniqueTimeValuefor the given property, or null if there are zero or many such values given in statements for this property.default TimeValuefindStatementTimeValue(PropertyIdValue propertyIdValue) Returns the uniqueTimeValuefor the given property, or null if there are zero or many such values given in statements for this property.default ValuefindStatementValue(String propertyId) Returns the uniqueValuefor the given property, or null if there are zero or many values given in statements for this property.default ValuefindStatementValue(PropertyIdValue propertyIdValue) Returns the uniqueValuefor 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 booleanhasStatement(String propertyId) Returns true if there is a statement for the given property.default booleanhasStatement(PropertyIdValue propertyIdValue) Returns true if there is a statement for the given property.default booleanhasStatementValue(String propertyId, Set<? extends Value> values) Returns true if there is a statement for the given property and one of the given values.default booleanhasStatementValue(String propertyId, Value value) Returns true if there is a statement for the given property and value.default booleanhasStatementValue(PropertyIdValue propertyIdValue, Set<? extends Value> values) Returns true if there is a statement for the given property and one of the given values.default booleanhasStatementValue(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 theStatementGroupfor 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:
StatementGroupor null
-
findStatementGroup
Returns theStatementGroupfor 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:
StatementGroupor 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 uniqueStatementfor 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:
Statementor null
-
findStatement
Returns the uniqueStatementfor 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:
Statementor null
-
findStatementValue
Returns the uniqueValuefor 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:
Valueor null
-
findStatementValue
Returns the uniqueValuefor 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:
Valueor null
-
findStatementStringValue
Returns the uniqueStringValuefor 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:
StringValueor null
-
findStatementStringValue
Returns the uniqueStringValuefor 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:
StringValueor null
-
findStatementQuantityValue
Returns the uniqueQuantityValuefor 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:
QuantityValueor null
-
findStatementQuantityValue
Returns the uniqueQuantityValuefor 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:
QuantityValueor null
-
findStatementGlobeCoordinatesValue
Returns the uniqueGlobeCoordinatesValuefor 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:
GlobeCoordinatesValueor null
-
findStatementGlobeCoordinatesValue
Returns the uniqueGlobeCoordinatesValuefor 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:
GlobeCoordinatesValueor null
-
findStatementTimeValue
Returns the uniqueTimeValuefor 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:
TimeValueor null
-
findStatementTimeValue
Returns the uniqueTimeValuefor 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:
TimeValueor null
-
findStatementMonolingualTextValue
Returns the uniqueMonolingualTextValuefor 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:
MonolingualTextValueor null
-
findStatementMonolingualTextValue
Returns the uniqueMonolingualTextValuefor 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:
MonolingualTextValueor null
-
findStatementItemIdValue
Returns the uniqueItemIdValuefor 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:
ItemIdValueor null
-
findStatementItemIdValue
Returns the uniqueItemIdValuefor 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:
ItemIdValueor null
-
findStatementPropertyIdValue
Returns the uniquePropertyIdValuefor 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:
PropertyIdValueor null
-
findStatementPropertyIdValue
Returns the uniquePropertyIdValuefor 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:
PropertyIdValueor null
-
findStatementEntityIdValue
Returns the uniqueEntityIdValuefor 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:
EntityIdValueor null
-
findStatementEntityIdValue
Returns the uniqueEntityIdValuefor 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:
EntityIdValueor null
-
withRevisionId
Returns a copy of this document with an updated revision id.- Specified by:
withRevisionIdin 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
-