Read-only mirror of https://github.com/BLV-OSAV-USAV/PSMV-RDF — Federal Food Safety and Veterinary Office FSVO, Switzerland. Issues & pull requests at the source.
  • Python 49.7%
  • Turtle 47.2%
  • SPARQL 3.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-30 08:56:23 +00:00
.github Configure SSH key for actions checkout 2026-09-30 10:52:33 +02:00
data feat: add dataset metadata with fetch date and data model version 2026-09-10 16:18:50 +02:00
docs chore: add better search as example 2026-09-23 10:38:20 +02:00
rdf Update pipeline outputs [skip ci] 2026-09-14 10:39:02 +00:00
service feat: add dataset metadata with fetch date and data model version 2026-09-10 16:18:50 +02:00
src feat: add dataset metadata with fetch date and data model version 2026-09-10 16:18:50 +02:00
tests chore: Enable int graph upload. For now in the same step as prod upload. 2026-09-10 14:04:07 +02:00
.gitattributes
.gitignore update gitignore 2026-05-20 15:59:21 +02:00
.release-please-manifest.json chore(main): release psmv-rdf 0.4.1 2026-09-23 12:55:52 +00:00
CHANGELOG.md chore(main): release psmv-rdf 0.4.1 2026-09-23 12:55:52 +00:00
LICENSE add license AGPL v3 based on BK OSS rules 2026-05-20 14:12:26 +02:00
pyproject.toml chore(main): release psmv-rdf 0.4.1 2026-09-23 12:55:52 +00:00
README.md Fix new name in example 2026-09-23 09:48:40 +02:00
release-please-config.json Add release-please configuration for Python package 2026-09-23 14:51:59 +02:00
uv.lock Update pipeline outputs [skip ci] 2026-09-30 08:56:23 +00:00

PSMV-RDF

Python License Status Docs CI

Note

This repository is under active development. Features, documentation, and structure will change frequently.

Plant Protection Products (PSMV) as Linked Data

A Python module for converting Swiss plant protection product data from CSV format to RDF and publishing it to the LINDAS Linked Data Service.

Reproduce the data integration pipeline

  1. Set up the virtual environment

    If uv is not yet installed: curl -LsSf https://astral.sh/uv/install.sh | sh

    uv venv psmv-rdf
    source psmv-rdf/bin/activate  
    
  2. Install the package in editable mode

    uv pip install -e .
    
  3. Start the data integration pipeline

    python -m service.pipeline
    
  4. To upload the graph, first, place a .env file in the directory root:

    LINDAS_USER=********
    LINDAS_PASSWORD=************
    ENDPOINT=https://graphdb.lindas.admin.ch/repositories/lindas/rdf-graphs/service
    GRAPH=https://lindas.admin.ch/fsvo/plant-protection-products
    

    Then trigger the upload to LINDAS:

    python -m service.upload_graph
    

Project Structure

psmv-rdf/
├── .github/
│   └── workflows/  # github actions
├── data/           # any non-RDF data files, used as input data
│   ├── mapping/    # yaml mapping files
│   ├── namespaces/ # 
│   ├── processed/  # 
│   └── mapping/    # input CSV files
├── docs/           # project documentation
├── rdf/
│   ├── ontology/   # OWL ontology documentation
│   ├── shapes/     # SHACL shapes, also used as data model documentation
│   ├── data/       # the actual RDF data, split by classes
│   ├── example/    # example turtle files used for reference
│   └── processed/  # any automatically written/derived/merged turtle files
├── services/
│   └── pipeline.py       
├── src/
│    ├── sparql     # SPARQL queries and inference rules
│    └── python/    # Python scripts for specific tasks
├── tests/
├── LICENSE
├── README.md
└── .gitignore

Documentation

All ontology documentation files are written to rdf/ontology. You may inspect a visual representation of the ontology used here.

A more restricted data model is written in SHACL and can be inspected here.

Note

We should align the SHACL data model with this documentation: https://github.com/user-attachments/files/28257903/177035312.Datenmodell.PSMV.docx

Project dependencies are listed in pyproject.toml.

Example queries

List some products

List all prodcuts containing sulphur

Which products can be used for sweet corn when thrips are the target pest?

Acknowledgments