valerio.bozzolan created this task. valerio.bozzolan added a project: wikiba.se. Restricted Application added a subscriber: Aklapper. |
TASK DESCRIPTION
Actually, the wbeditentity API can be used to create multiple claims in a single call. It can also be used to remove multiple claims in a single call. Sadly, it seems that can't be used to both create and delete some claims in a single API request.
Actual situation
If you want to add multiple claims this is the data argument:
{ "claims": { "P123": [ { claim to be added }, { claim to be added }, ], "P234": [ { claim to be added }, ], // ecc. } }
If you want to remove multiple claims this is the data argument:
{ "claims": [ { id: "ID claim to be removed", remove: 1 }, { id: "ID claim to be removed", remove: 1 }, // ecc. ] }As you see, there is an inconsistence:
- The first claims contains an object indexed by properties that contains an array of claims
- The second claims contains directly an array of claims to be removed
My suggestion is to avoid these differences. For example, allowing this format:
{ "claims": { "P123": [ { claim to be added }, { claim to be added }, ], "delete": [ { id: "ID claim to be removed", remove: 1 }, { id: "ID claim to be removed", remove: 1 }, ], } }
TASK DETAIL
EMAIL PREFERENCES
To: valerio.bozzolan
Cc: valerio.bozzolan, Aklapper, Wikidata-bugs
Cc: valerio.bozzolan, Aklapper, Wikidata-bugs
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs