Machine-file extractors and transformers for semantic schema pipelines
Project description
semantic-transformers
A library and a curated collection of parsers that bridge raw instrument output files and the semantic-schemas knowledge graph pipeline.
What this repository contains
semantic-transformers/
src/semantic_transformers/ Python library (Transformer, QuickMapper, …)
parsers/ Machine-specific file parsers
<domain>/ Mirrors the semantic-schemas folder structure
<specialisation>/
<machine>/ One folder per instrument model
<machine>_parser.py Reads the instrument file
column_mapping.json Maps column names to ontology class IRIs and units
README.md Quick-start, schema compatibility, and known limitations
docs/ Guides for users and contributors
The two parts
1. The library (src/semantic_transformers/)
| Class | Role |
|---|---|
Parser |
Protocol to implement when adding support for a new instrument |
ParseResult |
What every parser returns: simplified JSON + DataFrame |
Transformer |
Runs parsing → JSONata transform → RDF graph |
TransformResult |
What Transformer.run() returns: RDF graph + DataFrame |
QuickMapper |
Turns any tabular file into RDF using a simple YAML mapping (no parser needed) |
2. The parsers (parsers/)
Each parser targets a specific instrument model. The folder path mirrors the
schemas/ tree in semantic-schemas:
| Schema | Instrument | Parser path |
|---|---|---|
characterization/tensile-test/TTO |
Zwick/Roell (testXpert III) | parsers/characterization/tensile-test/zwick/ |
Installation
Using pip (recommended)
# Install the transformers library
pip install semantic-transformers
# Optional: install optional dependencies
pip install semantic-transformers[excel] # for Excel file support
pip install semantic-transformers[dev] # for development and testing
Development installation
Both repositories are designed to be cloned as siblings under a shared folder:
mkdir semantic-dataspace && cd semantic-dataspace
git clone https://github.com/Semantic-Dataspace/semantic-schemas
git clone https://github.com/Semantic-Dataspace/semantic-transformers
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e semantic-transformers/
pip install jupyterlab # only needed for the interactive notebooks
Two ways to use this library
Option A: you have a supported instrument
Use a ready-made parser and the matching schema notebook. For a Zwick/Roell tensile test:
jupyter lab semantic-schemas/schemas/characterization/tensile-test/TTO/docs/2_tensile_test_csv_workflow.ipynb
Edit Step 0 (one line, point to your file) and run all cells. Done.
Option B: you have a tabular file with no existing parser
Use QuickMapper. Provide a short YAML that names the columns and points each
one at an ontology class IRI:
from semantic_transformers import QuickMapper
mapping = {
"label": "my experiment",
"columns": {
"Force": {
"iri": "https://w3id.org/pmd/tto/StandardForce",
"unit": "http://qudt.org/vocab/unit/N",
},
"Extension": {
"iri": "https://w3id.org/pmd/tto/Extension",
},
},
}
result = QuickMapper(mapping).run("my_data.csv")
print(result.graph.serialize(format="turtle"))
print(result.dataframe.head())
Supported file formats: CSV, TSV, Excel (.xlsx), Parquet, JSON. See the QuickMapper notebook for a guided walkthrough.
Contributing
To contribute or run tests locally, see CONTRIBUTING.md for setup and development workflow instructions.
Documentation
- Getting started: convert your first instrument file
- QuickMapper walkthrough: turn any tabular file into RDF
- Adding a parser: support a new instrument or handle file variants
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file semantic_transformers-0.1.2.tar.gz.
File metadata
- Download URL: semantic_transformers-0.1.2.tar.gz
- Upload date:
- Size: 26.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c77f66c5f289f2181bac9333217f13a2c02810aed1a268e4483eb5829498567
|
|
| MD5 |
1943c49a56cebe58cf5c3bc8f553356c
|
|
| BLAKE2b-256 |
d8319c66ba95abbbb9b88e5695ccb774953e252cf4ea326793d9c9d4ce09fbbc
|
Provenance
The following attestation bundles were made for semantic_transformers-0.1.2.tar.gz:
Publisher:
publish.yml on semantic-dataspace/semantic-transformers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
semantic_transformers-0.1.2.tar.gz -
Subject digest:
2c77f66c5f289f2181bac9333217f13a2c02810aed1a268e4483eb5829498567 - Sigstore transparency entry: 1262940368
- Sigstore integration time:
-
Permalink:
semantic-dataspace/semantic-transformers@483d27bf70b5eb8b73ab42ad36b9254df8a36f0e -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/semantic-dataspace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@483d27bf70b5eb8b73ab42ad36b9254df8a36f0e -
Trigger Event:
push
-
Statement type:
File details
Details for the file semantic_transformers-0.1.2-py3-none-any.whl.
File metadata
- Download URL: semantic_transformers-0.1.2-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d89811fcc2284d7ff9519fb04fb54baeb02085d3b1d4c4ca746390da04f29195
|
|
| MD5 |
84eb051385652a243e43f967463d9e69
|
|
| BLAKE2b-256 |
d90ffea37c3823b9220bb7ca0cf02949c0f51fea6f5f57b9cacd39021c9a5cba
|
Provenance
The following attestation bundles were made for semantic_transformers-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on semantic-dataspace/semantic-transformers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
semantic_transformers-0.1.2-py3-none-any.whl -
Subject digest:
d89811fcc2284d7ff9519fb04fb54baeb02085d3b1d4c4ca746390da04f29195 - Sigstore transparency entry: 1262940432
- Sigstore integration time:
-
Permalink:
semantic-dataspace/semantic-transformers@483d27bf70b5eb8b73ab42ad36b9254df8a36f0e -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/semantic-dataspace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@483d27bf70b5eb8b73ab42ad36b9254df8a36f0e -
Trigger Event:
push
-
Statement type: