Hi!
We have deployed the first iteration of Mediawiki API[1] support for Wikidata Query Service. Please see the manual[2] for the full documentation, below outlined are the main highlights.
The service allows to call out to some Mediawiki APIs from SPARQL in order to obtain information not contained in RDF data and WDQS database. See the list of the supported APIs in the manual[2].
Currently a small subset of existing APIs is supported, and we expect the community to nominate more services and contribute service templates to extend the API. Please see the manual for description of service templates. Note that we do not plan to support any APIs that modify data, edit wikis, etc. - only read-only querying APIs and only APIs that do not require any authorization can be supported.
Currently supported hosts are: *.wikipedia.org, commons.wikimedia.org, www.mediawiki.org, www.wikidata.org, test.wikidata.org. If any other wikis need to be supported, please leave a comment to the developers[3] and we will enable them.
Example service query (more in the docs):
SELECT * WHERE { SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "EntitySearch" . bd:serviceParam wikibase:endpoint "www.wikidata.org" . bd:serviceParam mwapi:search "cheese" . bd:serviceParam mwapi:language "en" . ?item wikibase:apiOutputItem mwapi:item . } ?item (wdt:P279|wdt:P31) ?type }
If there are any problems or questions, please contact the developers on the list, #wikidata on IRC, or on wiki[3], or submit a Phabricator issue.
TODOs:
* Add more services (nominations welcome) * Support services that accept multiple titles as input in one query * Implement parameter types
[1] https://www.mediawiki.org/wiki/API:Main_page [2] https://www.mediawiki.org/wiki/Wikidata_query_service/User_Manual/MWAPI [3] https://www.wikidata.org/wiki/Wikidata:Contact_the_development_team