Project:CorrectSimplePropertyProblems
From MaRDI portal
If there are properties that have the wrong value, this can be corrected in the following way:
First, get a list of all affected QIDs, for example using SPARQL. Then adapt the following script that shows how to replace the value of a property for an item. The value replace_all should only be used when there is only one value for that property, otherwise the correct value would be append_or_replace.
from mardiclient import MardiClient
mc = MardiClient(user=NAME, password=PW)
qid=QID
item = mc.item.get(entity_id=qid)
item.add_claim("PROPERTY_ID", "VALUE", action="replace_all")
item.write()