Context
Wikibase docker bundle uses wikibase.svc as an alias for wikibase service. It is bound to port number 8181, and one can access wikibase instance locally
by navigating to http://localhost:8181, or after mapping wikibase.svc to loopback (in /etc/hosts in unix) by navigating to http://wikibase.svc:8181.
That alias wikibase.svc is used in other services in the bundle, like wdqs-frontend (https://github.com/wmde/wikibase-docker/blob/master/docker-compose.yml#L75) and wdqs (https://github.com/wmde/wikibase-docker/blob/master/docker-compose.yml#L87), to communicate with wikibase apis inside docker's internal network. That works because in the internal network, wikibase service is bound to port 80, so calling http://wikibase.svc would reach the backend successfully.
Problem
As a result of configuring WIKIBASE_HOST=wikibase.svc on wdqs and wdqs-frontend services, the urls that are created for entities in query results are mapped to the domain http://wikibase.svc/.... Those urls, when clocked on, will not resolve properly as we are visiting them externally, and wikibase.svc is there's no service listening on port 80 that can capture that server name.
Steps to reproduce
- check out https://github.com/wmde/wikibase-docker and boot it up with docker-compose up -d.
- navigate to wikibase instance http://localhost:8181 and create a property and an entity.. attach that new property to the new entity with any value.
- navigate to query service front-end http://localhost:8282 and run the following query (replace <new property id> with the new property id that you created in 2:
SELECT ?item ?itemLabel WHERE { ?item wdt:P<new property id> ?value SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } LIMIT 10
- you should see your new item appearing in the results
- click on the item label/id in the results
Suggested next steps
- Check whether those links in query results come from wdqs-frontend or wdqs service (who generates them and how)
- Check if there's a reasonable way to make those links in query results resolve with the default setup. One possibility is to configuring the service generating those links with another variable that tells it what base url to use, and use it (for instance, one then can say WIKIBASE_EXTERNAL_URL=localhost:8181)