2.b Example python code to upload metadata to FDP
Introduction
If you want to set up an automatic tool to export metadata to a FAIR data point but do not know where to start you may consider using SeMPyRO package to prepare data.
SeMPyRO is a pydantic-based Python package aiming to make working with ontologies easier by implementing main DCAT instances as pydantic classes and providing logic to convert instances of those classes to an RDF graph.
Explanation / Approach
More details on the SeMPyRO package itself can be found in the repository: GitHub - Health-RI/SeMPyRO: pydantic data models for DCAT-AP v3
Among other documentation we provide a Jupyter notebook with example code: SeMPyRO/docs/Usage_example_FDP.ipynb at main ยท Health-RI/SeMPyRO
You can execute this notebook with your FAIR Data Point instance to get a grasp what metadata preparation and uploading to an FDP may look like and create scripts of your own.
Prerequirements
A running FDP instance
How to run the notebook
Clone SeMPyRO repository
Install Jupyter notebook (An official installation guide: Project Jupyter )
Install SeMPyRO package (
pip install sempyro
) and dependeciesInstall additional dependencies for the particular notebook:
tabulate
andpandas
Run Jupyter notebook, the repository with a running kernel will be opened in your browser.
Navigate to
./docs/Usage_example_FDP.ipynb
, you can execute statements there one by one