Class ItemEditBuilder


  • public class ItemEditBuilder
    extends Object
    Constructs a ItemEdit incrementally.
    Author:
    Antonin Delpeuch
    • Constructor Detail

      • ItemEditBuilder

        public ItemEditBuilder​(org.wikidata.wdtk.datamodel.interfaces.EntityIdValue id)
        Constructor.
        Parameters:
        id - the subject of the document. It can be a reconciled entity value for new entities.
    • Method Detail

      • addStatement

        public ItemEditBuilder addStatement​(StatementEdit statement)
        Adds an update to a statement.
        Parameters:
        statement - the statement to add or update
      • addLabel

        public ItemEditBuilder addLabel​(org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue label,
                                        boolean override)
        Adds a label to the entity.
        Parameters:
        label - the label to add
        override - whether the label should be added even if there is already a label in that language
      • addLabels

        public ItemEditBuilder addLabels​(Set<org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> labels,
                                         boolean override)
        Adds a list of labels to the entity.
        Parameters:
        labels - the labels to add
        override - whether the label should be added even if there is already a label in that language
      • addDescription

        public ItemEditBuilder addDescription​(org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue description,
                                              boolean override)
        Adds a description to the item.
        Parameters:
        description - the description to add
        override - whether the description should be added even if there is already a description in that language
      • addDescriptions

        public ItemEditBuilder addDescriptions​(Set<org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> descriptions,
                                               boolean override)
        Adds a list of descriptions to the item.
        Parameters:
        descriptions - the descriptions to add
        override - whether the description should be added even if there is already a description in that language
      • addAlias

        public ItemEditBuilder addAlias​(org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue alias)
        Adds an alias to the item. It will be added to any existing aliases in that language.
        Parameters:
        alias - the alias to add
      • addAliases

        public ItemEditBuilder addAliases​(Set<org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> aliases)
        Adds a list of aliases to the item. They will be added to any existing aliases in each language.
        Parameters:
        aliases - the aliases to add
      • addContributingRowId

        public ItemEditBuilder addContributingRowId​(long rowId)
        Adds a row id which contributed to this update.
      • addContributingRowIds

        public ItemEditBuilder addContributingRowIds​(Collection<Long> rowIds)
        Adds a collection of row ids which contributed to this update.