Skip to content

Commit 8884bdc

Browse files
committed
Create CONTRIBUTING.md
1 parent 246f5da commit 8884bdc

1 file changed

Lines changed: 100 additions & 0 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Contributing to Mapping Commons Registry
2+
3+
## How mappings get into the registry
4+
5+
The registry aggregates mapping metadata from external **mapping registries** listed in [`mapping-server.yml`](mapping-server.yml). Each registry points to a YAML file that lists individual mapping sets (typically SSSOM TSV files). During the ETL, each mapping set's metadata is extracted and transformed into the [FAIR Mappings Schema](https://github.com/mapping-commons/fair-mappings-schema) using [linkml-map](https://github.com/linkml/linkml-map).
6+
7+
```
8+
mapping-server.yml
9+
└── external registry YAML (e.g. registry.yml in another repo)
10+
└── mapping_set_references
11+
└── SSSOM TSV files (metadata extracted, not the mappings themselves)
12+
└── linkml-map transform → MappingSpecification JSON
13+
```
14+
15+
## Register an external mapping registry
16+
17+
To add a new mapping registry to the Mapping Commons:
18+
19+
1. **Create a registry YAML file** in your mapping repository. Follow the [SSSOM registry format](https://mapping-commons.github.io/sssom/spec/#mapping-set-registry):
20+
21+
```yaml
22+
mapping_registry_id: https://example.org/my-mappings
23+
registry_title: My Mapping Project
24+
registry_description: Mappings between X and Y
25+
homepage: https://github.com/org/my-mappings
26+
documentation: https://github.com/org/my-mappings/blob/main/README.md
27+
28+
mapping_set_references:
29+
- mapping_set_id: https://example.org/my-mappings/foo_bar.sssom.tsv
30+
mapping_set_group: my_group
31+
local_name: foo_bar.sssom.tsv
32+
```
33+
34+
2. **Ensure your SSSOM files have good metadata** in their headers. The following fields are extracted:
35+
- `mapping_set_id` (required) — unique identifier
36+
- `mapping_set_title` — displayed as the mapping name
37+
- `mapping_set_description` — shown in search results
38+
- `license` — e.g. `https://creativecommons.org/publicdomain/zero/1.0/`
39+
- `mapping_set_version`
40+
- `subject_source` / `object_source` — what's being mapped
41+
- `mapping_tool` — how the mappings were created
42+
- `publication_date`
43+
44+
3. **Open a PR** to add your registry to `mapping-server.yml`:
45+
46+
```yaml
47+
registries:
48+
# ... existing entries ...
49+
- id: my-mappings
50+
uri: https://raw.githubusercontent.com/org/my-mappings/main/registry.yml
51+
```
52+
53+
4. The CI will automatically fetch your registry, extract metadata from each mapping set, and include it in the site.
54+
55+
## Add a new transform specification
56+
57+
This repository is the source of truth for linkml-map transforms that convert mapping formats into the FAIR Mappings Schema. Currently supported:
58+
59+
| Format | Transform file | Source type |
60+
|--------|---------------|-------------|
61+
| SSSOM | `transforms/sssom-to-fair.transformation.yaml` | `mapping set` |
62+
| LinkML-Map | `transforms/linkmlmap-to-fair.transformation.yaml` | `TransformationSpecification` |
63+
64+
To add support for a new mapping format:
65+
66+
1. **Create a transform file** in `transforms/` following the [linkml-map specification](https://linkml.io/linkml-map/). The transform should map your format's metadata to `MappingSpecification` fields.
67+
68+
2. **Register it** in `registry.yml`:
69+
70+
```yaml
71+
transform_references:
72+
- id: https://w3id.org/linkml/transformer/myformat-to-fair-mappings
73+
title: MyFormat to FAIR Mappings Schema
74+
description: Transforms MyFormat metadata to FAIR Mappings Schema
75+
local_name: myformat-to-fair.transformation.yaml
76+
source_format: myformat
77+
source_schema_url: https://example.org/myformat-schema.yaml
78+
source_type: MyRootClass
79+
```
80+
81+
3. **Update `scripts/cli.py`** to handle the new format if it requires different fetching/parsing logic.
82+
83+
4. **Test locally**:
84+
85+
```bash
86+
just transform-sssom my-input.yaml my-output.yaml # for SSSOM
87+
just transform-linkmlmap my-input.yaml my-output.yaml # for LinkML-Map
88+
```
89+
90+
## Local development
91+
92+
```bash
93+
# Prerequisites: uv, just
94+
just all # Full ETL
95+
just serve # Local server at http://localhost:8080
96+
```
97+
98+
## Questions?
99+
100+
Open an [issue](https://github.com/mapping-commons/mapping-commons.github.io/issues).

0 commit comments

Comments
 (0)