public abstract class TermedStatementDocumentImpl extends EntityDocumentImpl implements TermedStatementDocument
TermedDocument and StatementDocument.
You should not rely on it directly but build instances with the Datamodel helper and
use EntityDocumentImpl for deserialization.| Modifier and Type | Field and Description |
|---|---|
protected Map<String,List<MonolingualTextValue>> |
aliases |
protected Map<String,List<Statement>> |
claims
This is what is called claim in the JSON model.
|
protected Map<String,MonolingualTextValue> |
descriptions |
protected Map<String,MonolingualTextValue> |
labels |
entityId, revisionId, siteIri| Modifier | Constructor and Description |
|---|---|
|
TermedStatementDocumentImpl(EntityIdValue id,
List<MonolingualTextValue> labels,
List<MonolingualTextValue> descriptions,
List<MonolingualTextValue> aliases,
List<StatementGroup> claims,
long revisionId)
Constructor.
|
protected |
TermedStatementDocumentImpl(EntityIdValue subject,
Map<String,MonolingualTextValue> labels,
Map<String,MonolingualTextValue> descriptions,
Map<String,List<MonolingualTextValue>> aliases,
Map<String,List<Statement>> claims,
long revisionId)
Protected constructor provided to ease the creation
of copies.
|
| Modifier and Type | Method and Description |
|---|---|
protected static Map<String,List<Statement>> |
addStatementToGroups(Statement statement,
Map<String,List<Statement>> claims)
Adds a Statement to a given collection of statement groups.
|
protected static Map<String,MonolingualTextValue> |
constructTermMap(List<MonolingualTextValue> terms) |
StatementGroup |
findStatementGroup(String propertyIdValue)
Find a statement group by its property id, without checking for
equality with the site IRI.
|
Map<String,List<MonolingualTextValue>> |
getAliases()
Return a Map from Wikibase language codes to lists of alias labels for a
given language.
|
Iterator<Statement> |
getAllStatements()
Returns an iterator that provides access to all statements, without
considering the statement groups.
|
Map<String,MonolingualTextValue> |
getDescriptions()
Return a Map from Wikibase language codes to descriptions.
|
Map<String,List<Statement>> |
getJsonClaims()
Returns the "claims".
|
Map<String,MonolingualTextValue> |
getLabels()
Return a Map from Wikibase language codes to labels.
|
String |
getSiteIri() |
List<StatementGroup> |
getStatementGroups()
Return the list of all StatementGroups stored for this item.
|
protected static Map<String,List<Statement>> |
removeStatements(Set<String> statementIds,
Map<String,List<Statement>> claims)
Removes statement ids from a collection of statement groups.
|
protected static Map<String,List<MonolingualTextValue>> |
withAliases(Map<String,List<MonolingualTextValue>> values,
String language,
List<MonolingualTextValue> aliases) |
protected static Map<String,MonolingualTextValue> |
withTerm(Map<String,MonolingualTextValue> values,
MonolingualTextValue value) |
getJsonId, getRevisionIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwithAliases, withDescription, withLabel, withoutStatementIds, withRevisionId, withStatementfindDescriptionfindLabel, getLabelsfindStatement, findStatement, findStatementEntityIdValue, findStatementEntityIdValue, findStatementGlobeCoordinatesValue, findStatementGlobeCoordinatesValue, findStatementGroup, findStatementGroup, findStatementItemIdValue, findStatementItemIdValue, findStatementMonolingualTextValue, findStatementMonolingualTextValue, findStatementPropertyIdValue, findStatementPropertyIdValue, findStatementQuantityValue, findStatementQuantityValue, findStatementStringValue, findStatementStringValue, findStatementTimeValue, findStatementTimeValue, findStatementValue, findStatementValue, getAllStatements, getStatementGroups, hasStatement, hasStatement, hasStatementValue, hasStatementValue, hasStatementValue, hasStatementValuegetEntityId, getRevisionIdprotected final Map<String,MonolingualTextValue> descriptions
protected final Map<String,List<MonolingualTextValue>> aliases
protected final Map<String,MonolingualTextValue> labels
public TermedStatementDocumentImpl(EntityIdValue id, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, List<StatementGroup> claims, long revisionId)
id - the identifier of the subject of this documentlabels - the labels for this entity, at most one per languagedescriptions - the descriptions for this entity, at most one per languagealiases - the aliases for this language. Their relative order in a
given language will be preserved.claims - the statement groups contained in this documentrevisionId - the id of the last revision of this documentprotected TermedStatementDocumentImpl(EntityIdValue subject, Map<String,MonolingualTextValue> labels, Map<String,MonolingualTextValue> descriptions, Map<String,List<MonolingualTextValue>> aliases, Map<String,List<Statement>> claims, long revisionId)
labels - a map from language codes to monolingual values with
the same language codesdescriptions - a map from language codes to monolingual values with
the same language codesaliases - a map from language codes to lists of monolingual values
with the same language codesclaims - revisionId - public Map<String,List<MonolingualTextValue>> getAliases()
TermedDocumentgetAliases in interface TermedDocumentpublic Map<String,MonolingualTextValue> getDescriptions()
TermedDocumentgetDescriptions in interface TermedDocumentpublic String getSiteIri()
getSiteIri in class EntityDocumentImplprotected static Map<String,List<MonolingualTextValue>> withAliases(Map<String,List<MonolingualTextValue>> values, String language, List<MonolingualTextValue> aliases)
public Map<String,MonolingualTextValue> getLabels()
LabeledDocumentgetLabels in interface LabeledDocumentprotected static Map<String,MonolingualTextValue> constructTermMap(List<MonolingualTextValue> terms)
protected static Map<String,MonolingualTextValue> withTerm(Map<String,MonolingualTextValue> values, MonolingualTextValue value)
public List<StatementGroup> getStatementGroups()
StatementDocumentgetStatementGroups in interface StatementDocumentpublic StatementGroup findStatementGroup(String propertyIdValue)
findStatementGroup in interface StatementDocumentpropertyIdValue - the property to search forStatementGroup or nullpublic Map<String,List<Statement>> getJsonClaims()
JSON "claims" correspond to statement groups in the WDTK model. You
should use StatementDocumentImpl.getStatementGroups() to obtain
this data.
public Iterator<Statement> getAllStatements()
StatementDocumentgetAllStatements in interface StatementDocumentprotected static Map<String,List<Statement>> addStatementToGroups(Statement statement, Map<String,List<Statement>> claims)
statement - claims - Copyright © 2014–2022 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage