-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "linkml-transformer", # pretend we’re using LinkML tooling
# "pyyaml"
# ]
# [tool.mapping-metadata]
# id = "https://mapping-commons.github.io/rda-fair-mappings/example/personinfo.transform.yml"
# title = "PersonInfo to Agent example transformation"
# source_schema = "https://mapping-commons.github.io/rda-fair-mappings/example/personinfo.schema.yml"
# target_schema = "https://mapping-commons.github.io/rda-fair-mappings/example/personinfo.transform.yml"
# prefixes.sssom = "https://w3id.org/sssom/"
# prefixes.semapv = "https://w3id.org/semapv/vocab/"
# mapping_method = "semapv:ManualMappingCuration"
# mapping_tool_version = "0.3.8"
# license = "https://creativecommons.org/licenses/by/4.0/"
# creator_id = ["https://orcid.org/0000-0002-7356-1779"]
# author_id = ["https://orcid.org/0000-0002-7356-1779"]
# publication_date = "2025-08-14"
# ///
import json
# Example: input in "PersonInfo" schema style
personinfo = {
"given_name": "Ada",
"family_name": "Lovelace",
"age": 36,
"height_in_cm": 165
}
# Simple transformation logic (stand-in for LinkML transformer)
agent = {
"id": "agent:1",
"type": "Agent",
"full_name": f"{personinfo['given_name']} {personinfo['family_name']}",
"age": personinfo["age"],
"height_in_m": round(personinfo["height_in_cm"] / 100.0, 2)
}
print(json.dumps(agent, indent=2))Metadata
Metadata
Assignees
Labels
No labels