Package org.openrefine.wikidata.updates
Class ItemEditBuilder
java.lang.Object
org.openrefine.wikidata.updates.ItemEditBuilder
Constructs a
ItemEdit incrementally.- Author:
- Antonin Delpeuch
-
Constructor Summary
ConstructorsConstructorDescriptionItemEditBuilder(org.wikidata.wdtk.datamodel.interfaces.EntityIdValue id) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddAlias(org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue alias) Adds an alias to the item.addAliases(Set<org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> aliases) Adds a list of aliases to the item.addDescription(org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue description, boolean override) Adds a description to the item.addDescriptions(Set<org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> descriptions, boolean override) Adds a list of descriptions to the item.addLabel(org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue label, boolean override) Adds a label to the entity.addLabels(Set<org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> labels, boolean override) Adds a list of labels to the entity.addStatement(StatementEdit statement) Adds an update to a statement.addStatements(List<StatementEdit> statements) Add a list of statement, as inaddStatement(org.openrefine.wikidata.updates.StatementEdit).build()Constructs theItemEdit.
-
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
Adds an update to a statement.- Parameters:
statement- the statement to add or update
-
addStatements
Add a list of statement, as inaddStatement(org.openrefine.wikidata.updates.StatementEdit).- 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 addoverride- 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 addoverride- 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 addoverride- 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 addoverride- whether the description should be added even if there is already a description in that language
-
addAlias
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
Constructs theItemEdit.- Returns:
-