Skip to main content

mlflow2rdf

A Python package to convert MLflow tracking data into MLSO-aligned RDF Knowledge Graphs.

Overview

mlflow2rdf transforms your MLflow experiment metadata (parameters, metrics, tags) into semantic RDF triples that conform to the MLSO (Machine Learning Sailor Ontology) standard. This enables:

  • Semantic querying via SPARQL instead of imperative MLflow API loops
  • Cross-platform interoperability with public ML knowledge graphs like MLSea
  • FAIR principles for ML experiments: Findable, Accessible, Interoperable, Reusable

Installation

pip install mlflow2rdf

Quick Start

Command Line Interface

# Convert MLflow runs to RDF
mlflow2rdf --uri /path/to/mlruns --out output.ttl

# With SHACL validation
mlflow2rdf --uri /path/to/mlruns --out output.ttl --validate

Flags are --uri / --out (not --mlruns / --output).

Python API

from mlflow2rdf import SemanticTracker, export_and_validate

# Convert to RDF
tracker = SemanticTracker(
    mlflow_uri="/path/to/mlruns",
    output_graph_uri="http://w3id.org/mlsea/mlflow/kg",
    default_modality="tabular",
)
graph = tracker.export(experiment_ids=None, exclude_failed_runs=False)

# Serialize to Turtle format
graph.serialize("output.ttl", format="turtle")

# Or export + validate in one call
export_and_validate("/path/to/mlruns", "output.ttl", inference="owlrl")

The previously documented MLflow2RDFConverter class does not exist. The real entry points are SemanticTracker and export_and_validate.

Features

  • Multi-modal support: Tabular, image, text, time-series, and multi-modal data
  • Paradigm-aware routing: Automatic parameter routing based on learning paradigm
  • Pipeline relationship inference: Detects knowledge distillation, LoRA adapters, self-supervised learning chains
  • SHACL validation: Comprehensive shape validation against MLSO constraints
  • Blind spot analysis: Completeness verification of metadata extraction

Supported Learning Paradigms

Paradigm Key Properties
Supervised Classification Standard hyperparameters, accuracy metrics
Self-Supervised Learning Pre-text/downstream run partitioning
Contrastive Learning Temperature, distance metrics
Knowledge Distillation Teacher-student relationships, distillation temperature
Parameter-Efficient Fine-tuning (LoRA) Adapter rank, alpha, target modules
Multi-Modal Fusion Fusion strategy, image/text encoders
Time-Series Forecasting Forecasting horizon, lookback window

Output Format

The package generates RDF triples in Turtle format, using MLSO/MLST vocabulary:

@prefix mls: <http://www.w3.org/ns/mls#> .
@prefix mlso: <http://w3id.org/mlso/> .

<run/abc123> a mls:Run ;
    mls:hasInput <dataset/cifar10> ;
    mls:hasOutput <evaluation/acc_0.95> ;
    mlso:hasParadigm "Supervised Classification" .

Requirements

  • Python >= 3.8
  • MLflow >= 2.0.0
  • RDFLib >= 6.0.0
  • pySHACL >= 0.25.0

License

MIT License

Citation

If you use this package in your research, please cite:

@mastersthesis{jia2026mlflow2rdf,
  author = {Jia, Sijie},
  title = {Bridging ML Tracking and Semantic Interoperability: Transforming MLflow Experiment Metadata to MLSO-Aligned RDF Knowledge Graphs},
  school = {KU Leuven},
  year = {2026}
}

Metadata

Release files for mlflow2rdf 0.2.5

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

Source distribution (sdist)

Source distribution for mlflow2rdf 0.2.5
File Size Uploaded Provenance Actions
mlflow2rdf-0.2.5.tar.gz 49.1 kB With provenance Details for mlflow2rdf-0.2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mlflow2rdf 0.2.5
File Interpreter ABI Platform Actions
mlflow2rdf-0.2.5-py3-none-any.whl Python 3 none any Details for mlflow2rdf-0.2.5-py3-none-any.whl

Total release size: 113.9 kB

Release files / mlflow2rdf-0.2.5.tar.gz

Download URL mlflow2rdf-0.2.5.tar.gz
Size 49.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f01f6c4f9c6cb081eeee0529db01a2f9155e2605f31143a3c13a28f4202ca274
BLAKE2b-256 checksum
How to use checksums
babb9711cbd32814f878f7ebb62c25348869c52ce174bfabea9a0eaf79730177
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / mlflow2rdf-0.2.5-py3-none-any.whl

Download URL mlflow2rdf-0.2.5-py3-none-any.whl
Size 64.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4048061d864ca9fda0778f3b2b55ab18715814943a9f04bd648a83309e743ed7
BLAKE2b-256 checksum
How to use checksums
0ee0861e68a80ead5862a650eef3718a64b8de05baf7453352a2ecaa605960ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Security for mlflow2rdf 0.2.5

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mlflow2rdf-0.2.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

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