User:TiagoLubiana/Wikidata Integrator
Personal notes for using Wikidata Integrator efficiently.
fast-run mode:
If there are no changes to the item in relation to the database, no updates are made. If there is at least 1 change, all items are updated (and their references).
How to not update references when performing an update
wd_item = wdi_core.WDItemEngine(
data=data,
append_value=properties_to_append_value,
fast_run=True,
fast_run_base_filter=fast_run_base_filter,
debug=True,
)
How to append a statement to a property (instead of replacing all values) edit
See parameters in https://github.com/SuLab/WikidataIntegrator/blob/main/wikidataintegrator/wdi_core.py#L304.
properties_to_append_value = [
"P31",
"P703",
"P680",
"P681",
"P682",
"P527"
]
wd_item = wdi_core.WDItemEngine(data=data, append_value=properties_to_append_value)
How to delete a all statements for a property: edit
Deletes all P703 statements of QXXXX:
data = [wdi_core.WDBaseDataType.delete_statement('P703')]
wdi_core.WDItemEngine(wd_item_id="QXXXX", data=data)