Skip to main content

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

Metadata

Release files for nfdi4earth-kh-schema 0.40.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nfdi4earth-kh-schema 0.40.13
File Size Uploaded Provenance Actions
nfdi4earth_kh_schema-0.40.13.tar.gz 78.4 kB Without provenance Details for nfdi4earth_kh_schema-0.40.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nfdi4earth-kh-schema 0.40.13
File Interpreter ABI Platform Actions
nfdi4earth_kh_schema-0.40.13-py3-none-any.whl Python 3 none any Details for nfdi4earth_kh_schema-0.40.13-py3-none-any.whl

Total release size: 158.9 kB

Release files / nfdi4earth_kh_schema-0.40.13.tar.gz

Download URL nfdi4earth_kh_schema-0.40.13.tar.gz
Size 78.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d16ce81cc22fc3e26280fcf9f464b1b814b8ce209d2477d88f4116d43674e73b
BLAKE2b-256 checksum
How to use checksums
8d9fc8386ed446098e5684ce93259e865f03c4cf6e47e680d8d9c602a71c9437
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / nfdi4earth_kh_schema-0.40.13-py3-none-any.whl

Download URL nfdi4earth_kh_schema-0.40.13-py3-none-any.whl
Size 80.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ee4158b6054f5b4dfeeca91fa40605863cfbf086375822049c84d82554d26ea
BLAKE2b-256 checksum
How to use checksums
fd98ab9ccd2ec52812bb51b80a9f6ac986d4f8f81a2bce9efa18a299da4411ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for nfdi4earth-kh-schema 0.40.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page