This is the implementation of a Property Recommender Server for wikibase. It can be used to serve the index as generated by https://github.com/lgleim/SchemaTreeRecommender.
If you find any security vulnerabilities in this project, please read SECURITY.md for instructions. Other requests, such as feature requests, or suggestions can be filed on github. We are also happy receiving pull requests. If your request is regarding the creation of the index, please file your issue at https://github.com/lgleim/SchemaTreeRecommender.
- Install the go runtime (and VS Code + Golang tools)
- Run
go get .
in this folder to install all dependencies - Run
go build .
in this folder to build the executable - Run
go install .
to install the executable in the $PATH
# Start the server
# (TODO: add information about workflow strategies)
./RecommenderServer serve ./testdata/latest-truthy-item-filtered-sorted.nt.gz.schemaTree.typed.bin
# Test with a request
curl -d '{"properties":["local://prop/Color"],"types":[]}' http://localhost:8080/lean-recommender
- Docker
- Blubber
sudo su
mkdir /etc/docker-compose
cd /etc/docker-compose
git clone https://github.com/martaannaj/RecommenderServer.git recommenderserver
This will build the two images: recommenderserver and recommenderserver-test
./blubber-build.sh
Or pulling the latest recommenderserver image from Docker Hub
pull martaannaj/recommenderserver
The docker-compose.yml
within this repository assumes that the image used is the one pulled from Docker hub.
sudo su
cat << EOF > /etc/systemd/system/docker-compose\@.service
[Unit]
Description=docker-compose %i service
Requires=docker.service network-online.target
After=docker.service network-online.target
[Service]
WorkingDirectory=/etc/docker-compose/%i
Type=simple
TimeoutStartSec=900
Restart=always
ExecStart=/usr/bin/docker-compose up
ExecStop=/usr/bin/docker-compose down
[Install]
WantedBy=multi-user.target
EOF
systemctl enable docker-compose@recommenderserver
systemctl start docker-compose@recommenderserver
With the docker-compose.yml
in this repository this should have the service running on port 8771.
In an untrusted environment, one shall use TLS to protect the network traffic to and from this recommender server. To use TLS, use the cert and key options to specify the location of the certificate file and the location of the private key file.
semgrep raises a warning for the fact that this server has the option to run without TLS. This warning has been suppressed.