Page MenuHomePhabricator

[ES-M2]: Investigate if `wbformatvalue` works for EntitySchema data values
Open, Needs TriagePublic

Description

In a quick test using the Action API wbformatvalue doesn’t seem to be working for EntitySchema data values and returns the message: “An illegal set of parameters have been used”

We need to investigate if wbformatvalue works for EntitySchema data values or if the test wasn't properly executed.

Acceptance Crieteria

  • Document correct steps to return the correct message if it is working

OR

  • Identify the bug which is causing this issue

Notes
This could be as a result of the same issue as T362003

Event Timeline

I would expect the datavalue {"value":{"id":"E1"},"type":"wikibase-entityid"} to work, when property is set to the property ID of a property with data type EntitySchema. (For comparison, for item properties, {"value":{"id":"Q1"},"type":"wikibase-entityid"} works.)

Change #1019275 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/extensions/EntitySchema@master] [WIP] Sketch entity-schema entity-id registration

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

This was / is not working - @Lucas_Werkmeister_WMDE expectations are correct. I've made a sketch of a patch that makes wbformatvalue work with the example that Lucas provides. The JSON returned in this case is:

{
    "result": "E1"
}

but I need to tidy up the registration and add some tests.

Change #1019755 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/extensions/Wikibase@master] [WIP] Extend the DataType registration to include entity builder

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

Change #1019758 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/extensions/EntitySchema@master] [WIP] Extend the DataType registration to include entity builder

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

Change #1019817 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] WIP: Use snak deserializer in FormatSnakValue

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

Change #1019818 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/EntitySchema@master] WIP: Make wbformatvalue work

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

Change #1019758 abandoned by Arthur taylor:

[mediawiki/extensions/EntitySchema@master] [WIP] Extend the DataType registration to include entity builder

Reason:

Based on obsolete patches

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

Change #1019755 abandoned by Arthur taylor:

[mediawiki/extensions/Wikibase@master] [WIP] Extend the DataType registration to include entity builder

Reason:

Based on abandoned patches

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

Change #1019275 abandoned by Arthur taylor:

[mediawiki/extensions/EntitySchema@master] [WIP] Sketch entity-schema entity-id registration

Reason:

Wrong approach here

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

Got some updated patches from @Jakob_WMDE this morning. Using those, plus the latest changes from @Lucas_Werkmeister_WMDE - 1019818 and 1019817 - we are able to make some wbformatvalue requests work:

2024-04-16-110643_697x586_scrot.png (586×697 px, 51 KB)

Note that the specified property must be of EntitySchema Data Type.

With the current set of patches (also with Lucas' changes), setting datatype=entity-schema does not work and generates the error An illegal set of parameters have been used.

Thanks for spotting this issue! We had wbformatvalue on our radar as well. Getting it to work as long as datatype or property are provided should be straightforward. I'll make a patch!

I guess we'll have to figure out if requiring datatype or property for these kinds of values is an acceptable compromise or if we need to look into making it work without those.

Change #1020193 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/Wikibase@master] Make FormatValue work with data specific value parsers

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

Change #1020197 had a related patch set uploaded (by Arthur taylor; author: Arthur taylor):

[mediawiki/extensions/EntitySchema@master] [WIP] Add API test for wbformatvalue

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

great - thanks @Jakob_WMDE . I added a test in 1020197 for wbformatvalue from the EntitySchema extension, and it seems to pass for both cases.

Change #1019817 abandoned by Lucas Werkmeister (WMDE):

[mediawiki/extensions/Wikibase@master] WIP: Use snak deserializer in FormatSnakValue

Reason:

superseded by I7bcac030d7

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

Change #1019818 abandoned by Lucas Werkmeister (WMDE):

[mediawiki/extensions/EntitySchema@master] WIP: Make wbformatvalue work

Reason:

already done in PS8 of Ie3d4350ed0

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

Change #1020193 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Make FormatValue work with data type specific value parsers

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