Skip to main content

A Python library for working with the pivmeta ontology.

Project description

pivmetalib

Tests DOCS pyvers pivmeta

A Python library and high-level interface to work with the pivmeta ontology. It allows to describe PIV recordings, software, hardware and other related entities in a state-of-the-art and good scientific practice compliant way.

The library depends on ontolutils, which provides the object-oriented interface to the ontology and the JSON-LD serialization.

Usage

Installation

The package is available on PyPI and can be installed via pip:

pip install pivmetalib

Example of describing a PIV software:

It is very helpful to provide a description of the used PIV software together with the PIV recording. This can be done using the PIVSoftware class from the pivmeta module. The following example shows how to describe the OpenPIV software. Put the resulting JSON-LD to your website, data repository or other places to make your data FAIR. Other users or software can then easily understand and use your data.

from pivmetalib import pivmeta, prov

software = pivmeta.PIVSoftware(
    author=prov.Organization(
        name='OpenPIV',
        url='https://github.com/OpenPIV/openpiv-python',
    ),
    description='OpenPIV is an open source Particle Image Velocimetry analysis software written in Python and Cython',
    softwareVersion="0.26.0a0",
    hasDocumentation='https://openpiv.readthedocs.io/en/latest/',
)

print(software.serialize("ttl"))

This will result in the following TTL representation:

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix pivmeta: <https://matthiasprobst.github.io/pivmeta#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix schema: <https://schema.org/> .
@prefix sd: <https://w3id.org/okn/o/sd#> .

[] a pivmeta:PIVSoftware ;
    schema:author [ a prov:Organization ;
            foaf:name "OpenPIV" ;
            schema:url <https://github.com/OpenPIV/openpiv-python> ] ;
    schema:description "OpenPIV is an open source Particle Image Velocimetry analysis software written in Python and Cython" ;
    schema:version "0.26.0a0" ;
    sd:hasDocumentation <https://openpiv.readthedocs.io/en/latest/> .

Documentation and Usage

This library mainly implements the ontology in form of pydantic model classes. The pivmeta ontology uses other ontologies and builds on top of them. Thus, some central classes from ontologies like schema.org, prov, dcat and m4i are implemented, too.

Practical examples on how to use the library can be found in docs-folder ( e.g. Describe a PIV recording).

Contribution

Contributions are welcome. Please open an issue or a pull request.

Project details


Download files

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

Source Distribution

pivmetalib-3.0.0.0.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

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

pivmetalib-3.0.0.0-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file pivmetalib-3.0.0.0.tar.gz.

File metadata

  • Download URL: pivmetalib-3.0.0.0.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for pivmetalib-3.0.0.0.tar.gz
Algorithm Hash digest
SHA256 204072522578fe6ae8df69a7ba243d411789b8bfb3a4ab0fcc582f67ff29ee38
MD5 02c64f5ce843a9077b57d67f58d10ca8
BLAKE2b-256 e70c08e55c416f1ede5f4732162080dacbd1c71e64cb02837a56be79704682ca

See more details on using hashes here.

File details

Details for the file pivmetalib-3.0.0.0-py3-none-any.whl.

File metadata

  • Download URL: pivmetalib-3.0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for pivmetalib-3.0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f09e95e0510d5140c0f50dcefae054f9d106e8b9ab1875d676d7dc5424c697d
MD5 b1b7dab85628bcb8c05dc81d53fcdd45
BLAKE2b-256 c6a4e6193e66630d2bf312fafb4ac6ebcf8860b17b703aefa34934a024332b07

See more details on using hashes here.

Supported by

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