Class DataObjectFactoryImpl
java.lang.Object
org.wikidata.wdtk.datamodel.implementation.DataObjectFactoryImpl
- All Implemented Interfaces:
DataObjectFactory
Factory implementation to create Jackson versions of the datamodel objects,
where available.
- Author:
- Markus Kroetzsch
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAliasUpdate
(List<MonolingualTextValue> recreated, List<MonolingualTextValue> added, Collection<MonolingualTextValue> removed) Creates newAliasUpdate
.getClaim
(EntityIdValue subject, Snak mainSnak, List<SnakGroup> qualifiers) Creates aClaim
.Creates aDatatypeIdValue
.getDatatypeIdValueFromJsonId
(String jsonId) Creates aDatatypeIdValue
.getFormDocument
(FormIdValue formIdValue, List<MonolingualTextValue> representations, List<ItemIdValue> grammaticalFeatures, List<StatementGroup> statementGroups, long revisionId) Creates anFormDocument
.getFormIdValue
(String id, String siteIri) Creates aFormIdValue
.getFormUpdate
(FormIdValue entityId, long revisionId, TermUpdate representations, Collection<ItemIdValue> grammaticalFeatures, StatementUpdate statements) Creates newFormUpdate
.getGlobeCoordinatesValue
(double latitude, double longitude, double precision, String globeIri) Creates aGlobeCoordinatesValue
.getItemDocument
(ItemIdValue itemIdValue, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, List<StatementGroup> statementGroups, Map<String, SiteLink> siteLinks, long revisionId) Creates anItemDocument
.getItemIdValue
(String id, String siteIri) Creates anItemIdValue
.getItemUpdate
(ItemIdValue entityId, long revisionId, TermUpdate labels, TermUpdate descriptions, Map<String, AliasUpdate> aliases, StatementUpdate statements, Collection<SiteLink> modifiedSiteLinks, Collection<String> removedSiteLinks) Creates newItemUpdate
.getLexemeDocument
(LexemeIdValue lexemeIdValue, ItemIdValue lexicalCategory, ItemIdValue language, List<MonolingualTextValue> lemmas, List<StatementGroup> statementGroups, List<FormDocument> forms, List<SenseDocument> senses, long revisionId) Creates anLexemeDocument
.getLexemeIdValue
(String id, String siteIri) Creates aLexemeIdValue
.getLexemeUpdate
(LexemeIdValue entityId, long revisionId, ItemIdValue language, ItemIdValue lexicalCategory, TermUpdate lemmas, StatementUpdate statements, Collection<SenseDocument> addedSenses, Collection<SenseUpdate> updatedSenses, Collection<SenseIdValue> removedSenses, Collection<FormDocument> addedForms, Collection<FormUpdate> updatedForms, Collection<FormIdValue> removedForms) Creates newLexemeUpdate
.getMediaInfoDocument
(MediaInfoIdValue mediaInfoIdValue, List<MonolingualTextValue> labels, List<StatementGroup> statementGroups, long revisionId) Creates aMediaInfoDocument
.getMediaInfoIdValue
(String id, String siteIri) Creates aMediaInfoIdValue
.getMediaInfoUpdate
(MediaInfoIdValue entityId, long revisionId, TermUpdate labels, StatementUpdate statements) Creates newMediaInfoUpdate
.getMonolingualTextValue
(String text, String languageCode) Creates aMonolingualTextValue
.getNoValueSnak
(PropertyIdValue propertyId) Creates aNoValueSnak
.getPropertyDocument
(PropertyIdValue propertyId, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, List<StatementGroup> statementGroups, DatatypeIdValue datatypeId, long revisionId) Creates aPropertyDocument
.getPropertyIdValue
(String id, String siteIri) Creates aPropertyIdValue
.getPropertyUpdate
(PropertyIdValue entityId, long revisionId, TermUpdate labels, TermUpdate descriptions, Map<String, AliasUpdate> aliases, StatementUpdate statements) Creates newPropertyUpdate
.getQuantityValue
(BigDecimal numericValue) Creates aQuantityValue
without a unit of measurement and bounds.getQuantityValue
(BigDecimal numericValue, String unit) Creates aQuantityValue
without bounds.getQuantityValue
(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound) Creates aQuantityValue
without a unit of measurement.getQuantityValue
(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound, String unit) Deprecated.getQuantityValue
(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound, ItemIdValue unit) Creates aQuantityValue
.getQuantityValue
(BigDecimal numericValue, ItemIdValue unit) Creates aQuantityValue
without bounds.getReference
(List<SnakGroup> snakGroups) Creates aReference
.getSenseDocument
(SenseIdValue senseIdValue, List<MonolingualTextValue> glosses, List<StatementGroup> statementGroups, long revisionId) Creates aSenseDocument
.getSenseIdValue
(String id, String siteIri) Creates aSenseIdValue
.getSenseUpdate
(SenseIdValue entityId, long revisionId, TermUpdate glosses, StatementUpdate statements) Creates newSenseUpdate
.getSiteLink
(String title, String siteKey, List<ItemIdValue> badges) Creates aSiteLink
.getSnakGroup
(List<? extends Snak> snaks) Creates aSnakGroup
.getSomeValueSnak
(PropertyIdValue propertyId) Creates aSomeValueSnak
.getStatement
(Claim claim, List<Reference> references, StatementRank rank, String statementId) Creates aStatement
.getStatement
(EntityIdValue subject, Snak mainSnak, List<SnakGroup> qualifiers, List<Reference> references, StatementRank rank, String statementId) Creates aStatement
.getStatementGroup
(List<Statement> statements) Creates aStatementGroup
.getStatementUpdate
(Collection<Statement> added, Collection<Statement> replaced, Collection<String> removed) Creates newStatementUpdate
.getStringValue
(String string) Creates aStringValue
.getTermUpdate
(Collection<MonolingualTextValue> modified, Collection<String> removed) Creates newTermUpdate
.getTimeValue
(long year, byte month, byte day, byte hour, byte minute, byte second, byte precision, int beforeTolerance, int afterTolerance, int timezoneOffset, String calendarModel) Creates aTimeValue
.getValueSnak
(PropertyIdValue propertyId, Value value) Creates aValueSnakImpl
.
-
Constructor Details
-
DataObjectFactoryImpl
public DataObjectFactoryImpl()
-
-
Method Details
-
getItemIdValue
Description copied from interface:DataObjectFactory
Creates anItemIdValue
.- Specified by:
getItemIdValue
in interfaceDataObjectFactory
- Parameters:
id
- a string of the form Qn... where n... is the string representation of a positive integer numbersiteIri
- IRI to identify the site, usually the first part of the entity IRI of the site this belongs to, e.g., "http://www.wikidata.org/entity/"- Returns:
- an
ItemIdValue
corresponding to the input
-
getPropertyIdValue
Description copied from interface:DataObjectFactory
Creates aPropertyIdValue
.- Specified by:
getPropertyIdValue
in interfaceDataObjectFactory
- Parameters:
id
- a string of the form Pn... where n... is the string representation of a positive integer numbersiteIri
- IRI to identify the site, usually the first part of the entity IRI of the site this belongs to, e.g., "http://www.wikidata.org/entity/"- Returns:
- a
PropertyIdValue
corresponding to the input
-
getLexemeIdValue
Description copied from interface:DataObjectFactory
Creates aLexemeIdValue
.- Specified by:
getLexemeIdValue
in interfaceDataObjectFactory
- Parameters:
id
- a string of the form Ln... where n... is the string representation of a positive integer numbersiteIri
- IRI to identify the site, usually the first part of the entity IRI of the site this belongs to, e.g., "http://www.wikidata.org/entity/"- Returns:
- a
LexemeIdValue
corresponding to the input
-
getFormIdValue
Description copied from interface:DataObjectFactory
Creates aFormIdValue
.- Specified by:
getFormIdValue
in interfaceDataObjectFactory
- Parameters:
id
- a string of the form Ln...-Fm... where n... and m... are the string representation of a positive integer numbersiteIri
- IRI to identify the site, usually the first part of the entity IRI of the site this belongs to, e.g., "http://www.wikidata.org/entity/"- Returns:
- a
FormIdValue
corresponding to the input
-
getSenseIdValue
Description copied from interface:DataObjectFactory
Creates aSenseIdValue
.- Specified by:
getSenseIdValue
in interfaceDataObjectFactory
- Parameters:
id
- a string of the form Ln...-Sm... where n... and m... are the string representation of a positive integer numbersiteIri
- IRI to identify the site, usually the first part of the entity IRI of the site this belongs to, e.g., "http://www.wikidata.org/entity/"- Returns:
- a
SenseIdValue
corresponding to the input
-
getMediaInfoIdValue
Description copied from interface:DataObjectFactory
Creates aMediaInfoIdValue
.- Specified by:
getMediaInfoIdValue
in interfaceDataObjectFactory
- Parameters:
id
- a string of the form Mn... where n... is the string representation of a positive integer numbersiteIri
- IRI to identify the site, usually the first part of the entity IRI of the site this belongs to, e.g., "http://www.wikidata.org/entity/"- Returns:
- a
MediaInfoIdValue
corresponding to the input
-
getDatatypeIdValue
Description copied from interface:DataObjectFactory
Creates aDatatypeIdValue
. The datatype IRI is usually one of the constants defined inDatatypeIdValue
, but this is not enforced, since there might be extensions that provide additional types.- Specified by:
getDatatypeIdValue
in interfaceDataObjectFactory
- Parameters:
id
- the IRI string that identifies the datatype- Returns:
- a
DatatypeIdValue
corresponding to the input
-
getDatatypeIdValueFromJsonId
Description copied from interface:DataObjectFactory
Creates aDatatypeIdValue
. The datatype IRI is usually one of the constants defined inDatatypeIdValue
, but this is not enforced, since there might be extensions that provide additional types. The JSON string is its representation in the JSON serialization of properties.- Specified by:
getDatatypeIdValueFromJsonId
in interfaceDataObjectFactory
- Parameters:
jsonId
- the JSON representation of this datatype, which cannot be null- Returns:
- a
DatatypeIdValue
corresponding to the input
-
getTimeValue
public TimeValue getTimeValue(long year, byte month, byte day, byte hour, byte minute, byte second, byte precision, int beforeTolerance, int afterTolerance, int timezoneOffset, String calendarModel) Description copied from interface:DataObjectFactory
Creates aTimeValue
.- Specified by:
getTimeValue
in interfaceDataObjectFactory
- Parameters:
year
- a year number, where 0 refers to 1BCEmonth
- a month number between 1 and 12day
- a day number between 1 and 31hour
- an hour number between 0 and 23minute
- a minute number between 0 and 59second
- a second number between 0 and 60 (possible leap second)precision
- a value in the range ofTimeValue.PREC_DAY
, ...,TimeValue.PREC_1GY
beforeTolerance
- non-negative integer tolerance before the value; seeTimeValue.getBeforeTolerance()
afterTolerance
- non-zero, positive integer tolerance before the value; seeTimeValue.getAfterTolerance()
timezoneOffset
- offset in minutes that should be applied when displaying this timecalendarModel
- the IRI of the calendar model preferred when displaying the date; usuallyTimeValue.CM_GREGORIAN_PRO
orTimeValue.CM_JULIAN_PRO
- Returns:
- a
TimeValue
corresponding to the input
-
getGlobeCoordinatesValue
public GlobeCoordinatesValue getGlobeCoordinatesValue(double latitude, double longitude, double precision, String globeIri) Description copied from interface:DataObjectFactory
Creates aGlobeCoordinatesValue
.- Specified by:
getGlobeCoordinatesValue
in interfaceDataObjectFactory
- Parameters:
latitude
- the latitude of the coordinates in degreeslongitude
- the longitude of the coordinates in degreesprecision
- the precision of the coordinates in degreesglobeIri
- IRI specifying the celestial objects of the coordinates- Returns:
- a
GlobeCoordinatesValue
corresponding to the input
-
getStringValue
Description copied from interface:DataObjectFactory
Creates aStringValue
.- Specified by:
getStringValue
in interfaceDataObjectFactory
- Returns:
- a
StringValue
corresponding to the input
-
getMonolingualTextValue
Description copied from interface:DataObjectFactory
Creates aMonolingualTextValue
.- Specified by:
getMonolingualTextValue
in interfaceDataObjectFactory
- Parameters:
text
- the text of the valuelanguageCode
- the language code of the value- Returns:
- a
MonolingualTextValue
corresponding to the input
-
getQuantityValue
Description copied from interface:DataObjectFactory
Creates aQuantityValue
without a unit of measurement and bounds.- Specified by:
getQuantityValue
in interfaceDataObjectFactory
- Parameters:
numericValue
- the numeric value of this quantity- Returns:
- a
QuantityValue
corresponding to the input
-
getQuantityValue
public QuantityValue getQuantityValue(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound) Description copied from interface:DataObjectFactory
Creates aQuantityValue
without a unit of measurement.- Specified by:
getQuantityValue
in interfaceDataObjectFactory
- Parameters:
numericValue
- the numeric value of this quantitylowerBound
- the lower bound of the numeric value of this quantityupperBound
- the upper bound of the numeric value of this quantity- Returns:
- a
QuantityValue
corresponding to the input
-
getQuantityValue
Description copied from interface:DataObjectFactory
Creates aQuantityValue
without bounds.- Specified by:
getQuantityValue
in interfaceDataObjectFactory
- Parameters:
numericValue
- the numeric value of this quantityunit
- the unit of this quantity, or the empty string if there is no unit- Returns:
- a
QuantityValue
corresponding to the input
-
getQuantityValue
Description copied from interface:DataObjectFactory
Creates aQuantityValue
without bounds.- Specified by:
getQuantityValue
in interfaceDataObjectFactory
- Parameters:
numericValue
- the numeric value of this quantityunit
- the unit of this quantity, or null if there is no unit- Returns:
- a
QuantityValue
corresponding to the input
-
getQuantityValue
@Deprecated public QuantityValue getQuantityValue(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound, String unit) Deprecated.Description copied from interface:DataObjectFactory
Creates aQuantityValue
.- Specified by:
getQuantityValue
in interfaceDataObjectFactory
- Parameters:
numericValue
- the numeric value of this quantitylowerBound
- the lower bound of the numeric value of this quantityupperBound
- the upper bound of the numeric value of this quantityunit
- the unit of this quantity, or the empty string if there is no unit- Returns:
- a
QuantityValue
corresponding to the input
-
getQuantityValue
public QuantityValue getQuantityValue(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound, ItemIdValue unit) Description copied from interface:DataObjectFactory
Creates aQuantityValue
.- Specified by:
getQuantityValue
in interfaceDataObjectFactory
- Parameters:
numericValue
- the numeric value of this quantitylowerBound
- the lower bound of the numeric value of this quantityupperBound
- the upper bound of the numeric value of this quantityunit
- the unit of this quantity, or null if there is no unit- Returns:
- a
QuantityValue
corresponding to the input
-
getValueSnak
Creates aValueSnakImpl
. Value snaks in JSON need to know the datatype of their property, which is not given in the parameters of this method. The snak that will be returned will use a default type based on the kind of value that is used (usually the "simplest" type for that value). This may not be desired.- Specified by:
getValueSnak
in interfaceDataObjectFactory
- Returns:
- a
ValueSnak
corresponding to the input - See Also:
-
getSomeValueSnak
Description copied from interface:DataObjectFactory
Creates aSomeValueSnak
.- Specified by:
getSomeValueSnak
in interfaceDataObjectFactory
- Returns:
- a
SomeValueSnak
corresponding to the input
-
getNoValueSnak
Description copied from interface:DataObjectFactory
Creates aNoValueSnak
.- Specified by:
getNoValueSnak
in interfaceDataObjectFactory
- Returns:
- a
NoValueSnak
corresponding to the input
-
getSnakGroup
Description copied from interface:DataObjectFactory
Creates aSnakGroup
.- Specified by:
getSnakGroup
in interfaceDataObjectFactory
- Parameters:
snaks
- a non-empty list of snaks that use the same property- Returns:
- a
SnakGroup
corresponding to the input
-
getClaim
Description copied from interface:DataObjectFactory
Creates aClaim
. It might be more convenient to useDataObjectFactory.getStatement(org.wikidata.wdtk.datamodel.interfaces.EntityIdValue, org.wikidata.wdtk.datamodel.interfaces.Snak, java.util.List<org.wikidata.wdtk.datamodel.interfaces.SnakGroup>, java.util.List<org.wikidata.wdtk.datamodel.interfaces.Reference>, org.wikidata.wdtk.datamodel.interfaces.StatementRank, java.lang.String)
directly if you want to build a statement.- Specified by:
getClaim
in interfaceDataObjectFactory
- Parameters:
subject
- the subject the Statement refers tomainSnak
- the main Snak of the Statementqualifiers
- the qualifiers of the Statement, grouped in SnakGroups- Returns:
- a
Claim
corresponding to the input
-
getReference
Description copied from interface:DataObjectFactory
Creates aReference
. It might be more convenient to useReferenceBuilder
instead.- Specified by:
getReference
in interfaceDataObjectFactory
- Parameters:
snakGroups
- list of snak groups- Returns:
- a
Reference
corresponding to the input
-
getStatement
public Statement getStatement(Claim claim, List<Reference> references, StatementRank rank, String statementId) Description copied from interface:DataObjectFactory
Creates aStatement
. It might be more convenient to useStatementBuilder
instead.The string id is used mainly for communication with a Wikibase site, in order to refer to statements of that site. When creating new statements that are not on any site, the empty string can be used.
- Specified by:
getStatement
in interfaceDataObjectFactory
- Parameters:
claim
- the main claim the Statement refers toreferences
- the references for the Statementrank
- the rank of the StatementstatementId
- the string id of the Statement- Returns:
- a
Statement
corresponding to the input
-
getStatement
public Statement getStatement(EntityIdValue subject, Snak mainSnak, List<SnakGroup> qualifiers, List<Reference> references, StatementRank rank, String statementId) Description copied from interface:DataObjectFactory
Creates aStatement
. It might be more convenient to useStatementBuilder
instead.The string id is used mainly for communication with a Wikibase site, in order to refer to statements of that site. When creating new statements that are not on any site, the empty string can be used.
- Specified by:
getStatement
in interfaceDataObjectFactory
- Parameters:
subject
- the subject the Statement refers tomainSnak
- the main Snak of the Statementqualifiers
- the qualifiers of the Statement, grouped in SnakGroupsreferences
- the references for the Statementrank
- the rank of the StatementstatementId
- the string id of the Statement- Returns:
- a
Statement
corresponding to the input
-
getStatementGroup
Description copied from interface:DataObjectFactory
Creates aStatementGroup
.- Specified by:
getStatementGroup
in interfaceDataObjectFactory
- Parameters:
statements
- a non-empty list of statements that use the same subject and main-snak property in their claim- Returns:
- a
StatementGroup
corresponding to the input
-
getSiteLink
Description copied from interface:DataObjectFactory
Creates aSiteLink
.- Specified by:
getSiteLink
in interfaceDataObjectFactory
- Parameters:
title
- the title string of the linked page, including namespace prefixes if anysiteKey
- the string key of the site of the linked articlebadges
- the list of badges of the linked article- Returns:
- a
SiteLink
corresponding to the input
-
getPropertyDocument
public PropertyDocument getPropertyDocument(PropertyIdValue propertyId, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, List<StatementGroup> statementGroups, DatatypeIdValue datatypeId, long revisionId) Description copied from interface:DataObjectFactory
Creates aPropertyDocument
. It might be more convenient to use thePropertyDocumentBuilder
instead.- Specified by:
getPropertyDocument
in interfaceDataObjectFactory
- Parameters:
propertyId
- the id of the property that data is aboutlabels
- the list of labels of this property, with at most one label for each language codedescriptions
- the list of descriptions of this property, with at most one description for each language codealiases
- the list of aliases of this propertystatementGroups
- the list of statement groups of this item; all of them must have the given itemIdValue as their subjectdatatypeId
- the datatype of that propertyrevisionId
- the revision ID or 0 if not known; seeEntityDocument.getRevisionId()
- Returns:
- a
PropertyDocument
corresponding to the input
-
getItemDocument
public ItemDocument getItemDocument(ItemIdValue itemIdValue, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, List<StatementGroup> statementGroups, Map<String, SiteLink> siteLinks, long revisionId) Description copied from interface:DataObjectFactory
Creates anItemDocument
. It might be more convenient to use theItemDocumentBuilder
instead.- Specified by:
getItemDocument
in interfaceDataObjectFactory
- Parameters:
itemIdValue
- the id of the item that data is aboutlabels
- the list of labels of this item, with at most one label for each language codedescriptions
- the list of descriptions of this item, with at most one description for each language codealiases
- the list of aliases of this itemstatementGroups
- the list of statement groups of this item; all of them must have the given itemIdValue as their subjectsiteLinks
- the sitelinks of this item by site keyrevisionId
- the revision ID or 0 if not known; seeEntityDocument.getRevisionId()
- Returns:
- an
ItemDocument
corresponding to the input
-
getLexemeDocument
public LexemeDocument getLexemeDocument(LexemeIdValue lexemeIdValue, ItemIdValue lexicalCategory, ItemIdValue language, List<MonolingualTextValue> lemmas, List<StatementGroup> statementGroups, List<FormDocument> forms, List<SenseDocument> senses, long revisionId) Description copied from interface:DataObjectFactory
Creates anLexemeDocument
.- Specified by:
getLexemeDocument
in interfaceDataObjectFactory
- Parameters:
lexemeIdValue
- the id of the lexeme that data is aboutlexicalCategory
- the lexical category to which the lexeme belongs (noun, verb...)language
- the language to which the lexeme belongs (French, British English...)lemmas
- the human readable representations of the lexemestatementGroups
- the list of statement groups of this lexeme; all of them must have the given lexemeIdValue as their subjectforms
- the forms of the lexemesenses
- the senses of the lexemerevisionId
- the revision ID or 0 if not known; seeEntityDocument.getRevisionId()
- Returns:
- a
LexemeDocument
corresponding to the input
-
getFormDocument
public FormDocument getFormDocument(FormIdValue formIdValue, List<MonolingualTextValue> representations, List<ItemIdValue> grammaticalFeatures, List<StatementGroup> statementGroups, long revisionId) Description copied from interface:DataObjectFactory
Creates anFormDocument
.- Specified by:
getFormDocument
in interfaceDataObjectFactory
- Parameters:
formIdValue
- the id of the form that data is aboutrepresentations
- the list of representations of this lexeme, with at most one lemma for each language codegrammaticalFeatures
- the grammatical features of the lexemestatementGroups
- the list of statement groups of this lexeme; all of them must have the given lexemeIdValue as their subjectrevisionId
- the revision ID or 0 if not known; seeEntityDocument.getRevisionId()
- Returns:
- a
FormDocument
corresponding to the input
-
getSenseDocument
public SenseDocument getSenseDocument(SenseIdValue senseIdValue, List<MonolingualTextValue> glosses, List<StatementGroup> statementGroups, long revisionId) Description copied from interface:DataObjectFactory
Creates aSenseDocument
.- Specified by:
getSenseDocument
in interfaceDataObjectFactory
- Parameters:
senseIdValue
- the id of the form that data is aboutglosses
- the list of glosses of this lexeme, with at most one gloss for each language codestatementGroups
- the list of statement groups of this lexeme; all of them must have the given lexemeIdValue as their subjectrevisionId
- the revision ID or 0 if not known; seeEntityDocument.getRevisionId()
- Returns:
- a
SenseDocument
corresponding to the input
-
getMediaInfoDocument
public MediaInfoDocument getMediaInfoDocument(MediaInfoIdValue mediaInfoIdValue, List<MonolingualTextValue> labels, List<StatementGroup> statementGroups, long revisionId) Description copied from interface:DataObjectFactory
Creates aMediaInfoDocument
.- Specified by:
getMediaInfoDocument
in interfaceDataObjectFactory
- Parameters:
mediaInfoIdValue
- the id of the form that data is aboutlabels
- the list of labels of this media info, with at most one label for each language codestatementGroups
- the list of statement groups of this lexeme; all of them must have the given mediaInfoIdValue as their subjectrevisionId
- the revision ID or 0 if not known; seeEntityDocument.getRevisionId()
- Returns:
- a
MediaInfoDocument
corresponding to the input
-
getTermUpdate
public TermUpdate getTermUpdate(Collection<MonolingualTextValue> modified, Collection<String> removed) Description copied from interface:DataObjectFactory
Creates newTermUpdate
. It might be more convenient to useTermUpdateBuilder
.- Specified by:
getTermUpdate
in interfaceDataObjectFactory
- Parameters:
modified
- added or changed valuesremoved
- language codes of removed values- Returns:
- new
TermUpdate
-
getAliasUpdate
public AliasUpdate getAliasUpdate(List<MonolingualTextValue> recreated, List<MonolingualTextValue> added, Collection<MonolingualTextValue> removed) Description copied from interface:DataObjectFactory
Creates newAliasUpdate
. Callers should specify eitherrecreated
parameter oradded
andremoved
parameters, because combination of the two update approaches is not possible. To remove all aliases, pass empty list inrecreated
parameter.- Specified by:
getAliasUpdate
in interfaceDataObjectFactory
- Parameters:
recreated
- new list of aliases that completely replaces the old ones ornull
to not recreate aliasesadded
- aliases added in this update or empty collection for no additionsremoved
- aliases removed in this update or empty collection for no removals- Returns:
- new
AliasUpdate
-
getStatementUpdate
public StatementUpdate getStatementUpdate(Collection<Statement> added, Collection<Statement> replaced, Collection<String> removed) Description copied from interface:DataObjectFactory
Creates newStatementUpdate
. It might be more convenient to useStatementUpdateBuilder
.- Specified by:
getStatementUpdate
in interfaceDataObjectFactory
- Parameters:
added
- added statementsreplaced
- replaced statementsremoved
- IDs of removed statements- Returns:
- new
StatementUpdate
-
getSenseUpdate
public SenseUpdate getSenseUpdate(SenseIdValue entityId, long revisionId, TermUpdate glosses, StatementUpdate statements) Description copied from interface:DataObjectFactory
Creates newSenseUpdate
. It might be more convenient to useSenseUpdateBuilder
.- Specified by:
getSenseUpdate
in interfaceDataObjectFactory
- Parameters:
entityId
- ID of the sense that is to be updatedrevisionId
- base sense revision to be updated or zero if not availableglosses
- changes in sense glosses ornull
for no changestatements
- changes in entity statements, possibly empty- Returns:
- new
SenseUpdate
-
getFormUpdate
public FormUpdate getFormUpdate(FormIdValue entityId, long revisionId, TermUpdate representations, Collection<ItemIdValue> grammaticalFeatures, StatementUpdate statements) Description copied from interface:DataObjectFactory
Creates newFormUpdate
. It might be more convenient to useFormUpdateBuilder
.- Specified by:
getFormUpdate
in interfaceDataObjectFactory
- Parameters:
entityId
- ID of the form that is to be updatedrevisionId
- base form revision to be updated or zero if not availablerepresentations
- changes in form representations ornull
for no changegrammaticalFeatures
- new grammatical features of the form ornull
for no changestatements
- changes in entity statements, possibly empty- Returns:
- new
FormUpdate
-
getLexemeUpdate
public LexemeUpdate getLexemeUpdate(LexemeIdValue entityId, long revisionId, ItemIdValue language, ItemIdValue lexicalCategory, TermUpdate lemmas, StatementUpdate statements, Collection<SenseDocument> addedSenses, Collection<SenseUpdate> updatedSenses, Collection<SenseIdValue> removedSenses, Collection<FormDocument> addedForms, Collection<FormUpdate> updatedForms, Collection<FormIdValue> removedForms) Description copied from interface:DataObjectFactory
Creates newLexemeUpdate
. It might be more convenient to useLexemeUpdateBuilder
.- Specified by:
getLexemeUpdate
in interfaceDataObjectFactory
- Parameters:
entityId
- ID of the lexeme that is to be updatedrevisionId
- base lexeme revision to be updated or zero if not availablelanguage
- new lexeme language ornull
for no changelexicalCategory
- new lexical category of the lexeme ornull
for no changelemmas
- changes in lemmas ornull
for no changestatements
- changes in entity statements, possibly emptyaddedSenses
- added sensesupdatedSenses
- updated sensesremovedSenses
- IDs of removed sensesaddedForms
- added formsupdatedForms
- updated formsremovedForms
- IDs of removed forms- Returns:
- new
LexemeUpdate
-
getMediaInfoUpdate
public MediaInfoUpdate getMediaInfoUpdate(MediaInfoIdValue entityId, long revisionId, TermUpdate labels, StatementUpdate statements) Description copied from interface:DataObjectFactory
Creates newMediaInfoUpdate
. It might be more convenient to useMediaInfoUpdateBuilder
.- Specified by:
getMediaInfoUpdate
in interfaceDataObjectFactory
- Parameters:
entityId
- ID of the media that is to be updatedrevisionId
- base media revision to be updated or zero if not availablelabels
- changes in entity labels ornull
for no changestatements
- changes in entity statements, possibly empty- Returns:
- new
MediaInfoUpdate
-
getItemUpdate
public ItemUpdate getItemUpdate(ItemIdValue entityId, long revisionId, TermUpdate labels, TermUpdate descriptions, Map<String, AliasUpdate> aliases, StatementUpdate statements, Collection<SiteLink> modifiedSiteLinks, Collection<String> removedSiteLinks) Description copied from interface:DataObjectFactory
Creates newItemUpdate
. It might be more convenient to useItemUpdateBuilder
.- Specified by:
getItemUpdate
in interfaceDataObjectFactory
- Parameters:
entityId
- ID of the item that is to be updatedrevisionId
- base item revision to be updated or zero if not availablelabels
- changes in entity labels ornull
for no changedescriptions
- changes in entity descriptions ornull
for no changealiases
- changes in entity aliases, possibly emptystatements
- changes in entity statements, possibly emptymodifiedSiteLinks
- added or replaced site linksremovedSiteLinks
- site keys of removed site links- Returns:
- new
ItemUpdate
-
getPropertyUpdate
public PropertyUpdate getPropertyUpdate(PropertyIdValue entityId, long revisionId, TermUpdate labels, TermUpdate descriptions, Map<String, AliasUpdate> aliases, StatementUpdate statements) Description copied from interface:DataObjectFactory
Creates newPropertyUpdate
. It might be more convenient to usePropertyUpdateBuilder
.- Specified by:
getPropertyUpdate
in interfaceDataObjectFactory
- Parameters:
entityId
- ID of the property entity that is to be updatedrevisionId
- base property revision to be updated or zero if not availablelabels
- changes in entity labels ornull
for no changedescriptions
- changes in entity descriptions ornull
for no changealiases
- changes in entity aliases, possibly emptystatements
- changes in entity statements, possibly empty- Returns:
- new
PropertyUpdate
-