Class ItemEditBuilder

java.lang.Object
org.openrefine.wikidata.updates.ItemEditBuilder

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

    • 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 Details

    • addStatement

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

      public ItemEditBuilder addStatements(List<StatementEdit> statements)
      Parameters:
      statements - the statements to add
    • 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
    • build

      public ItemEdit build()
      Constructs the ItemEdit.
      Returns: