Page MenuHomePhabricator

Investigation: Create a proof of concept making wbsetclaim API work with editing statements of forms
Closed, ResolvedPublic

Description

This is about creating a proof of concept of the solution that would allow to use the "universal" statement-editing API wbsetclaim to edit statements of Forms. This is about an approach where Forms are not EntityDocuments, and FormIds are not EntityIds.

Doing this would most likely include:

  • getting all data needed from the API input. This would include: ID of the lexeme to be worked on. ID of the form in question. ID of the statement/claim
  • generating a ChangeOp that would be applied on the Lexeme entity, and do the desired change, to the needed form of this Lexeme.
  • making it possible to use/inject/etc WikibaseLexeme-specific code in wbsetclaim. This is probably not the last step, but something which wraps the whole work involved here.

This is about the backend code only. It seems that making UI work with the API to be able to edit statements of Forms does not require investigation, and is rather generic and fairly straightforward problem.

The result of this investigation should not be code covering all cases. It should allow though to assess whether the "Form is not an Entity" approach is applicable in this case, or is it make it all so cumbersome, that should not be used. Also as the result of the investigation are places that need to be handle for new kinds of "entities" (forms, senses), e.g. "parsing" API input, ChangeOps, generating API response, error handling, generating edit summaries, etc should be recognized.
As a result of the investigation, we are going to be ready to decide on the details of the implementation, and the actual implementation will follow shortly

  • Timebox: 4 hours
  • Outcome: Presentation and evaluation of results

Details

Related Gerrit Patches:

Related Objects

Event Timeline

WMDE-leszek moved this task from Proposed to Backlog on the Wikidata-Former-Sprint-Board board.

Change 388442 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] [WIP] Prepare SetClaim API to work with statements on forms.

https://gerrit.wikimedia.org/r/388442

Franziska_Heine renamed this task from Investigation: Create a proof of concept making wbsetclaim API work with editing statements of forms to *** Investigation: Create a proof of concept making wbsetclaim API work with editing statements of forms.Nov 7 2017, 8:25 AM
Franziska_Heine renamed this task from *** Investigation: Create a proof of concept making wbsetclaim API work with editing statements of forms to Investigation: Create a proof of concept making wbsetclaim API work with editing statements of forms.
WMDE-leszek moved this task from Review to Backlog on the Wikidata-Sprint-2017-11-07 board.
WMDE-leszek added a subscriber: daniel.

Results of the investigation, following the discussion @Ladsgroup, @Jakob_WMDE, @Jonas, @thiemowmde, @daniel, and @WMDE-leszek took part in:

  • We are going to implement T163724 using the concept of making Forms implementing EntityDocument interface, and FormId being HierarchicalFormIds. @thiemowmde and others: could you please create relevant sub-tasks (a.k.a. provide task break down) to T163724? Possibly, this means using T163724 and friends but I am not sure how good they fit to the actual implementation. I'd prefer to create new tasks if existing ones are not 100% accurate than saving couple of minutes and try to "re-use" existing tickets which are kind of accurate but not exactly
    • If all items of Wikidata-Sprint-2017-11-07 are finished and there is still time left in the iteration, we are going to do an alternative implementation where no changes to the Data Model library are made. This does not mean doing exactly what T179662 made, but making "proper" implementation (not a proof of concept).

Should there be two implementations in place, we might be able to say more about the possible decisions about the general design involved here. It should not be missed, that API classes is not the only place where "sub-entities" like Forms are going to be used, though, so such comparison is not going to reveal the whole picture neither provide the overview of ALL changes that would need to be done regarding other stories and use cases.

Change 388442 abandoned by WMDE-leszek:
[WIP] Prepare SetClaim API to work with statements on forms.

Reason:
Was just a proof of concept

https://gerrit.wikimedia.org/r/388442