Tpt added a comment.

@Tpt so it looks like right now you can't get a datavalue or recursively call item from a statement. I added a sample query to the task description.

It's actually possible:

Example with the string data type: https://tools.wmflabs.org/tptools/wdql.html?query=%7B%0A%20%20champollion%3A%20item(id%3A%20%22Q260%22)%20%7B%0A%20%20%20%20statements(propertyIds%3A%20%22P214%22)%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20rank%0A%20%20%20%20%20%20mainsnak%20%7B%0A%20%20%20%20%20%20%20%20...%20on%20PropertyValueSnak%20%7B%0A%20%20%20%20%20%20%20%20%20%20property%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20%20%20%20%20datatype%0A%20%20%20%20%20%20%20%20%20%20%20%20label%3A%20label(language%3A%20%22en%22)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20value%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20type%0A%20%20%20%20%20%20%20%20%20%20%20%20...%20on%20StringValue%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20value%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A

Example with items: https://tools.wmflabs.org/tptools/wdql.html?query=%7B%0A%20%20champollion%3A%20item(id%3A%20%22Q260%22)%20%7B%0A%20%20%20%20statements(propertyIds%3A%20%22P31%22)%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20rank%0A%20%20%20%20%20%20mainsnak%20%7B%0A%20%20%20%20%20%20%20%20...%20on%20PropertyValueSnak%20%7B%0A%20%20%20%20%20%20%20%20%20%20property%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20%20%20%20%20datatype%0A%20%20%20%20%20%20%20%20%20%20%20%20label%3A%20label(language%3A%20%22en%22)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20value%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20type%0A%20%20%20%20%20%20%20%20%20%20%20%20...%20on%20Item%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20label%3A%20label(language%3A%20%22en%22)%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20text%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20references%20%7B%0A%20%20%20%20%20%20%20%20hash%0A%20%20%20%20%20%20%20%20snaks(propertyIds%3A%20%5B%22P143%22%5D)%20%7B%0A%20%20%20%20%20%20%20%20%20%20type%0A%20%20%20%20%20%20%20%20%20%20...%20on%20PropertyValueSnak%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20value%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20...%20on%20Entity%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A

These examples are using the GraphQL ... on Type feature. We could maybe avoid this dispatching for DataValues if we encode in the schema the data type for each Wikidata property. But it would have the strong disadvantage to have to rebuild the GraphQL schema each time a Wikibase property is added or removed or when its datatype changes. The GraphQL schema would also be different between Wikibase instances.


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

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

To: Tpt
Cc: Addshore, larsgw, Saerdnaer, simon04, bearND, Siznax, Tpt, Jonas, Ricordisamoa, hoo, Lucas_Werkmeister_WMDE, Aklapper, dbarratt, PokestarFan, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to