EntityDocument, StatementDocument, TermedDocumentJacksonTermedStatementDocument, TermedStatementDocumentImplpublic abstract class AbstractTermedStatementDocument extends java.lang.Object implements TermedDocument, StatementDocument
TermedDocument and
StatementDocument. It does not store any data, but it implements the
required find methods that access the data. Specific implementations can
overwrite some find methods with more efficient solutions based on internal
data structures.| Constructor | Description |
|---|---|
AbstractTermedStatementDocument() |
| Modifier and Type | Method | Description |
|---|---|---|
protected <T extends Value> |
castValue(Value value,
java.lang.Class<T> valueClass) |
Casts the given value to the given class if possible, or returns null if
not.
|
protected boolean |
containsStatementValue(StatementGroup statementGroup,
java.util.Set<? extends Value> values) |
Returns true if the given statement group contains a statement with one
of the given values.
|
java.lang.String |
findDescription(java.lang.String languageCode) |
Returns the string description for the given language code, or null if
there is no description for this code.
|
java.lang.String |
findLabel(java.lang.String languageCode) |
Returns the string label for the given language code, or null if there is
no label for this code.
|
Statement |
findStatement(java.lang.String propertyId) |
Returns the unique
Statement for the given property, or null if
there are zero or many statements for this property. |
Statement |
findStatement(PropertyIdValue propertyIdValue) |
Returns the unique
Statement for the given property, or null if
there are zero or many statements for this property. |
DatatypeIdValue |
findStatementDatatypeIdValue(java.lang.String propertyId) |
Returns the unique
DatatypeIdValue for the given property, or
null if there are zero or many such values given in statements for this
property. |
DatatypeIdValue |
findStatementDatatypeIdValue(PropertyIdValue propertyIdValue) |
Returns the unique
DatatypeIdValue for the given property, or
null if there are zero or many such values given in statements for this
property. |
EntityIdValue |
findStatementEntityIdValue(java.lang.String propertyId) |
Returns the unique
EntityIdValue for the given property, or null
if there are zero or many such values given in statements for this
property. |
EntityIdValue |
findStatementEntityIdValue(PropertyIdValue propertyIdValue) |
Returns the unique
EntityIdValue for the given property, or null
if there are zero or many such values given in statements for this
property. |
GlobeCoordinatesValue |
findStatementGlobeCoordinatesValue(java.lang.String propertyId) |
Returns the unique
GlobeCoordinatesValue for the given property,
or null if there are zero or many such values given in statements for
this property. |
GlobeCoordinatesValue |
findStatementGlobeCoordinatesValue(PropertyIdValue propertyIdValue) |
Returns the unique
GlobeCoordinatesValue for the given property,
or null if there are zero or many such values given in statements for
this property. |
StatementGroup |
findStatementGroup(java.lang.String propertyId) |
Returns the
StatementGroup for the given property, or null if
there are no statements for this property. |
StatementGroup |
findStatementGroup(PropertyIdValue propertyIdValue) |
Returns the
StatementGroup for the given property, or null if
there are no statements for this property. |
ItemIdValue |
findStatementItemIdValue(java.lang.String propertyId) |
Returns the unique
ItemIdValue for the given property, or null if
there are zero or many such values given in statements for this property. |
ItemIdValue |
findStatementItemIdValue(PropertyIdValue propertyIdValue) |
Returns the unique
ItemIdValue for the given property, or null if
there are zero or many such values given in statements for this property. |
MonolingualTextValue |
findStatementMonolingualTextValue(java.lang.String propertyId) |
Returns the unique
MonolingualTextValue for the given property,
or null if there are zero or many such values given in statements for
this property. |
MonolingualTextValue |
findStatementMonolingualTextValue(PropertyIdValue propertyIdValue) |
Returns the unique
MonolingualTextValue for the given property,
or null if there are zero or many such values given in statements for
this property. |
PropertyIdValue |
findStatementPropertyIdValue(java.lang.String propertyId) |
Returns the unique
PropertyIdValue for the given property, or
null if there are zero or many such values given in statements for this
property. |
PropertyIdValue |
findStatementPropertyIdValue(PropertyIdValue propertyIdValue) |
Returns the unique
PropertyIdValue for the given property, or
null if there are zero or many such values given in statements for this
property. |
QuantityValue |
findStatementQuantityValue(java.lang.String propertyId) |
Returns the unique
QuantityValue for the given property, or null
if there are zero or many such values given in statements for this
property. |
QuantityValue |
findStatementQuantityValue(PropertyIdValue propertyIdValue) |
Returns the unique
QuantityValue for the given property, or null
if there are zero or many such values given in statements for this
property. |
StringValue |
findStatementStringValue(java.lang.String propertyId) |
Returns the unique
StringValue for the given property, or null if
there are zero or many such values given in statements for this property. |
StringValue |
findStatementStringValue(PropertyIdValue propertyIdValue) |
Returns the unique
StringValue for the given property, or null if
there are zero or many such values given in statements for this property. |
TimeValue |
findStatementTimeValue(java.lang.String propertyId) |
Returns the unique
TimeValue for the given property, or null if
there are zero or many such values given in statements for this property. |
TimeValue |
findStatementTimeValue(PropertyIdValue propertyIdValue) |
Returns the unique
TimeValue for the given property, or null if
there are zero or many such values given in statements for this property. |
Value |
findStatementValue(java.lang.String propertyId) |
Returns the unique
Value for the given property, or null if there
are zero or many values given in statements for this property. |
Value |
findStatementValue(PropertyIdValue propertyIdValue) |
Returns the unique
Value for the given property, or null if there
are zero or many values given in statements for this property. |
java.util.Iterator<Statement> |
getAllStatements() |
Returns an iterator that provides access to all statements, without
considering the statement groups.
|
protected Statement |
getUniqueStatementFromStatementGroup(StatementGroup statementGroup) |
Returns the unique statement in a statement group, or null if there are
zero or more statements.
|
protected Value |
getValueFromStatement(Statement statement) |
|
boolean |
hasStatement(java.lang.String propertyId) |
Returns true if there is a statement for the given property.
|
boolean |
hasStatement(PropertyIdValue propertyIdValue) |
Returns true if there is a statement for the given property.
|
boolean |
hasStatementValue(java.lang.String propertyId,
java.util.Set<? extends Value> values) |
Returns true if there is a statement for the given property and one of
the given values.
|
boolean |
hasStatementValue(java.lang.String propertyId,
Value value) |
Returns true if there is a statement for the given property and value.
|
boolean |
hasStatementValue(PropertyIdValue propertyIdValue,
java.util.Set<? extends Value> values) |
Returns true if there is a statement for the given property and one of
the given values.
|
boolean |
hasStatementValue(PropertyIdValue propertyIdValue,
Value value) |
Returns true if there is a statement for the given property and value.
|
getEntityId, getRevisionIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetStatementGroupsgetAliases, getDescriptions, getLabelspublic java.lang.String findLabel(java.lang.String languageCode)
TermedDocumentTermedDocument.getLabels().findLabel in interface TermedDocumentlanguageCode - a string that represents languagepublic java.lang.String findDescription(java.lang.String languageCode)
TermedDocumentTermedDocument.getDescriptions().findDescription in interface TermedDocumentlanguageCode - a string that represents languagepublic java.util.Iterator<Statement> getAllStatements()
StatementDocumentgetAllStatements in interface StatementDocumentpublic StatementGroup findStatementGroup(PropertyIdValue propertyIdValue)
StatementDocumentStatementGroup 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 via
StatementDocument.getStatementGroups().findStatementGroup in interface StatementDocumentpropertyIdValue - the property to search forStatementGroup or nullpublic StatementGroup findStatementGroup(java.lang.String propertyId)
StatementDocumentStatementGroup 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 StatementDocument.getStatementGroups().
findStatementGroup in interface StatementDocumentpropertyId - the property to search forStatementGroup or nullpublic boolean hasStatement(PropertyIdValue propertyIdValue)
StatementDocumentStatementDocument.getStatementGroups().hasStatement in interface StatementDocumentpropertyIdValue - the property to search forpublic boolean hasStatement(java.lang.String propertyId)
StatementDocument
This is a convenience method for accessing the data that can be obtained
via StatementDocument.getStatementGroups().
hasStatement in interface StatementDocumentpropertyId - the property to search forpublic boolean hasStatementValue(PropertyIdValue propertyIdValue, Value value)
StatementDocumentStatementDocument.getStatementGroups().hasStatementValue in interface StatementDocumentpropertyIdValue - the property to search forvalue - the value to searchpublic boolean hasStatementValue(java.lang.String propertyId,
Value value)
StatementDocument
This is a convenience method for accessing the data that can be obtained
via StatementDocument.getStatementGroups().
hasStatementValue in interface StatementDocumentpropertyId - the property to search forvalue - the value to searchpublic boolean hasStatementValue(PropertyIdValue propertyIdValue, java.util.Set<? extends Value> values)
StatementDocumentStatementDocument.getStatementGroups().hasStatementValue in interface StatementDocumentpropertyIdValue - the property to search forvalues - the set of values to searchpublic boolean hasStatementValue(java.lang.String propertyId,
java.util.Set<? extends Value> values)
StatementDocument
This is a convenience method for accessing the data that can be obtained
via StatementDocument.getStatementGroups().
hasStatementValue in interface StatementDocumentpropertyId - the property to search forvalues - the set of values to searchpublic Statement findStatement(PropertyIdValue propertyIdValue)
StatementDocumentStatement 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 via
StatementDocument.getStatementGroups().findStatement in interface StatementDocumentpropertyIdValue - the property to search forStatement or nullpublic Statement findStatement(java.lang.String propertyId)
StatementDocumentStatement 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 StatementDocument.getStatementGroups().
findStatement in interface StatementDocumentpropertyId - the property to search forStatement or nullpublic Value findStatementValue(PropertyIdValue propertyIdValue)
StatementDocumentValue 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 StatementDocument.getStatementGroups().
findStatementValue in interface StatementDocumentpropertyIdValue - the property to search forValue or nullpublic Value findStatementValue(java.lang.String propertyId)
StatementDocumentValue 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 StatementDocument.getStatementGroups().
findStatementValue in interface StatementDocumentpropertyId - the property to search forValue or nullpublic StringValue findStatementStringValue(PropertyIdValue propertyIdValue)
StatementDocumentStringValue 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 StatementDocument.getStatementGroups().
findStatementStringValue in interface StatementDocumentpropertyIdValue - the property to search forStringValue or nullpublic StringValue findStatementStringValue(java.lang.String propertyId)
StatementDocumentStringValue 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 StatementDocument.getStatementGroups().
findStatementStringValue in interface StatementDocumentpropertyId - the property to search forStringValue or nullpublic QuantityValue findStatementQuantityValue(PropertyIdValue propertyIdValue)
StatementDocumentQuantityValue 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 StatementDocument.getStatementGroups().
findStatementQuantityValue in interface StatementDocumentpropertyIdValue - the property to search forQuantityValue or nullpublic QuantityValue findStatementQuantityValue(java.lang.String propertyId)
StatementDocumentQuantityValue 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 StatementDocument.getStatementGroups().
findStatementQuantityValue in interface StatementDocumentpropertyId - the property to search forQuantityValue or nullpublic TimeValue findStatementTimeValue(PropertyIdValue propertyIdValue)
StatementDocumentTimeValue 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 StatementDocument.getStatementGroups().
findStatementTimeValue in interface StatementDocumentpropertyIdValue - the property to search forTimeValue or nullpublic TimeValue findStatementTimeValue(java.lang.String propertyId)
StatementDocumentTimeValue 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 StatementDocument.getStatementGroups().
findStatementTimeValue in interface StatementDocumentpropertyId - the property to search forTimeValue or nullpublic MonolingualTextValue findStatementMonolingualTextValue(PropertyIdValue propertyIdValue)
StatementDocumentMonolingualTextValue 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 StatementDocument.getStatementGroups().
findStatementMonolingualTextValue in interface StatementDocumentpropertyIdValue - the property to search forMonolingualTextValue or nullpublic MonolingualTextValue findStatementMonolingualTextValue(java.lang.String propertyId)
StatementDocumentMonolingualTextValue 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 StatementDocument.getStatementGroups().
findStatementMonolingualTextValue in interface StatementDocumentpropertyId - the property to search forMonolingualTextValue or nullpublic ItemIdValue findStatementItemIdValue(PropertyIdValue propertyIdValue)
StatementDocumentItemIdValue 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 StatementDocument.getStatementGroups().
findStatementItemIdValue in interface StatementDocumentpropertyIdValue - the property to search forItemIdValue or nullpublic ItemIdValue findStatementItemIdValue(java.lang.String propertyId)
StatementDocumentItemIdValue 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 StatementDocument.getStatementGroups().
findStatementItemIdValue in interface StatementDocumentpropertyId - the property to search forItemIdValue or nullpublic PropertyIdValue findStatementPropertyIdValue(PropertyIdValue propertyIdValue)
StatementDocumentPropertyIdValue 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 StatementDocument.getStatementGroups().
findStatementPropertyIdValue in interface StatementDocumentpropertyIdValue - the property to search forPropertyIdValue or nullpublic PropertyIdValue findStatementPropertyIdValue(java.lang.String propertyId)
StatementDocumentPropertyIdValue 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 StatementDocument.getStatementGroups().
findStatementPropertyIdValue in interface StatementDocumentpropertyId - the property to search forPropertyIdValue or nullpublic EntityIdValue findStatementEntityIdValue(PropertyIdValue propertyIdValue)
StatementDocumentEntityIdValue 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 StatementDocument.getStatementGroups().
findStatementEntityIdValue in interface StatementDocumentpropertyIdValue - the property to search forEntityIdValue or nullpublic EntityIdValue findStatementEntityIdValue(java.lang.String propertyId)
StatementDocumentEntityIdValue 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 StatementDocument.getStatementGroups().
findStatementEntityIdValue in interface StatementDocumentpropertyId - the property to search forEntityIdValue or nullpublic DatatypeIdValue findStatementDatatypeIdValue(PropertyIdValue propertyIdValue)
StatementDocumentDatatypeIdValue 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 StatementDocument.getStatementGroups().
findStatementDatatypeIdValue in interface StatementDocumentpropertyIdValue - the property to search forDatatypeIdValue or nullpublic DatatypeIdValue findStatementDatatypeIdValue(java.lang.String propertyId)
StatementDocumentDatatypeIdValue 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 StatementDocument.getStatementGroups().
findStatementDatatypeIdValue in interface StatementDocumentpropertyId - the property to search forDatatypeIdValue or nullpublic GlobeCoordinatesValue findStatementGlobeCoordinatesValue(PropertyIdValue propertyIdValue)
StatementDocumentGlobeCoordinatesValue 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 StatementDocument.getStatementGroups().
findStatementGlobeCoordinatesValue in interface StatementDocumentpropertyIdValue - the property to search forGlobeCoordinatesValue or nullpublic GlobeCoordinatesValue findStatementGlobeCoordinatesValue(java.lang.String propertyId)
StatementDocumentGlobeCoordinatesValue 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 StatementDocument.getStatementGroups().
findStatementGlobeCoordinatesValue in interface StatementDocumentpropertyId - the property to search forGlobeCoordinatesValue or nullprotected boolean containsStatementValue(StatementGroup statementGroup, java.util.Set<? extends Value> values)
statementGroup - the group of statements to searchvalues - set of acceptable valuesprotected Statement getUniqueStatementFromStatementGroup(StatementGroup statementGroup)
statementGroup - the statement group or nullprotected Value getValueFromStatement(Statement statement)
Value of the given Statement, provided that
the statements actually has a value. Otherwise null is returned.statement - the statement to processCopyright © 2014–2017 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage