Awesome
tada-web
This is a web API project (with Swagger) using tada-hdt-entity
and the pytada-hdt-entity
libraries
Example with curl
curl --location --request POST 'https://api.tada.linkeddata.es/subject' \
--form 'col_id="1"' \
--form 'alpha="0.47"' \
--form 'dbpedia_only="true"' \
--form 'k="1"' \
--form 'source=@"t2dv2/5873256_0_7795190905731964989.csv"'
Install
sudo sh setup.sh
pip install git+https://github.com/oeg-upm/pytada-hdt-entity.git
pip install -r requirements.txt
Known issues
On Mac, you might face linked errors. To resolve this you can use export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib
before running pip.
Run
python app.py
you can also specify the host IP and the port e.g., python app.py 0.0.0.0 5001
To see the list of APIshttp://127.0.0.1:5001/apidocs/
Parameters and Setup
sources.csv
. This file is expected to have the following headers:id,name,type,source
. Theid
is the one that should be unique, but it won't be visible to the users. Thename
is the name of the source that would be shown to the users. Thetype
can be anHDT
orSPARQL
. Finally, thesource
is the path (in the case of HDT) or the url (in the case of SPARQL). Note that only HDT sources are supported at the moment.
To cite
@software{alobaid_ahmad_2020_3764197,
author = {Alobaid, Ahmad and
Corcho, Oscar},
title = {tada-web},
month = apr,
year = 2020,
publisher = {Zenodo},
doi = {10.5281/zenodo.3764197},
url = {https://doi.org/10.5281/zenodo.3764197}
}
To run tests
- Download the test.hdt
- Set up environment variable
test_hdt_dir
to refer to the location of test.hdt (this is taken from tada-hdt-entity) - Run tests
sh run_tests.sh
Tests cases
Test cases and files are taken from tada-hdt-entity