Skip to content

Github mirror of "wikidata/propertysuggester/RecommenderServer" - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing)

License

Notifications You must be signed in to change notification settings

wikimedia/wikidata-propertysuggester-RecommenderServer

License: GPL v3

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.

Installation

  1. Install the go runtime (and VS Code + Golang tools)
  2. Run go get . in this folder to install all dependencies
  3. Run go build . in this folder to build the executable
  4. Run go install . to install the executable in the $PATH

Example

# 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

Setting up on Cloud VPS

Prerequisites

  1. Docker
  2. Blubber

Cloning the RecommenderServer

sudo su
mkdir /etc/docker-compose
cd /etc/docker-compose
git clone https://github.com/martaannaj/RecommenderServer.git recommenderserver

Building the images

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

Setup as systemd service

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.

using TLS

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.

About

Github mirror of "wikidata/propertysuggester/RecommenderServer" - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing)

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •