Lucas_Werkmeister_WMDE added a comment.

  The simplest API we can use for this is `wbsetclaimvalue`: 
`action=wbsetclaimvalue&claim=ID&value="VALUE"&snaktype=value&token=TOKEN`. 
However, this won’t work when we want to edit qualifiers or references later, 
or want to support edit flows that edit one or more statements. For that, we’ll 
need to use `wbeditentity`. And I think we should consider using that module 
right away – we don’t need to send it the full entity data, this is a working 
example for the `data` parameter:
  
    
{"claims":{"P236":[{"type":"statement","id":"Q50$fc414696-44fa-0942-e531-95f315e7c0bb","mainsnak":{"snaktype":"value","property":"P236","datavalue":{"type":"string","value":"7722dd"}}}]}}
  
  We only need the property ID, statement ID, and value (assuming that “main 
snak”, “custom value”, and “string” are hard-coded limitations for the time 
being) – barely more than for `wbsetclaimvalue`. Currently, `wbeditentity` 
results in less useful edit summaries, but that’s already being improved 
independent of this task (see T220696 
<https://phabricator.wikimedia.org/T220696>).
  
  One drawback of `wbeditentity` is that it responds with the full new entity 
data, which is wasted bandwidth for us (we’re about to reload the page 
anyways). Perhaps we should add a parameter to control/reduce the response – I 
assume there are other users that don’t need the full response either.

TASK DETAIL
  https://phabricator.wikimedia.org/T226999

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Lucas_Werkmeister_WMDE, Aklapper, darthmon_wmde, Nandana, Sario528, Lahi, 
Gq86, GoranSMilovanovic, QZanden, LawExplorer, _jensen, rosalieper, 
Wikidata-bugs, aude, Lydia_Pintscher, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to