public class MediaInfoDocumentImpl extends EntityDocumentImpl implements MediaInfoDocument
MediaInfoDocument.
We serialize back statements in JSON with the "claims" key for compatibility with the other entity types and the wbeditentity API mdodule
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,List<Statement>> |
claims
This is what is called claim in the JSON model.
|
protected Map<String,MonolingualTextValue> |
labels |
entityId, revisionId, siteIri| Modifier | Constructor and Description |
|---|---|
|
MediaInfoDocumentImpl(MediaInfoIdValue id,
List<MonolingualTextValue> labels,
List<StatementGroup> statements,
long revisionId)
Constructor.
|
protected |
MediaInfoDocumentImpl(MediaInfoIdValue subject,
Map<String,MonolingualTextValue> labels,
Map<String,List<Statement>> claims,
long revisionId)
Protected constructor, meant to be used to create modified copies
of instances.
|
|
MediaInfoDocumentImpl(String jsonId,
Map<String,MonolingualTextValue> labels,
Map<String,List<StatementImpl.PreStatement>> claims,
Map<String,List<StatementImpl.PreStatement>> statements,
long revisionId,
String siteIri)
Constructor.
|
| 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) |
boolean |
equals(Object obj) |
StatementGroup |
findStatementGroup(String propertyIdValue)
Find a statement group by its property id, without checking for
equality with the site IRI.
|
Iterator<Statement> |
getAllStatements()
Returns an iterator that provides access to all statements, without
considering the statement groups.
|
MediaInfoIdValue |
getEntityId()
Returns the ID of the entity that the data refers to
|
Map<String,List<Statement>> |
getJsonClaims()
Returns the "claims".
|
Map<String,MonolingualTextValue> |
getLabels()
Return a Map from Wikibase language codes to labels.
|
List<StatementGroup> |
getStatementGroups()
Return the list of all StatementGroups stored for this item.
|
int |
hashCode() |
protected static Map<String,List<Statement>> |
removeStatements(Set<String> statementIds,
Map<String,List<Statement>> claims)
Removes statement ids from a collection of statement groups.
|
String |
toString() |
MediaInfoDocument |
withEntityId(MediaInfoIdValue newEntityId)
Returns a new version of this document with updated ID.
|
MediaInfoDocument |
withLabel(MonolingualTextValue newLabel)
Returns a new version of this document with a new label
(which overrides any existing label for this language).
|
MediaInfoDocument |
withoutStatementIds(Set<String> statementIds)
Returns a new version of this document where all statements matching
any of the statement ids provided have been removed.
|
MediaInfoDocument |
withRevisionId(long newRevisionId)
Returns a copy of this document with an updated revision id.
|
MediaInfoDocument |
withStatement(Statement statement)
Returns a new version of this document which includes the
statement provided.
|
protected static Map<String,MonolingualTextValue> |
withTerm(Map<String,MonolingualTextValue> values,
MonolingualTextValue value) |
getJsonId, getRevisionId, getSiteIriclone, finalize, getClass, notify, notifyAll, wait, wait, waitfindLabel, 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, hasStatementValuegetRevisionIdprotected final Map<String,MonolingualTextValue> labels
public MediaInfoDocumentImpl(MediaInfoIdValue id, List<MonolingualTextValue> labels, List<StatementGroup> statements, long revisionId)
id - the id of the media that data is aboutlabels - the list of captions of this media, with at most one label for
each language codestatements - the list of statement groups of this media info; all of them must
have the given itemIdValue as their subjectrevisionId - the revision ID or 0 if not known; see
EntityDocument.getRevisionId()public MediaInfoDocumentImpl(String jsonId, Map<String,MonolingualTextValue> labels, Map<String,List<StatementImpl.PreStatement>> claims, Map<String,List<StatementImpl.PreStatement>> statements, long revisionId, String siteIri)
protected MediaInfoDocumentImpl(MediaInfoIdValue subject, Map<String,MonolingualTextValue> labels, Map<String,List<Statement>> claims, long revisionId)
public MediaInfoIdValue getEntityId()
MediaInfoDocumentgetEntityId in interface EntityDocumentgetEntityId in interface MediaInfoDocumentpublic MediaInfoDocument withEntityId(MediaInfoIdValue newEntityId)
MediaInfoDocumentwithEntityId in interface MediaInfoDocumentnewEntityId - new ID of the documentpublic MediaInfoDocument withRevisionId(long newRevisionId)
LabeledDocumentwithRevisionId in interface EntityDocumentwithRevisionId in interface LabeledDocumentwithRevisionId in interface LabeledStatementDocumentwithRevisionId in interface MediaInfoDocumentwithRevisionId in interface StatementDocumentpublic MediaInfoDocument withLabel(MonolingualTextValue newLabel)
LabeledDocumentwithLabel in interface LabeledDocumentwithLabel in interface LabeledStatementDocumentwithLabel in interface MediaInfoDocumentpublic MediaInfoDocument withStatement(Statement statement)
StatementDocumentwithStatement in interface LabeledStatementDocumentwithStatement in interface MediaInfoDocumentwithStatement in interface StatementDocumentstatement - the statement to add or update in the documentpublic MediaInfoDocument withoutStatementIds(Set<String> statementIds)
StatementDocumentwithoutStatementIds in interface LabeledStatementDocumentwithoutStatementIds in interface MediaInfoDocumentwithoutStatementIds in interface StatementDocumentstatementIds - the identifiers of the statements to removepublic 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