#!/bin/bash
# WF 2024-01-13
# see 
#   - https://linkml.io/linkml/intro/tutorial01.html
#   - https://linkml.io/linkml/intro/tutorial02.html
entity="person"
entity_plural="persons"
link_ml="${entity}_linkml.yaml"

gen-json-schema $link_ml > "${entity}_schema.json"
jq . person_schema.json

linkml-convert -s $link_ml "${entity_plural}.yaml" -t json > "${entity_plural}.json"
linkml-validate -s $link_ml "${entity_plural}.yaml"
jq . "${entity_plural}.json"
linkml-validate -s $link_ml "${entity_plural}.json"
linkml-convert -s $link_ml "${entity_plural}.yaml" -t ttl > "${entity_plural}.ttl"
gen-python $link_ml > "${entity}.py"

yuml=$(gen-yuml -f yuml $link_ml)
echo $yuml
python -m webbrowser '$yuml'&
