Class Datamodel

java.lang.Object
org.wikidata.wdtk.datamodel.helpers.Datamodel

public class Datamodel extends Object
This class contains static methods to create WDTK data objects. This is the preferred way of creating data objects in WDTK.
Author:
Markus Kroetzsch
  • Field Details

  • Constructor Details

    • Datamodel

      public Datamodel()
  • Method Details

    • makeItemIdValue

      public static ItemIdValue makeItemIdValue(String id, String siteIri)
      Creates an ItemIdValue.
      Parameters:
      id - a string of the form Qn... where n... is the string representation of a positive integer number
      siteIri - 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
    • makeWikidataItemIdValue

      public static ItemIdValue makeWikidataItemIdValue(String id)
      Creates an ItemIdValue for Wikidata.
      Parameters:
      id - a string of the form Qn... where n... is the string representation of a positive integer number
      Returns:
      an ItemIdValue corresponding to the input
    • makePropertyIdValue

      public static PropertyIdValue makePropertyIdValue(String id, String siteIri)
      Creates a PropertyIdValue.
      Parameters:
      id - a string of the form Pn... where n... is the string representation of a positive integer number
      siteIri - 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
    • makeWikidataPropertyIdValue

      public static PropertyIdValue makeWikidataPropertyIdValue(String id)
      Creates a PropertyIdValue.
      Parameters:
      id - a string of the form Pn... where n... is the string representation of a positive integer number
      Returns:
      a PropertyIdValue corresponding to the input
    • makeLexemeIdValue

      public static LexemeIdValue makeLexemeIdValue(String id, String siteIri)
      Creates an LexemeIdValue.
      Parameters:
      id - a string of the form Ln... where n... is the string representation of a positive integer number
      siteIri - 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 LexemeIdValue corresponding to the input
    • makeWikidataLexemeIdValue

      public static LexemeIdValue makeWikidataLexemeIdValue(String id)
      Creates an LexemeIdValue for Wikidata.
      Parameters:
      id - a string of the form Ln... where n... is the string representation of a positive integer number
      Returns:
      an LexemeIdValue corresponding to the input
    • makeFormIdValue

      public static FormIdValue makeFormIdValue(String id, String siteIri)
      Creates an FormIdValue.
      Parameters:
      id - a string of the form Ln...-Fm... where n... and m... are the string representation of a positive integer number
      siteIri - 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 FormIdValue corresponding to the input
    • makeWikidataFormIdValue

      public static FormIdValue makeWikidataFormIdValue(String id)
      Creates an FormIdValue for Wikidata.
      Parameters:
      id - a string of the form Ln...-F... where n... and m... are the string representation of a positive integer number
      Returns:
      an FormIdValue corresponding to the input
    • makeSenseIdValue

      public static SenseIdValue makeSenseIdValue(String id, String siteIri)
      Creates an SenseIdValue.
      Parameters:
      id - a string of the form Ln...-Sm... where n... and m... are the string representation of a positive integer number
      siteIri - 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 SenseIdValue corresponding to the input
    • makeWikidataSenseIdValue

      public static SenseIdValue makeWikidataSenseIdValue(String id)
      Creates an SenseIdValue for Wikidata.
      Parameters:
      id - a string of the form Ln...-S... where n... and m... are the string representation of a positive integer number
      Returns:
      an SenseIdValue corresponding to the input
    • makeMediaInfoIdValue

      public static MediaInfoIdValue makeMediaInfoIdValue(String id, String siteIri)
      Creates an MediaInfoIdValue.
      Parameters:
      id - a string of the form Mn... where n... is the string representation of a positive integer number
      siteIri - 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 MediaInfoIdValue corresponding to the input
    • makeWikimediaCommonsMediaInfoIdValue

      public static MediaInfoIdValue makeWikimediaCommonsMediaInfoIdValue(String id)
      Creates an MediaInfoIdValue for Wikimedia Commons.
      Parameters:
      id - a string of the form Mn... where n... is the string representation of a positive integer number
      Returns:
      an MediaInfoIdValue corresponding to the input
    • makeDatatypeIdValue

      public static DatatypeIdValue makeDatatypeIdValue(String id)
      Creates a DatatypeIdValue. The datatype IRI is usually one of the constants defined in DatatypeIdValue, but this is not enforced, since there might be extensions that provide additional types.
      Parameters:
      id - the IRI string that identifies the datatype
      Returns:
      a DatatypeIdValue corresponding to the input
    • makeDatatypeIdValueFromJsonString

      public static DatatypeIdValue makeDatatypeIdValueFromJsonString(String jsonString)
      Creates a DatatypeIdValue. The string is an identifier used in the JSON serialization of properties to identify the datatype, and is one of the constants defined in DatatypeIdValue, but this is not enforced, since there are extensions that provide additional types.
      Parameters:
      jsonString - the string that identifies the datatype
      Returns:
      a DatatypeIdValue corresponding to the input
    • makeTimeValue

      public static TimeValue makeTimeValue(long year, byte month, byte day, byte hour, byte minute, byte second, byte precision, int beforeTolerance, int afterTolerance, int timezoneOffset, String calendarModel)
      Creates a TimeValue.
      Parameters:
      year - a year number, where 0 refers to 1BCE
      month - a month number between 1 and 12
      day - a day number between 1 and 31
      hour - an hour number between 0 and 23
      minute - a minute number between 0 and 59
      second - a second number between 0 and 60 (possible leap second)
      precision - a value in the range of TimeValue.PREC_DAY, ..., TimeValue.PREC_1GY
      beforeTolerance - non-negative integer tolerance before the value; see TimeValue.getBeforeTolerance()
      afterTolerance - non-zero, positive integer tolerance before the value; see TimeValue.getAfterTolerance()
      timezoneOffset - offset in minutes that should be applied when displaying this time
      calendarModel - the IRI of the calendar model preferred when displaying the date; usually TimeValue.CM_GREGORIAN_PRO or TimeValue.CM_JULIAN_PRO
      Returns:
      a TimeValue corresponding to the input
    • makeTimeValue

      public static TimeValue makeTimeValue(long year, byte month, byte day, byte hour, byte minute, byte second, int timezoneOffset, String calendarModel)
      Creates a TimeValue for a given date and time. The precision is automatically set to TimeValue.PREC_SECOND.
      Parameters:
      year - a year number, where 0 refers to 1BCE
      month - a month number between 1 and 12
      day - a day number between 1 and 31
      hour - an hour number between 0 and 23
      minute - a minute number between 0 and 59
      second - a second number between 0 and 60 (possible leap second)
      timezoneOffset - offset in minutes that should be applied when displaying this time
      calendarModel - the IRI of the calendar model preferred when displaying the date; usually TimeValue.CM_GREGORIAN_PRO or TimeValue.CM_JULIAN_PRO
      Returns:
      a TimeValue corresponding to the input
    • makeTimeValue

      public static TimeValue makeTimeValue(long year, byte month, byte day, String calendarModel)
      Creates a TimeValue for a given date. The precision is automatically set to TimeValue.PREC_DAY.
      Parameters:
      year - a year number, where 0 refers to 1BCE
      month - a month number between 1 and 12
      day - a day number between 1 and 31
      calendarModel - the IRI of the calendar model preferred when displaying the date; usually TimeValue.CM_GREGORIAN_PRO or TimeValue.CM_JULIAN_PRO
      Returns:
      a TimeValue corresponding to the input
    • makeGlobeCoordinatesValue

      public static GlobeCoordinatesValue makeGlobeCoordinatesValue(double latitude, double longitude, double precision, String globeIri)
      Parameters:
      latitude - the latitude of the coordinates in degrees
      longitude - the longitude of the coordinates in degrees
      precision - the precision of the coordinates in degrees
      globeIri - IRI specifying the celestial objects of the coordinates
      Returns:
      a GlobeCoordinatesValue corresponding to the input
    • makeStringValue

      public static StringValue makeStringValue(String string)
      Creates a StringValue.
      Parameters:
      string -
      Returns:
      a StringValue corresponding to the input
    • makeMonolingualTextValue

      public static MonolingualTextValue makeMonolingualTextValue(String text, String languageCode)
      Parameters:
      text - the text of the value
      languageCode - the language code of the value
      Returns:
      a MonolingualTextValue corresponding to the input
    • makeQuantityValue

      public static QuantityValue makeQuantityValue(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound, ItemIdValue unit)
      Creates a QuantityValue.
      Parameters:
      numericValue - the numeric value of this quantity
      lowerBound - the lower bound of the numeric value of this quantity
      upperBound - the upper bound of the numeric value of this quantity
      unit - the unit identifier to use for this quantity
      Returns:
      a QuantityValue corresponding to the input
    • makeQuantityValue

      public static QuantityValue makeQuantityValue(BigDecimal numericValue, ItemIdValue unit)
      Creates a QuantityValue without bounds.
      Parameters:
      numericValue - the numeric value of this quantity
      unit - the unit identifier to use for this quantity
      Returns:
      a QuantityValue corresponding to the input
    • makeQuantityValue

      public static QuantityValue makeQuantityValue(BigDecimal numericValue, BigDecimal lowerBound, BigDecimal upperBound)
      Creates a QuantityValue with an empty unit.
      Parameters:
      numericValue - the numeric value of this quantity
      lowerBound - the lower bound of the numeric value of this quantity
      upperBound - the upper bound of the numeric value of this quantity
      Returns:
      a QuantityValue corresponding to the input
    • makeQuantityValue

      public static QuantityValue makeQuantityValue(BigDecimal numericValue)
      Creates a QuantityValue with an empty unit and without bounds.
      Parameters:
      numericValue - the numeric value of this quantity
      Returns:
      a QuantityValue corresponding to the input
    • makeQuantityValue

      public static QuantityValue makeQuantityValue(long numericValue, long lowerBound, long upperBound)
      Creates a QuantityValue from long numbers.
      Parameters:
      numericValue - the numeric value of this quantity
      lowerBound - the lower bound of the numeric value of this quantity
      upperBound - the upper bound of the numeric value of this quantity
      Returns:
      a QuantityValue corresponding to the input
    • makeValueSnak

      public static ValueSnak makeValueSnak(PropertyIdValue propertyId, Value value)
      Creates a ValueSnak.
      Parameters:
      propertyId -
      value -
      Returns:
      a ValueSnak corresponding to the input
    • makeSomeValueSnak

      public static SomeValueSnak makeSomeValueSnak(PropertyIdValue propertyId)
      Creates a SomeValueSnak.
      Parameters:
      propertyId -
      Returns:
      a SomeValueSnak corresponding to the input
    • makeNoValueSnak

      public static NoValueSnak makeNoValueSnak(PropertyIdValue propertyId)
      Creates a NoValueSnak.
      Parameters:
      propertyId -
      Returns:
      a NoValueSnak corresponding to the input
    • makeSnakGroup

      public static SnakGroup makeSnakGroup(List<? extends Snak> snaks)
      Creates a SnakGroup.
      Parameters:
      snaks - a non-empty list of snaks that use the same property
      Returns:
      a SnakGroup corresponding to the input
    • makeClaim

      public static Claim makeClaim(EntityIdValue subject, Snak mainSnak, List<SnakGroup> qualifiers)
      Parameters:
      subject - the subject the Statement refers to
      mainSnak - the main Snak of the Statement
      qualifiers - the qualifiers of the Statement, grouped in SnakGroups
      Returns:
      a Claim corresponding to the input
    • makeReference

      public static Reference makeReference(List<SnakGroup> snakGroups)
      Creates a Reference. It might be more convenient to use the ReferenceBuilder instead.
      Parameters:
      snakGroups - list of snak groups
      Returns:
      a Reference corresponding to the input
    • makeStatement

      public static Statement makeStatement(EntityIdValue subject, Snak mainSnak, List<SnakGroup> qualifiers, List<Reference> references, StatementRank rank, String statementId)
      Creates a Statement. It might be more convenient to use the StatementBuilder 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.

      Parameters:
      subject - the subject the Statement refers to
      mainSnak - the main Snak of the Statement
      qualifiers - the qualifiers of the Statement, grouped in SnakGroups
      references - the references for the Statement
      rank - the rank of the Statement
      statementId - the string id of the Statement
      Returns:
      a Statement corresponding to the input
    • makeStatement

      public static Statement makeStatement(Claim claim, List<Reference> references, StatementRank rank, String statementId)
      Creates a Statement. It might be more convenient to use the StatementBuilder 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.

      Parameters:
      claim - the main claim the Statement refers to
      references - the references for the Statement
      rank - the rank of the Statement
      statementId - the string id of the Statement
      Returns:
      a Statement corresponding to the input
    • makeStatementGroup

      public static StatementGroup makeStatementGroup(List<Statement> statements)
      Creates a StatementGroup.
      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
    • makeSiteLink

      public static SiteLink makeSiteLink(String title, String siteKey, List<ItemIdValue> badges)
      Creates a SiteLink.
      Parameters:
      title - the title string of the linked page, including namespace prefixes if any
      siteKey - the string key of the site of the linked article
      badges - the list of badges of the linked article
      Returns:
      a SiteLink corresponding to the input
    • makeSiteLink

      public static SiteLink makeSiteLink(String title, String siteKey)
      Creates a SiteLink without badges.
      Parameters:
      title - the title string of the linked page, including namespace prefixes if any
      siteKey - the string key of the site of the linked article
      Returns:
      a SiteLink corresponding to the input
    • makePropertyDocument

      public static PropertyDocument makePropertyDocument(PropertyIdValue propertyId, DatatypeIdValue datatypeId)
      Creates an empty PropertyDocument.
      Parameters:
      propertyId - the id of the property that data is about
      datatypeId - the datatype of that property
      Returns:
      a PropertyDocument corresponding to the input
    • makePropertyDocument

      public static PropertyDocument makePropertyDocument(PropertyIdValue propertyId, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, List<StatementGroup> statementGroups, DatatypeIdValue datatypeId)
      Creates a PropertyDocument with empty revision id. It might be more convenient to use the PropertyDocumentBuilder instead.
      Parameters:
      propertyId - the id of the property that data is about
      labels - the list of labels of this property, with at most one label for each language code
      descriptions - the list of descriptions of this property, with at most one description for each language code
      aliases - the list of aliases of this property
      statementGroups - the list of statement groups of this item; all of them must have the given itemIdValue as their subject
      datatypeId - the datatype of that property
      Returns:
      a PropertyDocument corresponding to the input
    • makePropertyDocument

      public static PropertyDocument makePropertyDocument(PropertyIdValue propertyId, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, List<StatementGroup> statementGroups, DatatypeIdValue datatypeId, long revisionId)
      Creates a PropertyDocument. It might be more convenient to use the PropertyDocumentBuilder instead.
      Parameters:
      propertyId - the id of the property that data is about
      labels - the list of labels of this property, with at most one label for each language code
      descriptions - the list of descriptions of this property, with at most one description for each language code
      aliases - the list of aliases of this property
      statementGroups - the list of statement groups of this item; all of them must have the given itemIdValue as their subject
      datatypeId - the datatype of that property
      revisionId - the revision ID or 0 if not known; see EntityDocument.getRevisionId()
      Returns:
      a PropertyDocument corresponding to the input
    • makeItemDocument

      public static ItemDocument makeItemDocument(ItemIdValue itemIdValue)
      Creates an emptyItemDocument.
      Parameters:
      itemIdValue - the id of the item that data is about
      Returns:
      an ItemDocument corresponding to the input
    • makeItemDocument

      public static ItemDocument makeItemDocument(ItemIdValue itemIdValue, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, List<StatementGroup> statementGroups, Map<String,SiteLink> siteLinks)
      Creates an ItemDocument with empty revision id. It might be more convenient to use the ItemDocumentBuilder instead.
      Parameters:
      itemIdValue - the id of the item that data is about
      labels - the list of labels of this item, with at most one label for each language code
      descriptions - the list of descriptions of this item, with at most one description for each language code
      aliases - the list of aliases of this item
      statementGroups - the list of statement groups of this item; all of them must have the given itemIdValue as their subject
      siteLinks - the sitelinks of this item by site key
      Returns:
      an ItemDocument corresponding to the input
    • makeItemDocument

      public static ItemDocument makeItemDocument(ItemIdValue itemIdValue, List<MonolingualTextValue> labels, List<MonolingualTextValue> descriptions, List<MonolingualTextValue> aliases, List<StatementGroup> statementGroups, Map<String,SiteLink> siteLinks, long revisionId)
      Creates an ItemDocument. It might be more convenient to use the ItemDocumentBuilder instead.
      Parameters:
      itemIdValue - the id of the item that data is about
      labels - the list of labels of this item, with at most one label for each language code
      descriptions - the list of descriptions of this item, with at most one description for each language code
      aliases - the list of aliases of this item
      statementGroups - the list of statement groups of this item; all of them must have the given itemIdValue as their subject
      siteLinks - the sitelinks of this item by site key
      revisionId - the revision ID or 0 if not known; see EntityDocument.getRevisionId()
      Returns:
      an ItemDocument corresponding to the input
    • makeLexemeDocument

      public static LexemeDocument makeLexemeDocument(LexemeIdValue lexemeIdValue, ItemIdValue lexicalCategory, ItemIdValue language, List<MonolingualTextValue> lemmas)
      Creates an empty LexemeDocument.
      Parameters:
      lexemeIdValue - the id of the lexeme that data is about
      lexicalCategory - 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 lexeme
      Returns:
      a LexemeDocument corresponding to the input
    • makeLexemeDocument

      public static LexemeDocument makeLexemeDocument(LexemeIdValue lexemeIdValue, ItemIdValue lexicalCategory, ItemIdValue language, List<MonolingualTextValue> lemmas, List<StatementGroup> statementGroups, List<FormDocument> forms, List<SenseDocument> senses)
      Creates a LexemeDocument.
      Parameters:
      lexemeIdValue - the id of the lexeme that data is about
      lexicalCategory - 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 lexeme
      statementGroups - the list of statement groups of this lexeme; all of them must have the given lexemeIdValue as their subject
      forms - the forms of the lexeme
      senses - the senses of the lexeme
      Returns:
      a LexemeDocument corresponding to the input
    • makeFormDocument

      public static FormDocument makeFormDocument(FormIdValue formIdValue, List<MonolingualTextValue> representations, List<ItemIdValue> grammaticalFeatures, List<StatementGroup> statementGroups)
      Creates a FormDocument. If you plan to add this form to a specific lexeme, it might be easier to use LexemeDocument.createForm(List).
      Parameters:
      formIdValue - the id of the form that data is about
      representations - the list of representations of this lexeme, with at most one lemma for each language code
      grammaticalFeatures - the grammatical features of the lexeme
      statementGroups - the list of statement groups of this lexeme; all of them must have the given lexemeIdValue as their subject
      Returns:
      a LexemeDocument corresponding to the input
    • makeSenseDocument

      public static SenseDocument makeSenseDocument(SenseIdValue senseIdValue, List<MonolingualTextValue> glosses, List<StatementGroup> statementGroups)
      Creates a SenseDocument. If you plan to add this sense to a specific lexeme, it might be easier to use LexemeDocument.createSense(List) )}.
      Parameters:
      senseIdValue - the id of the form that data is about
      glosses - the list of glosses of this lexeme, with at most one gloss for each language code
      statementGroups - the list of statement groups of this lexeme; all of them must have the given lexemeIdValue as their subject
      Returns:
      a SenseDocument corresponding to the input
    • makeMediaInfoDocument

      public static MediaInfoDocument makeMediaInfoDocument(MediaInfoIdValue mediaInfoIdValue)
      Creates an empty MediaInfoDocument.
      Parameters:
      mediaInfoIdValue - the id of the media that data is about
      Returns:
      an MediaInfoDocument corresponding to the input
    • makeMediaInfoDocument

      public static MediaInfoDocument makeMediaInfoDocument(MediaInfoIdValue mediaInfoIdValue, List<MonolingualTextValue> labels, List<StatementGroup> statementGroups)
      Parameters:
      mediaInfoIdValue - the id of the media that data is about
      labels - the list of labels of this media, with at most one label for each language code
      statementGroups - the list of statement groups of this media info; all of them must have the given mediaInfoIdValue as their subject
      Returns:
      an MediaInfoDocument corresponding to the input
    • makeTermUpdate

      public static TermUpdate makeTermUpdate(Collection<MonolingualTextValue> modified, Collection<String> removed)
      Creates new TermUpdate. It might be more convenient to use TermUpdateBuilder.
      Parameters:
      modified - added or changed values
      removed - language codes of removed values
      Returns:
      new TermUpdate
      Throws:
      NullPointerException - if any required parameter is null
      IllegalArgumentException - if any parameters or their combination is invalid
    • makeAliasUpdate

      public static AliasUpdate makeAliasUpdate(List<MonolingualTextValue> recreated, List<MonolingualTextValue> added, Collection<MonolingualTextValue> removed)
      Creates new AliasUpdate. Callers should specify either recreated parameter or added and removed parameters, because combination of the two update approaches is not possible. To remove all aliases, pass empty list in recreated parameter.

      In most cases, it is more convenient to use makeAliasUpdate(List), makeAliasUpdate(List, Collection), or AliasUpdateBuilder.

      Parameters:
      recreated - new list of aliases that completely replaces the old ones or null to not recreate aliases
      added - aliases added in this update or empty collection for no additions
      removed - aliases removed in this update or empty collection for no removals
      Returns:
      new AliasUpdate
      Throws:
      NullPointerException - if added, removed, or any alias is null
      IllegalArgumentException - if given invalid combination of parameters
    • makeAliasUpdate

      public static AliasUpdate makeAliasUpdate(List<MonolingualTextValue> recreated)
      Creates new AliasUpdate that completely replaces all aliases.
      Parameters:
      recreated - new list of aliases that completely replaces the old ones
      Returns:
      new AliasUpdate
      Throws:
      NullPointerException - if the parameter or any alias is null
      IllegalArgumentException - if language codes are inconsistent or there are alias duplicates
    • makeAliasUpdate

      public static AliasUpdate makeAliasUpdate(List<MonolingualTextValue> added, Collection<MonolingualTextValue> removed)
      Creates new AliasUpdate that adds and/or removes some of the aliases. It might be more convenient to use AliasUpdateBuilder.
      Parameters:
      added - aliases to add
      removed - aliases to remove
      Returns:
      new AliasUpdate
      Throws:
      NullPointerException - if any parameter or any alias is null
      IllegalArgumentException - if language codes are inconsistent or there are alias duplicates
    • makeStatementUpdate

      public static StatementUpdate makeStatementUpdate(Collection<Statement> added, Collection<Statement> replaced, Collection<String> removed)
      Creates new StatementUpdate. It might be more convenient to use StatementUpdateBuilder.
      Parameters:
      added - added statements
      replaced - replaced statements
      removed - IDs of removed statements
      Returns:
      new StatementUpdate
      Throws:
      NullPointerException - if any required parameter is null
      IllegalArgumentException - if any parameters or their combination is invalid
    • makeSenseUpdate

      public static SenseUpdate makeSenseUpdate(SenseIdValue entityId, long revisionId, TermUpdate glosses, StatementUpdate statements)
      Creates new SenseUpdate. It might be more convenient to use SenseUpdateBuilder.
      Parameters:
      entityId - ID of the sense that is to be updated
      revisionId - base sense revision to be updated or zero if not available
      glosses - changes in sense glosses or null for no change
      statements - changes in entity statements, possibly empty
      Returns:
      new SenseUpdate
      Throws:
      NullPointerException - if any required parameter is null
      IllegalArgumentException - if any parameters or their combination is invalid
    • makeFormUpdate

      public static FormUpdate makeFormUpdate(FormIdValue entityId, long revisionId, TermUpdate representations, Collection<ItemIdValue> grammaticalFeatures, StatementUpdate statements)
      Creates new FormUpdate. It might be more convenient to use FormUpdateBuilder.
      Parameters:
      entityId - ID of the form that is to be updated
      revisionId - base form revision to be updated or zero if not available
      representations - changes in form representations or null for no change
      grammaticalFeatures - new grammatical features of the form or null for no change
      statements - changes in entity statements, possibly empty
      Returns:
      new FormUpdate
      Throws:
      NullPointerException - if any required parameter is null
      IllegalArgumentException - if any parameters or their combination is invalid
    • makeLexemeUpdate

      public static LexemeUpdate makeLexemeUpdate(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 new LexemeUpdate. It might be more convenient to use LexemeUpdateBuilder.
      Parameters:
      entityId - ID of the lexeme that is to be updated
      revisionId - base lexeme revision to be updated or zero if not available
      language - new lexeme language or null for no change
      lexicalCategory - new lexical category of the lexeme or null for no change
      lemmas - changes in lemmas or null for no change
      statements - changes in entity statements, possibly empty
      addedSenses - added senses
      updatedSenses - updated senses
      removedSenses - IDs of removed senses
      addedForms - added forms
      updatedForms - updated forms
      removedForms - IDs of removed forms
      Returns:
      new LexemeUpdate
      Throws:
      NullPointerException - if any required parameter is null
      IllegalArgumentException - if any parameters or their combination is invalid
    • makeMediaInfoUpdate

      public static MediaInfoUpdate makeMediaInfoUpdate(MediaInfoIdValue entityId, long revisionId, TermUpdate labels, StatementUpdate statements)
      Creates new MediaInfoUpdate. It might be more convenient to use MediaInfoUpdateBuilder.
      Parameters:
      entityId - ID of the media that is to be updated
      revisionId - base media revision to be updated or zero if not available
      labels - changes in entity labels or null for no change
      statements - changes in entity statements, possibly empty
      Returns:
      new MediaInfoUpdate
      Throws:
      NullPointerException - if any required parameter is null
      IllegalArgumentException - if any parameters or their combination is invalid
    • makeItemUpdate

      public static ItemUpdate makeItemUpdate(ItemIdValue entityId, long revisionId, TermUpdate labels, TermUpdate descriptions, Map<String,AliasUpdate> aliases, StatementUpdate statements, Collection<SiteLink> modifiedSiteLinks, Collection<String> removedSiteLinks)
      Creates new ItemUpdate. It might be more convenient to use ItemUpdateBuilder.
      Parameters:
      entityId - ID of the item that is to be updated
      revisionId - base item revision to be updated or zero if not available
      labels - changes in entity labels or null for no change
      descriptions - changes in entity descriptions or null for no change
      aliases - changes in entity aliases, possibly empty
      statements - changes in entity statements, possibly empty
      modifiedSiteLinks - added or replaced site links
      removedSiteLinks - site keys of removed site links
      Returns:
      new ItemUpdate
      Throws:
      NullPointerException - if any required parameter is null
      IllegalArgumentException - if any parameters or their combination is invalid
    • makePropertyUpdate

      public static PropertyUpdate makePropertyUpdate(PropertyIdValue entityId, long revisionId, TermUpdate labels, TermUpdate descriptions, Map<String,AliasUpdate> aliases, StatementUpdate statements)
      Creates new PropertyUpdate. It might be more convenient to use PropertyUpdateBuilder.
      Parameters:
      entityId - ID of the property entity that is to be updated
      revisionId - base property revision to be updated or zero if not available
      labels - changes in entity labels or null for no change
      descriptions - changes in entity descriptions or null for no change
      aliases - changes in entity aliases, possibly empty
      statements - changes in entity statements, possibly empty
      Returns:
      new PropertyUpdate
      Throws:
      NullPointerException - if any required parameter is null
      IllegalArgumentException - if any parameters or their combination is invalid