Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Nfdi4earth Knowledge Hub Schema

This repository contains the underlying metadata schema of the NFDI4Earth Knowledge Hub.

The schema is created with LinkML. Out of the LinkML definition of the schema, we generate several serializations:

  • Python bindings to interact with the schema, the generated code is published in the form of a Python package.
  • Human-readable documentation of the schema with mkdocs

Python

Installation

This package is registered at the PyPI registry.

To use this package in another project install it via:

pip install nfdi4earth-kh-schema

Deploying new version

To deploy a new version, add a Tag to the latest commit. Since the env variable holding the token for accesing the pypi API is set to protected, make sure to add the Tag to the list of protected Tags.

Setting → Repository → "Protected Tags"

Development installation

Clone this repository. It is recommended to run it in a Python virtual environment. As a shortcut you can run:

make venv-init # installs a virtual env and installs this package in development mode.
. venv/bin/activate # activates the virtual env

Alternatively, you can install the virtual environment by yourself:

python -m venv venv
. venv/bin/activate
make dev-install # installs this package in development mode.

Note: we are patching the functionality of LinkML in order to accept entities with blank nodes instead of URL identifiers for certain classes (TODO: expand on this)

Finally generate the Python classes from the LinkML definition:

make generate-python

Important: After every change in the n4eschema-linkml.yaml file, you need to run make generate-python (make sure that your virtual environment is activated, see above) again, in order to reflect the updated schema in the Python package!

To update schema.json, run make generate-json-schema-kh. Alternatively, run make dist to update the Python package, schema.json, and context.jsonld.

Generation of docs

The functionality of LinkML is used to automatically generate a human-readable documentation of the KH schema, which is based on mkdocs. Thus, ensure that the packages mkdocs, mkdocs-material, and mkdocs-mermaid2-plugin are installed in addition to the requirements.

The generated docs are currently hosted at https://nfdi4earth.pages.rwth-aachen.de/knowledgehub/nfdi4earth-kh-schema/ - see the .gitlab-ci.yml file for the workflow.

Locally build the docs

To test the generated documentation locally, run

# this initializes a Python virtual environment in the folder "venv" and installs the dependencies there
make venv-init
# activate the virtual environment
source venv/bin/activate
# build the docs based on the LinkML schema
make docs-build
# now try out via localhost
mkdocs serve
# access the static pages via your browser under the displayed url, usually http://127.0.0.1:8000/

The docs are currently making use of the material theme for mkdocs. This and other configs can be changed in the mkdocs.yml.

Build and release

A new package is published in gitlab for every release, for this do:

git tag -a v0.4.x -m "describe changes..."
git push origin --tags

Technical note

This package has been generated from the template https://git.rwth-aachen.de/nfdi4earth/architecture/python-package-template (NOTE: several changes have been made to this package afterwards so it might be out of sync with the template).

See the template repository for instructions on how to update the skeleton for this package.

License information

Copyright © 2023 Senckenberg Society for Nature Research, TU Dresden

Licensed under the Apache-2.0

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache-2.0 license for more details.

License management

License management is handled with reuse.

Contributors: Jonas Grieb, Ralf Klammer, Daniel Nüst

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nfdi4earth_kh_schema-0.4.12b11.tar.gz (77.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nfdi4earth_kh_schema-0.4.12b11-py3-none-any.whl (79.1 kB view details)

Uploaded Python 3

File details

Details for the file nfdi4earth_kh_schema-0.4.12b11.tar.gz.

File metadata

  • Download URL: nfdi4earth_kh_schema-0.4.12b11.tar.gz
  • Upload date:
  • Size: 77.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.17

File hashes

Hashes for nfdi4earth_kh_schema-0.4.12b11.tar.gz
Algorithm Hash digest
SHA256 fc61190cc04e18bc61842207f639bb6a7189284d02727e7f0bb57da0b5d380f9
MD5 619454fee621a87aa8ae9b42564d911e
BLAKE2b-256 810272ccb9241ea02826b15fc89719d51ff6df58d03011cbf055c97852b2c2bf

See more details on using hashes here.

File details

Details for the file nfdi4earth_kh_schema-0.4.12b11-py3-none-any.whl.

File metadata

File hashes

Hashes for nfdi4earth_kh_schema-0.4.12b11-py3-none-any.whl
Algorithm Hash digest
SHA256 764f57f47db11749d5a460b59ec5730eda5484ef43d3300806fb083b4ade59e8
MD5 cfef349733cc95c421f9ff6a10e58bce
BLAKE2b-256 4ab5ca4b78b1780e114b4b197df3d004d3cb12e604d1f29184604a440a51075a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.12b11 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page