A Python3 implementation of YARRRML Mapper and SPARQL Querying for OpenDataSoft-API data.
First, clone the repository:
git clone https://github.com/benjimor/ods-yarrrml-toolkit.gitThen, assuming you already have Python3 and Pip installed, install the dependencies:
Running in a virtual environment is recommended
pip3 install -r requirements.txtTransform an ODS json api result file into an RDF (ttl) file using a YARRRML Mapping with the following command:
python3 YARRRMLMapper.py <source> <destination> <mapping>example:
Files are in root directory of this project
python3 YARRRMLMapper.py example/rap_world_data.json example/rdf_result_data.ttl example/rap_world_mapping.ymlQuery the resulting ttl file with a SPARQL query using the following command:
python3 SPARQL.py <source> <query>example:
Files are in root directory of this project
python3 SPARQL.py example/rdf_result_data.ttl example/query.sparql