QueryR API is an application that provides a REST webservice for accessing Wikibase data.
- PHP >= 7
- php5-sqlite (only needed for running the tests)
composer install
cp app/config/db-example.json app/config/db.json
The database schema can be initialized via the install command of the Replicator CLI tool.
For development
cd web
php -S localhost:8000
For production, see the Silex documentation on webserver configuration.
This REST API is self documenting. Hit the root endpoint to get a list of available endpoints.
For tests only
composer test
For style checks only
composer cs
For a full CI run
composer ci
When accessing the API via web/index.dev.php
, profiling information will be generated and in
app/cache/profiler
. You can access the profiler UI via index.dev.php/_profiler
.
web/
: web accessible codeindex.php
: production entry point
app/
: contains configuration and all framework (Silex) dependent codebootstrap.php
: framework application bootstrap (used by System tests)routes.php
: defines the routes and their handlersEndpoints/
: some of the route handlers have a dedicated file here to not clutterroutes.php
src/
: contains framework agnostic codeApiFactory.php
: top level factory and service locator (used by Integration tests)UseCases/
: one directory per use case- Dependencies on Symfony Components are explicitly defined in
composer.json
tests/
: tests mirror the directory and namespace structure of the production codeUnit/
: small isolated tests (cannot access app, db or framework)Integration/
: tests combining several units (cannot access framework)System/
: edge-to-edge testsTestEnvironment.php
: encapsulates application setup for integration and system testsFixtures/
: test stubs and spies
- Elements in the data section of the item and property GET response are now ordered by property id
- Invalid item and property ids now cause a 400 response code instead of a 404 one
- Added top level elements to GET
/items/$id
default response format:label_url
(required string)description_url
(required string)aliases_url
(required string)wikidata_url
(required string)wikipedia_html_url
(optional string)
- Added top level elements to GET
/properties/$id
default response format:label_url
(required string)description_url
(required string)aliases_url
(required string)wikidata_url
(required string)data
(required map)
- The
data
top level element in the item response format now indexes by property id rather than property label - Added
property
(required map) to statement serialization - Values of type
wikibase-entityid
now get turned into a map withlabel
,id
andurl
rather than into a string - Changed GET
/items/$id/data/$property_label
to/items/$id/data/$property_id
- Initial release