|
1 | 1 | # Mapping Commons Registry - Build & ETL |
2 | 2 |
|
3 | | -# Schema download URLs |
4 | | -SSSOM_SCHEMA_URL := "https://raw.githubusercontent.com/mapping-commons/sssom/refs/heads/master/src/sssom_schema/schema/sssom_schema.yaml" |
5 | | -LINKMLMAP_SCHEMA_URL := "https://raw.githubusercontent.com/linkml/linkml-map/refs/heads/main/src/linkml_map/datamodel/transformer_model.yaml" |
6 | | -FAIR_SCHEMA_URL := "https://raw.githubusercontent.com/mapping-commons/fair-mappings-schema/refs/heads/main/src/fair_mappings_schema/schema/fair_mappings_schema.yaml" |
7 | | - |
8 | 3 | # Default recipe: run the full ETL |
9 | 4 | default: all |
10 | 5 |
|
11 | | -# Full ETL: setup, download schemas, transform data, ready to deploy |
12 | | -all: setup schemas data |
| 6 | +# Full ETL: setup, transform data, ready to deploy |
| 7 | +all: setup data |
13 | 8 |
|
14 | 9 | # Install Python dependencies via uv |
15 | 10 | setup: |
16 | 11 | uv sync |
17 | 12 |
|
18 | | -# Download source schemas needed by linkml-map transforms |
19 | | -schemas: setup |
20 | | - mkdir -p tmp |
21 | | - curl -sSL "{{SSSOM_SCHEMA_URL}}" -o tmp/sssom-schema.yaml |
22 | | - curl -sSL "{{LINKMLMAP_SCHEMA_URL}}" -o tmp/linkml-map-schema.yaml |
23 | | - curl -sSL "{{FAIR_SCHEMA_URL}}" -o tmp/fair-mappings-schema.yaml |
24 | | - |
25 | 13 | # Run the ETL: fetch registries, transform SSSOM metadata to FAIR Mappings Schema |
26 | | -data: schemas |
| 14 | +data: setup |
27 | 15 | uv run python3 scripts/cli.py prepare-mapping-registry \ |
28 | 16 | mapping-server.yml \ |
29 | | - data/mapping-specifications.json \ |
30 | | - --sssom-transform transforms/sssom-to-fair.transformation.yaml \ |
31 | | - --sssom-schema tmp/sssom-schema.yaml \ |
32 | | - --linkmlmap-schema tmp/linkml-map-schema.yaml |
| 17 | + data/mapping-specifications.json |
33 | 18 |
|
34 | | -# Transform a single SSSOM instance (usage: just transform-sssom input.yaml output.yaml) |
35 | | -transform-sssom input output: schemas |
| 19 | +# Transform a single file (usage: just transform input.yaml sssom output.yaml) |
| 20 | +transform input mapping_type output: setup |
36 | 21 | uv run python3 scripts/cli.py transform-single \ |
37 | | - transforms/sssom-to-fair.transformation.yaml \ |
38 | | - tmp/sssom-schema.yaml \ |
39 | | - "mapping set" \ |
40 | | - {{input}} {{output}} |
| 22 | + {{input}} {{mapping_type}} {{output}} |
41 | 23 |
|
42 | | -# Transform a single LinkML-Map instance (usage: just transform-linkmlmap input.yaml output.yaml) |
43 | | -transform-linkmlmap input output: schemas |
44 | | - uv run python3 scripts/cli.py transform-single \ |
45 | | - transforms/linkmlmap-to-fair.transformation.yaml \ |
46 | | - tmp/linkml-map-schema.yaml \ |
47 | | - TransformationSpecification \ |
48 | | - {{input}} {{output}} |
| 24 | +# Validate the generated mapping specifications against the FAIR Mappings Schema |
| 25 | +validate: data |
| 26 | + uv run linkml-validate -s tmp/fair-mappings-schema.yaml data/mapping-specifications.json |
49 | 27 |
|
50 | 28 | # Serve the site locally for development |
51 | 29 | serve: |
|
0 commit comments