How to modify an existing wikibase/wikidata item? #328
-
Is there an example for modifying a few properties of an existing item somewhere? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hello @WolfgangFahl , If you use v0.12.x, you can check my recent project wd-population: Between line 100 and 101, you have and update of ranks for all P1082 claims. At line 104, you have the insertion of a new claim P1082, of type Quantity, property P1082, with references (line 49-53) and qualifiers (line 44-47) and the rank. |
Beta Was this translation helpful? Give feedback.
-
@LeMyst Thank you for your swift response: _If you use v0.12.x, _ ... no i don't since it's not been released on pypi. The key line seems to wb_item = ItemEntity(api=wbi).get(id_item) where the existing item is fetched. |
Beta Was this translation helpful? Give feedback.
-
If you use v0.11, you can check the /test/ folder in the "master" branch. instance_of_append = wbi_datatype.ItemID(prop_nr='P31', value='Q1234', if_exists='APPEND')
item = wbi_core.ItemEngine(item_id="Q2", data=[instance_of_append])
item.write() I didn't use v0.11 since months ago, I maybe forgot some parameters |
Beta Was this translation helpful? Give feedback.
If you use v0.11, you can check the /test/ folder in the "master" branch.
Like in https://github.com/LeMyst/WikibaseIntegrator/blob/master/test/test_wbi_core.py (line 36 per exemple)
I didn't use v0.11 since months ago, I maybe forgot some parameters