-
If you look at the wikidata article for Human (https://www.wikidata.org/wiki/Q5), you will see that human is a subclass of mammal and a subclass of person. If I try to add multiple subclasses or multiple claims of any other property with Wikibaseintegrator, it always overwrites all of them except one. Here is an example for adding subclass mammal and person. entity.claims.add(datatypes.Item(value='Q110551885', prop_nr='P279')) This will not add the subclass (P279) of Q110551885, only the last one Q215627. In the JSON you can see why. It adds P279 as a key, so it's only possible to add a single one. But as you can see in my example from Wikidata, it is supported in Wikidata itself. 'P279': [{'mainsnak': {'snaktype': 'value', 'property': 'P279', 'datatype': 'wikibase-item', 'datavalue': {'value': {'entity-type': 'item', 'numeric-id': 215627, 'id': 'Q215627'}, 'type': 'wikibase-entityid'}}, 'type': 'statement', 'rank': 'normal'}] |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found it in the code. It looks like I need to use entity.add_claims instead of entity.claims.add. |
Beta Was this translation helpful? Give feedback.
I found it in the code. It looks like I need to use entity.add_claims instead of entity.claims.add.