A python library binding of the c++ library tada-hdt-entity
Not that to install pytada-hdt-entity, you don't need to perform the swig build as this is already done by the authors. All you need is the files in this repository and the depedencies.
pip install git+https://github.com/oeg-upm/pytada-hdt-entity.git
sh scripts/compile.sh
These are included in compile.sh
- For debian and ubuntu: install-script
- For other linux distro and macOS: use the debian script but update it with the equivalent command to install prerequisite packages
- You need to setup the following environment variables: You might not need this in the newer versions
export project_dir='.'
(or the directory of the c++ source code)export LC_ALL=en_US.UTF-8
(needed for mac)export LANG=en_US.UTF-8
(needed for mac)
- Generate the interface files:
invoke copyc
(only if you need to copy the source files to the current folder. If you copy the c++ files to this directory, you do not need to do it). Note that you need to setup the environment variableproject_dir
to point to the tada-hdt-entity directory.
- Copy the python files into the package:
invoke copypy
Copy the generated python files to tada_hdt_entity
- Update
setup.py
with the new version of the library
- SWIG (to handle .i files)
- HDT lib
- tabular_parser lib
- easy_logger lib
- tada_hdt_entity lib
brew install swig
@software{alobaid_ahmad_2020_3764190,
author = {Alobaid, Ahmad and
Corcho, Oscar},
title = {pytada-hdt-entity},
month = apr,
year = 2020,
publisher = {Zenodo},
doi = {10.5281/zenodo.3764190},
url = {https://doi.org/10.5281/zenodo.3764190}
}
- Generate
test.hdt
.cd pytada-hdt-entity/test_files
~/hdt-cpp/libhdt/tools/rdf2hdt test.ttl test.hdt
(change the location to point to thehdt-cpp
).
- Run test cases.
- Return back to the pytada-hdt-entity folder
cd ..
. python -m unittest discover
.
- Return back to the pytada-hdt-entity folder
- library not found.
ld: library not found for -ltabularparser
(on Mac) when runningpython setup.py build_ext --inplace
.
Solution: Run export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib
before running python setup.py build_ext --inplace
.
- library linking error
In file included from graph.cpp:1:
./graph.h:8:10: fatal error: 'easy_logger/easy_logger.h' file not found
#include <easy_logger/easy_logger.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
``` (Mac)