{"id":13557518,"url":"https://github.com/slub/efre-lod-api","last_synced_at":"2025-04-11T22:40:37.542Z","repository":{"id":41279385,"uuid":"177129542","full_name":"slub/efre-lod-api","owner":"slub","description":"Flask API to access the elasticsearch-data transformed by efre-lod-elasticsearch tools and use it for openrefine-reconcilation","archived":false,"fork":false,"pushed_at":"2024-04-26T09:33:09.000Z","size":3798,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-25T18:41:01.552Z","etag":null,"topics":["bjoern","elasticsearch","flask","flask-restplus","json","openrefine","openrefine-api","python3","rdflib"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-22T11:39:02.000Z","updated_at":"2024-04-26T09:33:08.000Z","dependencies_parsed_at":"2024-11-04T07:31:44.706Z","dependency_job_id":"3a5b8ece-f547-4513-81eb-e4be5821ad20","html_url":"https://github.com/slub/efre-lod-api","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slub%2Fefre-lod-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slub%2Fefre-lod-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slub%2Fefre-lod-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slub%2Fefre-lod-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slub","download_url":"https://codeload.github.com/slub/efre-lod-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248493011,"owners_count":21113159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bjoern","elasticsearch","flask","flask-restplus","json","openrefine","openrefine-api","python3","rdflib"],"created_at":"2024-08-01T12:04:23.846Z","updated_at":"2025-04-11T22:40:37.513Z","avatar_url":"https://github.com/slub.png","language":"Python","funding_links":[],"categories":["Python","flask"],"sub_categories":[],"readme":"\u003cimg alt=\"EFRE-Lod logo\" src=\"https://raw.githubusercontent.com/slub/data.slub-dresden.de/master/assets/images/EFRE_EU_quer_2015_rgb_engl.svg\" width=\"300\" \u003e\n\n# efre-lod-api\nFlask API to access your Linked-Open-Data contained in an elasticsearch-cluster.\n\n# Requirements\n\npython3 and other packages specified in requirements.txt\n\n# Install\n\n* clone repository\n  ```\n  git clone https://github.com/efre-lod/efre-lod-api.git\n  ```\n\n* create and activate a virtual environment for this project\n  ```\n  cd efre-lod-api\n  python3 -m venv env\n  source ./env/bin/activate\n  ```\n\n* install package and its requirements into venv\n  ```\n  pip3 install -e .\n  ```\n\n## Systemd unit-file (optional)\nThe systemd template file can be used to start the lod-api via systemd even automatically at boot time.\n* copy systemd template file to `/etc/systemd/system`.\n  ```\n  cp systemd/lod-api@.service /etc/systemd/system/lod-api@username.service\n  ```\n  hereby, replace the `username` with the user which should finally run the LOD-API and has it locally installed to `/home/username/.local/bin`\n\n## via Makefile (optional)\nThere is the posibility to use `make` to install the software into your home-directory (not using a virtualenv) and setup the systemd unit file. You must run the `make` as root in the project's base directory.\n\n# Usage\n\nCopy and configure `apiconfig.yml.example` to suit to your Elasticsearch-Infrastructure containing your JSON-LD. Possible places for storing the config are:\n\n* in `/etc` as `/etc/lod-apiconfig.yml`\n* specify the config file directly via `-c`, e.g.\n  ```\n  lod-api -d --config apiconfig.yml\n  ```\n\nFor starting the api in debug mode, do:\n```\nlod-api -d\n```\n\nFor controlling the daemon, use:\n```\nlod-api [--config apiconfig.yml] {start|stop|restart}\n```\n\nFor a productive environment, we recommend to put the API behind a load-balancer (like nginx).\n\n## systemd\n\nEnable the lod-api-systemd-service to start it at boot using the `username` of the local user which installed the `lod-api` software.\n```\nsystemctl enable lod-api@username\n```\n\nAnd start/stop it via systemctl:\n```\nservice lod-api@username {start|stop|restart|status}\n```\n\n\n\n\n## Example\n\nOne example configuration file can be found in `tests/docker/lod-api/docker_apiconfig.yml`. This configuration fits to the data contained in the test set `tests/data/LDTestSet.tar.bz2`, which can be stored in an elasticsearch and be used as test set for the lod-api. See [data mocking integration](#data_mocking_integration).\n\n\n# Tests\n\nThere is a subset of tests that can be triggered offline (i.e. without depending on elasticsearch), therefore the `offline` marker is used and can be given to pytest:\n```\npython3 -m pytest -m offline tests\n```\n\n\nFor triggering all tests, the api must be started separately. Tests depend on the configuration file of the api. Especially the debug-host and -port are important to determine where to run the tests against. The default configuration file is assumed to be `apiconfig.yml.example` in the home directory of the application. However, another configuration file can be provided using the `--config` switch. You can run the tests via\n```\npython3 -m pytest tests [--config apiconfig.yml]\n```\n\n**Be aware** though that some of the tests depend on mock data which are provided in `tests/data` and have to be stored in a local elasticsearch instance. When you want to test the API with your own data you can, of course, generate your own test set of mock data\n\nIf you want just a single test to be triggered, e.g. the connection test, you can do this with\n```\npython3 -m pytest tests/test_apis_http_status\n```\n\nIf the output should be a bit more verbose, you can turn on print() statements via\n```\npython3 -m pytest -s tests/\n```\nFor more information on the tests have a look into [tests](tests/README.md).\n\n## Data mocking integration\n\nWe provide an elasticsearch Dockerfile (in `tests/docker/elasticsearch`) from which a container running an elasticsearch instance can be build. There are also test set with linked data (in `tests/data/LDTestSet.tar.bz2` which can be extraced and loaded into the locally running elasticsearch. See [tests](tests/README.md) for more information on howto prepare the elasticsearch docker image.\n\nIn the case you are using the mock data test set you will most likely use its provided configuration file as well for the api:\n```sh\nlod-api -d -c tests/docker/lod-api/docker-apiconfig.yml\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslub%2Fefre-lod-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslub%2Fefre-lod-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslub%2Fefre-lod-api/lists"}