Python utils for the Linked Data Registry (https://csiro-enviro-informatics.github.io/ldrpyutils).
This repository provides Python-based tools to interface with any Linked Data Registry instances. Currently tools developed help users with vocabulary content maintained in a Excel format upload/update it to a Linked Data Registry instance.
The two pathways for this is via:
excel2ldr
command line toolDetails are provided below.
Persistent Link: http://doi.org/10.4225/08/5a2744c74d949 Attribution Statement: Yu, Jonathan (2017): ldrpyutils. v1. CSIRO. Software Collection. 10.4225/08/5a2744c74d949
(https://csiro-enviro-informatics.github.io/ldrpyutils/index#excel2ldr)
Excel2ldrGui is a GUI front-end to Excel-to-LDR to help users upload and update content on a Linked Data Registry.
The standalone executables have been precompiled for Windows and Mac. Download here
For Excel2ldrGui, you will need to use a simple excel format or a multiple-register excel format. Examples of these are providedin the test-data repository.
$ pip install ldrpyutils
# download starter pack
$ wget https://github.com/CSIRO-LW-LD/ldrpyutils/blob/master/quickstart/csiro-starter-pack.zip
$ unzip csiro-starter-pack.zip
# edit fields in examples/simple.xlsx to point to your register on a LDR instance
# edit config to point to your LDR instance
$ excel2ldr --user username --pass passwd examples/simple.xlsx
#
#Optionally with verbose to get logging output
$ excel2ldr --verbose --user username --pass passwd examples/simple.xlsx
1. Ensure Python 3.4+ and pip is installed
2. Ensure Python and pip is added to the PATH environment variable
$ pip install ldrpyutils
# clone this git repository
$ git clone https://github.com/CSIRO-LW-LD/ldrpyutils.git
$ cd ldrpyutils
# (optional) setup a virtualenv
$ virtualenv -p python3 venv
$ source venv/bin/activate
$ pip install -r requirements.txt
# install the ldrpyutils library locally
$ pip install -e .
# run excel2ldr - transform excel data to a single register of vocabs, build graph, post to a LDR registry
$ excel2ldr --user username --pass passwd test-data/simple.xlsx
# run excel2ldr - transform excel sheets to multiple registers of vocabs, build graph, post to a LDR registry
$ excel2ldr --user username --pass passwd --multi test-data/simple.xlsx
excel2ldr expects a config.json in current dir to contain details to an instance of a Linked Data Registry.
config.json currently allows specification of registry url but might expand to include other details in the future.
{
"registry_url" : "http://my-ldr-here.com"
}
Examples of the excel formats are given in test-data repository. There is currently 2 formats supported for use cases considered.