QueryR API is an application that provides a REST webservice for accessing Wikibase data.
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 code
index.php
: production entry pointapp/
: contains configuration and all framework (Silex) dependent code
bootstrap.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 clutter routes.php
src/
: contains framework agnostic code
ApiFactory.php
: top level factory and service locator (used by Integration tests)UseCases/
: one directory per use casecomposer.json
tests/
: tests mirror the directory and namespace structure of the production code
Unit/
: 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/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)/properties/$id
default response format:
label_url
(required string)description_url
(required string)aliases_url
(required string)wikidata_url
(required string)data
(required map)data
top level element in the item response format now indexes by property id rather than property labelproperty
(required map) to statement serializationwikibase-entityid
now get turned into a map with label
, id
and url
rather than into a string/items/$id/data/$property_label
to /items/$id/data/$property_id