Page MenuHomePhabricator

API Endpoint to search for Schemas
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where):
I would like to use MediaWiki's API to search for schemas in a Wikibase, just as it is possible to search for entities, properties, etc. through wbsearchentities. As far as I can tell, the API docs do not mention any operation similar to the one proposed.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
I'm participating in the development of Wikishape and one of the tools allows users to analyze Wikidata schemas. We would like to suggest schemas as you type in their names (like we do with entities here), however this is not possible without tricks because there is no way to search for schemas by label.
Maybe a new value "schema" could be added to the type parameter in wbsearchentities.

Benefits (why should this be implemented?):
Working programmatically with Wikidata or any other Wikibase instance in general would be way easier and better tools could be created.

Event Timeline

The regular search API works for schemas, at least (example), though admittedly that’s not as well suited for a “type-ahead search” as wbsearchentities is.

Thanks for the quick reply.

Searching for schemas like that is actually useful and something we did not know about, although (as you mentioned) it does not exactly fit our use case.
Is there any way to return the schema labels and/or descriptions in the search results?

EBernhardson subscribed.

Removing ApiFeatureUsage, that project is specifically about usage of api.php in mediawiki