├── .codespellrc ├── .github └── workflows │ └── codespell.yml ├── .gitignore ├── MAINTAINERS.md ├── Makefile ├── README.md ├── about.yaml ├── config.env ├── config.yaml ├── environment.sh ├── mkdocs.yml ├── models.yaml ├── src ├── docs │ ├── credits.md │ ├── home.md │ └── registry.md └── linkml_registry │ ├── __init__.py │ ├── __pycache__ │ ├── __init__.cpython-310.pyc │ ├── __init__.cpython-39.pyc │ ├── cli.cpython-310.pyc │ ├── evaluate.cpython-310.pyc │ ├── evaluate.cpython-39.pyc │ ├── github_utils.cpython-310.pyc │ ├── github_utils.cpython-39.pyc │ ├── markdown_dumper.cpython-310.pyc │ ├── markdown_dumper.cpython-39.pyc │ ├── registry.cpython-310.pyc │ ├── registry.cpython-39.pyc │ ├── utils.cpython-310.pyc │ └── utils.cpython-39.pyc │ ├── cli.py │ ├── data │ └── models.yaml │ ├── datamodel │ └── registry.py │ ├── evaluate.py │ ├── github_utils.py │ ├── jsonld │ ├── registry.context.jsonld │ └── registry.model.context.jsonld │ ├── jsonschema │ └── registry.schema.json │ ├── markdown_dumper.py │ ├── registry.py │ ├── registry_db_mapping.py │ ├── schema │ └── registry.yaml │ ├── sqlddl │ └── registry.sql │ └── utils.py ├── tests ├── inputs │ └── test_models.yaml ├── outputs │ └── README.md ├── test_imports.py └── test_registry.py └── utils └── get-value.sh /.codespellrc: -------------------------------------------------------------------------------- 1 | [codespell] 2 | skip = .git,*.pdf,*.svg 3 | # ignore escaped chars 4 | ignore-regex = \\[fnrstv] 5 | # 6 | # ignore-words-list = 7 | -------------------------------------------------------------------------------- /.github/workflows/codespell.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Codespell 3 | 4 | on: 5 | push: 6 | branches: [main] 7 | pull_request: 8 | branches: [main] 9 | 10 | permissions: 11 | contents: read 12 | 13 | jobs: 14 | codespell: 15 | name: Check for spelling errors 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v3 21 | - name: Codespell 22 | uses: codespell-project/actions-codespell@v2 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Pipfile 2 | target/ 3 | site/ 4 | venv/ 5 | docs/*md 6 | docs/types/ 7 | */my_schema.* 8 | */__pycache__/* -------------------------------------------------------------------------------- /MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | # How to make a release 2 | 3 | See the instructions at the top of [Makefile](Makefile) 4 | 5 | First install the linkml python package and mkdocs: 6 | 7 | ```bash 8 | . environment.sh 9 | pip install -r requirements.txt 10 | ``` 11 | 12 | Then every time you change the source schema, run: 13 | 14 | ```bash 15 | make all 16 | ``` 17 | 18 | This will generate files in: 19 | 20 | * [docs] 21 | * [jsonschema] 22 | * [shex] 23 | * [owl] 24 | * [rdf] 25 | 26 | Do **not** git add the files in docs 27 | 28 | Once the files are generated, run 29 | 30 | ```bash 31 | make gh-deploy 32 | ``` 33 | 34 | Your documentation will be available from a URL https://my_org_or_name.github.io/my_schema/ 35 | 36 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | MAKEFLAGS += --warn-undefined-variables 2 | SHELL := bash 3 | .SHELLFLAGS := -eu -o pipefail -c 4 | .DEFAULT_GOAL := help 5 | .DELETE_ON_ERROR: 6 | .SUFFIXES: 7 | .SECONDARY: 8 | 9 | RUN = poetry run 10 | # get values from about.yaml file 11 | SCHEMA_NAME = $(shell ${SHELL} ./utils/get-value.sh name) 12 | SOURCE_SCHEMA_PATH = $(shell ${SHELL} ./utils/get-value.sh source_schema_path) 13 | SOURCE_SCHEMA_DIR = $(dir $(SOURCE_SCHEMA_PATH)) 14 | SRC = src 15 | DEST = project 16 | PYMODEL = $(SRC)/$(SCHEMA_NAME)/datamodel 17 | DOCDIR = docs 18 | EXAMPLEDIR = examples 19 | SHEET_MODULE = personinfo_enums 20 | SHEET_ID = $(shell ${SHELL} ./utils/get-value.sh google_sheet_id) 21 | SHEET_TABS = $(shell ${SHELL} ./utils/get-value.sh google_sheet_tabs) 22 | SHEET_MODULE_PATH = $(SOURCE_SCHEMA_DIR)/$(SHEET_MODULE).yaml 23 | 24 | # environment variables 25 | include config.env 26 | 27 | GEN_PARGS = 28 | ifdef LINKML_GENERATORS_PROJECT_ARGS 29 | GEN_PARGS = ${LINKML_GENERATORS_PROJECT_ARGS} 30 | endif 31 | 32 | GEN_DARGS = 33 | ifdef LINKML_GENERATORS_MARKDOWN_ARGS 34 | GEN_DARGS = ${LINKML_GENERATORS_MARKDOWN_ARGS} 35 | endif 36 | 37 | 38 | # basename of a YAML file in model/ 39 | .PHONY: all clean 40 | 41 | # note: "help" MUST be the first target in the file, 42 | # when the user types "make" they should get help info 43 | help: status 44 | @echo "" 45 | @echo "make setup -- initial setup (run this first)" 46 | @echo "make site -- makes site locally" 47 | @echo "make install -- install dependencies" 48 | @echo "make test -- runs tests" 49 | @echo "make lint -- perform linting" 50 | @echo "make testdoc -- builds docs and runs local test server" 51 | @echo "make deploy -- deploys site" 52 | @echo "make update -- updates linkml version" 53 | @echo "make help -- show this help" 54 | @echo "" 55 | 56 | status: check-config 57 | @echo "Project: $(SCHEMA_NAME)" 58 | @echo "Source: $(SOURCE_SCHEMA_PATH)" 59 | 60 | # generate products and add everything to github 61 | setup: install gen-project gen-examples gendoc git-init-add 62 | 63 | # install any dependencies required for building 64 | install: 65 | git init 66 | poetry install 67 | .PHONY: install 68 | 69 | # --- 70 | # Project Synchronization 71 | # --- 72 | # 73 | # check we are up to date 74 | check: cruft-check 75 | cruft-check: 76 | cruft check 77 | cruft-diff: 78 | cruft diff 79 | 80 | update: update-template update-linkml 81 | update-template: 82 | cruft update 83 | 84 | # todo: consider pinning to template 85 | update-linkml: 86 | poetry add -D linkml@latest 87 | 88 | # EXPERIMENTAL 89 | create-data-harmonizer: 90 | npm init data-harmonizer $(SOURCE_SCHEMA_PATH) 91 | 92 | all: site 93 | site: gen-project gendoc 94 | %.yaml: gen-project 95 | deploy: all mkd-gh-deploy 96 | 97 | compile-sheets: 98 | $(RUN) sheets2linkml --gsheet-id $(SHEET_ID) $(SHEET_TABS) > $(SHEET_MODULE_PATH).tmp && mv $(SHEET_MODULE_PATH).tmp $(SHEET_MODULE_PATH) 99 | 100 | # In future this will be done by conversion 101 | gen-examples: 102 | cp src/data/examples/* $(EXAMPLEDIR) 103 | 104 | # generates all project files 105 | 106 | gen-project: $(PYMODEL) 107 | $(RUN) gen-project ${GEN_PARGS} -d $(DEST) $(SOURCE_SCHEMA_PATH) && mv $(DEST)/*.py $(PYMODEL) 108 | 109 | 110 | test: test-schema test-python test-examples 111 | 112 | test-schema: 113 | $(RUN) gen-project ${GEN_PARGS} -d tmp $(SOURCE_SCHEMA_PATH) 114 | 115 | test-python: 116 | $(RUN) python -m unittest discover 117 | 118 | lint: 119 | $(RUN) linkml-lint $(SOURCE_SCHEMA_PATH) 120 | 121 | check-config: 122 | @(grep my-datamodel about.yaml > /dev/null && printf "\n**Project not configured**:\n\n - Remember to edit 'about.yaml'\n\n" || exit 0) 123 | 124 | convert-examples-to-%: 125 | $(patsubst %, $(RUN) linkml-convert % -s $(SOURCE_SCHEMA_PATH) -C Person, $(shell ${SHELL} find src/data/examples -name "*.yaml")) 126 | 127 | examples/%.yaml: src/data/examples/%.yaml 128 | $(RUN) linkml-convert -s $(SOURCE_SCHEMA_PATH) -C Person $< -o $@ 129 | examples/%.json: src/data/examples/%.yaml 130 | $(RUN) linkml-convert -s $(SOURCE_SCHEMA_PATH) -C Person $< -o $@ 131 | examples/%.ttl: src/data/examples/%.yaml 132 | $(RUN) linkml-convert -P EXAMPLE=http://example.org/ -s $(SOURCE_SCHEMA_PATH) -C Person $< -o $@ 133 | 134 | test-examples: examples/output 135 | 136 | examples/output: src/linkml_common/schema/linkml_common.yaml 137 | mkdir -p $@ 138 | $(RUN) linkml-run-examples \ 139 | --output-formats json \ 140 | --output-formats yaml \ 141 | --counter-example-input-directory src/data/examples/invalid \ 142 | --input-directory src/data/examples/valid \ 143 | --output-directory $@ \ 144 | --schema $< > $@/README.md 145 | .PHONY: examples/output 146 | 147 | # Test documentation locally 148 | serve: mkd-serve 149 | 150 | # Python datamodel 151 | $(PYMODEL): 152 | mkdir -p $@ 153 | 154 | 155 | $(DOCDIR): 156 | mkdir -p $@ 157 | 158 | gendoc: $(DOCDIR) 159 | cp $(SRC)/docs/*md $(DOCDIR) ; \ 160 | $(RUN) gen-doc ${GEN_DARGS} -d $(DOCDIR) $(SOURCE_SCHEMA_PATH) 161 | 162 | testdoc: gendoc serve 163 | 164 | MKDOCS = $(RUN) mkdocs 165 | mkd-%: 166 | $(MKDOCS) $* 167 | 168 | PROJECT_FOLDERS = sqlschema shex shacl protobuf prefixmap owl jsonschema jsonld graphql excel 169 | git-init-add: git-init git-add git-commit git-status 170 | git-init: 171 | git init 172 | git-add: .cruft.json 173 | git add .gitignore .github .cruft.json Makefile LICENSE *.md examples utils about.yaml mkdocs.yml poetry.lock project.Makefile pyproject.toml src/linkml_common/schema/*yaml src/*/datamodel/*py src/data src/docs tests src/*/_version.py 174 | git add $(patsubst %, project/%, $(PROJECT_FOLDERS)) 175 | git-commit: 176 | git commit -m 'chore: initial commit' -a 177 | git-status: 178 | git status 179 | 180 | # only necessary if setting up via cookiecutter 181 | .cruft.json: 182 | echo "creating a stub for .cruft.json. IMPORTANT: setup via cruft not cookiecutter recommended!" ; \ 183 | touch $@ 184 | 185 | clean: 186 | rm -rf $(DEST) 187 | rm -rf tmp 188 | rm -fr docs/* 189 | rm -fr $(PYMODEL)/* 190 | 191 | include project.Makefile 192 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LinkML Registry 2 | 3 | Registry of LinkML schemas 4 | 5 | See the registry: 6 | 7 | * [linkml-registry](https://linkml.github.io/linkml-registry/registry/) 8 | 9 | Metadata: 10 | 11 | * [models.yaml](models.yaml) 12 | 13 | Registry Schema: 14 | 15 | * [https://linkml.github.io/linkml-registry/registry/](https://linkml.github.io/linkml-registry/registry) 16 | 17 | ## How to register a schema 18 | 19 | Make a Pull Request on: 20 | 21 | * [src/linkml_registry/data/models.yaml](src/linkml_registry/data/models.yaml) 22 | 23 | You should also add the `linkml` tag on your repo so it shows up here: [https://github.com/topics/linkml](https://github.com/topics/linkml) 24 | 25 | This is then compiled to the models.yaml in the top level (do not edit this directly). Currently this is a manual step but in future this will be done with github actions 26 | 27 | ## Rebuilding the index 28 | 29 | TODO: run via gh actions 30 | 31 | ```bash 32 | make src/docs/registry.md 33 | ``` 34 | -------------------------------------------------------------------------------- /about.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: linkml_registry 3 | author: LinkML Registry Authors 4 | description: Registry for LinkML 5 | source_schema_path: src/linkml_registry/schema/registry.yaml 6 | 7 | -------------------------------------------------------------------------------- /config.env: -------------------------------------------------------------------------------- 1 | LINKML_GENERATORS_PROJECT_ARGS=--config-file config.yaml 2 | 3 | ### Extra layer of configuration for Makefile beyond 4 | ### what 'gen-project --config-file config.yaml' provides. 5 | ### Uncomment and set environment variables as needed. 6 | 7 | # LINKML_GENERATORS_MARKDOWN_ARGS=--no-mergeimports 8 | 9 | -------------------------------------------------------------------------------- /config.yaml: -------------------------------------------------------------------------------- 1 | # Configuration of generators (defaults illustrated) 2 | --- 3 | generator_args: 4 | excel: 5 | mergeimports: true 6 | owl: 7 | mergeimports: true 8 | metaclasses: false 9 | type_objects: false 10 | add_root_classes: true 11 | # throws 'Cannot handle metadata profile: rdfs' 12 | # metadata_profile: rdfs 13 | markdown: 14 | mergeimports: true 15 | graphql: 16 | mergeimports: true 17 | java: 18 | mergeimports: true 19 | metadata: true 20 | jsonld: 21 | mergeimports: true 22 | jsonschema: 23 | mergeimports: true 24 | jsonldcontext: 25 | mergeimports: true 26 | python: 27 | mergeimports: true 28 | prefixmap: 29 | mergeimports: true 30 | proto: 31 | mergeimports: true 32 | shacl: 33 | mergeimports: true 34 | shex: 35 | mergeimports: true 36 | sqlddl: 37 | mergeimports: true 38 | typescript: 39 | mergeimports: true 40 | metadata: true 41 | 42 | ... 43 | -------------------------------------------------------------------------------- /environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | python3 -m venv venv 3 | source venv/bin/activate 4 | export PYTHONPATH=.:$PYTHONPATH 5 | 6 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: "LinkML Registry" 2 | theme: 3 | name: readthedocs 4 | nav: 5 | - Home: home.md 6 | - Registry: registry.md 7 | - Index: index.md 8 | - Credits: credits.md 9 | site_url: https://linkml.github.io/linkml-registry/ 10 | repo_url: https://github.com/linkml/linkml-registry 11 | -------------------------------------------------------------------------------- /models.yaml: -------------------------------------------------------------------------------- 1 | name: LinkML-Main-Registry 2 | homepage: https://github.com/linkml/linkml-registry 3 | entries: 4 | LinkML Model: 5 | name: LinkML Model 6 | title: LinkML Schema Metamodel 7 | description: 'The metamodel for schemas defined using the Linked Data Modeling 8 | Language framework. 9 | 10 | 11 | For more information on LinkML: 12 | 13 | 14 | * [linkml.io](https://linkml.io) main website 15 | 16 | * [specification](https://w3id.org/linkml/docs/specification/) 17 | 18 | 19 | LinkML is self-describing. Every LinkML schema consists of elements 20 | 21 | that instantiate classes in this metamodel. 22 | 23 | 24 | Core metaclasses: 25 | 26 | 27 | * [SchemaDefinition](https://w3id.org/linkml/SchemaDefinition) 28 | 29 | * [ClassDefinition](https://w3id.org/linkml/ClassDefinition) 30 | 31 | * [SlotDefinition](https://w3id.org/linkml/SlotDefinition) 32 | 33 | * [TypeDefinition](https://w3id.org/linkml/TypeDefinition) 34 | 35 | 36 | There are many subsets of *profiles* of the metamodel, for different purposes: 37 | 38 | 39 | * [MinimalSubset](https://w3id.org/linkml/MinimalSubset) 40 | 41 | * [BasicSubset](https://w3id.org/linkml/BasicSubset) 42 | 43 | * [BasicSubset](https://w3id.org/linkml/BasicSubset) 44 | 45 | 46 | For canonical reference documentation on any metamodel construct, 47 | 48 | refer to the official URI for each construct, e.g. 49 | 50 | [https://w3id.org/linkml/is_a](https://w3id.org/linkml/is_a)' 51 | homepage: https://linkml.github.io/linkml-model/docs/ 52 | schema_url: https://github.com/linkml/linkml-model/blob/main/model/schema/meta.yaml 53 | github_repo: linkml/linkml-model 54 | schema_relative_path: linkml_model/model/schema/meta.yaml 55 | license: https://creativecommons.org/publicdomain/zero/1.0/ 56 | topics: 57 | - meta 58 | class_count: 41 59 | slot_count: 220 60 | enum_count: 4 61 | type_count: 19 62 | github_stars: 26 63 | proportion_elements_with_a_description: 0.9683098591549296 64 | proportion_elements_mapped: 0.2992957746478873 65 | LinkML Template Configuration Model: 66 | name: LinkML Template Configuration Model 67 | title: LinkML template configuration 68 | homepage: https://linkml.github.io/template-config-model/ 69 | schema_url: https://github.com/linkml/template-config-model/blob/main/model/schema/config_model.yaml 70 | github_repo: linkml/template-config-model 71 | license: CC-0 72 | topics: 73 | - meta 74 | github_stars: 1 75 | NMDC: 76 | name: NMDC 77 | title: NMDC Schema 78 | description: "Schema for National Microbiome Data Collaborative (NMDC).\nThis\ 79 | \ schema is organized into multiple modules, such as:\n\n * a set of core types\ 80 | \ for representing data values\n * a subset of the mixs schema\n * an annotation\ 81 | \ schema\n * the NMDC schema itself, into which the other modules are imported" 82 | homepage: https://microbiomedata.github.io/nmdc-schema/ 83 | github_repo: microbiomedata/nmdc-schema 84 | schema_relative_path: src/schema/nmdc.yaml 85 | license: https://creativecommons.org/publicdomain/zero/1.0/ 86 | topics: 87 | - environmental microbiology 88 | class_count: 69 89 | slot_count: 864 90 | enum_count: 124 91 | type_count: 24 92 | github_stars: 23 93 | proportion_elements_with_a_description: 0.7446808510638298 94 | proportion_elements_mapped: 0.5023126734505088 95 | Biolink-Model: 96 | name: Biolink-Model 97 | title: Biolink Model 98 | description: Entity and association taxonomy and datamodel for life-sciences data 99 | homepage: https://biolink.github.io/biolink-model/ 100 | github_repo: biolink/biolink-model 101 | schema_relative_path: biolink-model.yaml 102 | license: https://creativecommons.org/publicdomain/zero/1.0/ 103 | topics: 104 | - genomics 105 | - disease 106 | - phenotype 107 | - expression 108 | - GO 109 | - GO-CAM 110 | - human biology 111 | - model organism biology 112 | - biochemistry 113 | - biology 114 | class_count: 302 115 | slot_count: 460 116 | enum_count: 19 117 | type_count: 32 118 | github_stars: 155 119 | proportion_elements_with_a_description: 0.7220172201722017 120 | proportion_elements_mapped: 0.38253382533825336 121 | SSSOM: 122 | name: SSSOM 123 | title: Simple Standard Sharing Object Mappings 124 | description: Datamodel for Simple Standard for Sharing Ontological Mappings (SSSOM) 125 | homepage: https://mapping-commons.github.io/sssom/ 126 | github_repo: mapping-commons/SSSOM 127 | schema_relative_path: src/sssom_schema/schema/sssom_schema.yaml 128 | license: CC-0 129 | topics: 130 | - information 131 | - mappings 132 | class_count: 5 133 | slot_count: 71 134 | enum_count: 3 135 | type_count: 20 136 | github_stars: 128 137 | proportion_elements_with_a_description: 0.9696969696969697 138 | proportion_elements_mapped: 0.3939393939393939 139 | KGCL: 140 | name: KGCL 141 | title: Knowledge Graph Change Language 142 | description: 'A data model for describing change operations at a high level on 143 | an ontology or ontology-like artefact, such as a Knowledge Graph. 144 | 145 | 146 | * [Browse Schema](https://cmungall.github.io/knowledge-graph-change-language/) 147 | 148 | * [GitHub](https://github.com/cmungall/knowledge-graph-change-language)' 149 | homepage: https://cmungall.github.io/knowledge-graph-change-language/ 150 | schema_url: '' 151 | github_repo: cmungall/knowledge-graph-change-language 152 | schema_relative_path: src/schema/kgcl.yaml 153 | license: https://creativecommons.org/publicdomain/zero/1.0/ 154 | topics: 155 | - knowledge graphs 156 | class_count: 71 157 | slot_count: 70 158 | enum_count: 2 159 | type_count: 21 160 | github_stars: 15 161 | proportion_elements_with_a_description: 0.7439024390243902 162 | proportion_elements_mapped: 0.23780487804878048 163 | COMET: 164 | name: COMET 165 | title: linkml-common 166 | description: Common Data Model Elements 167 | homepage: https://linkml.io/linkml-common/ 168 | github_repo: linkml/linkml-common 169 | schema_relative_path: src/linkml_common/schema/linkml_common.yaml 170 | license: MIT 171 | topics: 172 | - common data model 173 | class_count: 84 174 | slot_count: 26 175 | enum_count: 6 176 | type_count: 19 177 | github_stars: 5 178 | proportion_elements_with_a_description: 0.5111111111111111 179 | proportion_elements_mapped: 0.4222222222222222 180 | CMDR: 181 | name: CMDR 182 | title: cmdr 183 | description: Core Model for Data Research (Tentative) 184 | homepage: https://linkml.io/cmdr/ 185 | github_repo: linkml/cmdr 186 | schema_relative_path: src/cmdr/schema/cmdr.yaml 187 | license: MIT 188 | topics: 189 | - common data model 190 | class_count: 10 191 | slot_count: 21 192 | enum_count: 0 193 | type_count: 19 194 | github_stars: 6 195 | proportion_elements_with_a_description: 0.54 196 | proportion_elements_mapped: 0.42 197 | KGViz: 198 | name: KGViz 199 | title: Knowledge Graph Visualization Configuration 200 | description: 'A data model for describing configurations / stylesheets for visualzing 201 | graphs, and 202 | 203 | in particular Knowledge Graphs or Ontologies. These graphs are characterized 204 | by having meaningful edge labels, 205 | 206 | node categories, IDs or URIs on each element, as well as additional rich metadata 207 | on the nodes or edges. 208 | 209 | 210 | An example of a use of this is https://github.com/INCATools/obographviz' 211 | homepage: https://berkeleybop.github.io/kgviz-model/ 212 | schema_url: '' 213 | github_repo: berkeleybop/kgviz-model 214 | schema_relative_path: src/kgviz_model/linkml/kgviz.yaml 215 | license: https://creativecommons.org/publicdomain/zero/1.0/ 216 | topics: 217 | - visualization 218 | class_count: 16 219 | slot_count: 31 220 | enum_count: 3 221 | type_count: 21 222 | github_stars: 4 223 | proportion_elements_with_a_description: 0.5774647887323944 224 | proportion_elements_mapped: 0.323943661971831 225 | Semantic SQL: 226 | name: Semantic SQL 227 | title: Semantic SQL 228 | description: "A datamodel for RDF, OWL, and OBO Ontologies designed to work harmoniously\ 229 | \ with SQL databases.\n\nNote that the primary purpose of this linkml schema\ 230 | \ is to organize and define SQL VIEWs to\nbe used on top of a generic SQL database\ 231 | \ following the rdftab statements schema.\nThese SQL views are encoded with\ 232 | \ the `sqlviews>>` tag inside the yaml.\n\nWe use linkml to do this rather than\ 233 | \ a simple SQL DDL file because linkml gives\nus a standard way to do things\ 234 | \ such as:\n\n * attach descriptions to each view\n * define a data dictionary\ 235 | \ of all columns used, together with domains/ranges\n * modular structure with\ 236 | \ imports\n * the ability to attach rich semantic metadata to each schema element\n\ 237 | \nAdditionally, the framework provides automatic compilation to SQLAlchemy models,\n\ 238 | and tools for being able to turn views into indexed tables for efficient querying,\n\ 239 | as well as a rich searchable documentation system and other tooling.\n\nThis\ 240 | \ schema is best browsed online: https://cmungall.github.io/semantic-sql/\n\n\ 241 | Note that things are in flux, and there some oddities that need ironed out,\ 242 | \ see\nissues for details.\n\nSee the [github repo](https://github.com/cmungall/semantic-sql)\ 243 | \ for code to convert\nfrom the linkml yaml into SQL DDL" 244 | homepage: https://cmungall.github.io/semantic-sql/ 245 | github_repo: cmungall/semantic-sql 246 | schema_relative_path: src/semsql/linkml/semsql.yaml 247 | license: https://creativecommons.org/publicdomain/zero/1.0/ 248 | topics: 249 | - ontologies 250 | class_count: 103 251 | slot_count: 34 252 | enum_count: 0 253 | type_count: 21 254 | github_stars: 32 255 | proportion_elements_with_a_description: 0.5443037974683544 256 | proportion_elements_mapped: 0.2721518987341772 257 | Chemical Entities and Mixtures Model: 258 | name: Chemical Entities and Mixtures Model 259 | title: Chemical Entities Mixtures and Reactions Ontological Framework 260 | description: 'A data model for managing information about chemical entities, ranging 261 | from atoms 262 | 263 | through molecules to complex mixtures. 264 | 265 | 266 | Aspects of this have been cribbed from various sources including CHEBI, SIO, 267 | 268 | Wikipedia/Wikidata, the NCATS Translator Chemical Working Group, but all mistakes 269 | 270 | are my own. 271 | 272 | 273 | For full context/motivation see the [GitHub repo](https://github.com/chemkg/chemrof).' 274 | homepage: https://chemkg.github.io/chemrof/ 275 | github_repo: chemkg/chemrof 276 | schema_relative_path: src/schema/chemrof.yaml 277 | license: https://creativecommons.org/publicdomain/zero/1.0/ 278 | topics: 279 | - chemistry 280 | class_count: 126 281 | slot_count: 217 282 | enum_count: 9 283 | type_count: 27 284 | github_stars: 11 285 | proportion_elements_with_a_description: 0.5435356200527705 286 | proportion_elements_mapped: 0.19261213720316622 287 | CRDC-H-Model: 288 | name: CRDC-H-Model 289 | title: CRDC-H Model 290 | homepage: https://cancerdhc.github.io/ccdhmodel 291 | schema_url: '' 292 | github_repo: cancerdhc/ccdhmodel 293 | schema_relative_path: model/schema/crdch_model.yaml 294 | license: https://creativecommons.org/publicdomain/zero/1.0/ 295 | topics: 296 | - cancer 297 | class_count: 41 298 | slot_count: 0 299 | enum_count: 106 300 | type_count: 26 301 | github_stars: 16 302 | proportion_elements_with_a_description: 0.9884393063583815 303 | proportion_elements_mapped: 0.15028901734104047 304 | Ontology-Associations: 305 | name: Ontology-Associations 306 | title: common association file formats 307 | homepage: https://biodatamodels.github.io/ontology-associations/ 308 | schema_url: '' 309 | github_repo: biodatamodels/ontology-associations 310 | license: CC-0 311 | topics: 312 | - genomics 313 | github_stars: 4 314 | GFF3: 315 | name: GFF3 316 | title: Genome Feature Format LinkML rendering 317 | description: Playing around with GFF spec 318 | homepage: https://biodatamodels.github.io/gff-schema/ 319 | schema_url: '' 320 | github_repo: biodatamodels/gff-schema 321 | schema_relative_path: src/schema/gff.yaml 322 | license: CC-0 323 | topics: 324 | - genomics 325 | class_count: 8 326 | slot_count: 26 327 | enum_count: 3 328 | type_count: 21 329 | github_stars: 5 330 | proportion_elements_with_a_description: 0.6724137931034483 331 | proportion_elements_mapped: 0.43103448275862066 332 | Monochrom: 333 | name: Monochrom 334 | title: Chromosome ontology and ETL 335 | homepage: https://monarch-initiative.github.io/monochrom/ 336 | schema_url: https://github.com/monarch-initiative/monochrom/blob/master/model/schema/chromo.yaml 337 | github_repo: monarch-initiative/monochrom 338 | license: CC-0 339 | topics: 340 | - genomics 341 | github_stars: 12 342 | GSC MIxS: 343 | name: GSC MIxS 344 | title: '' 345 | homepage: '' 346 | schema_url: '' 347 | license: '' 348 | topics: 349 | - genomics 350 | Babelon: 351 | name: Babelon 352 | title: A schema for describing translations and language profiles for ontologies 353 | homepage: https://matentzn.github.io/babelon/ 354 | schema_url: '' 355 | github_repo: matentzn/babelon 356 | license: CC-0 357 | topics: 358 | - ontologies 359 | github_stars: 7 360 | HOT-TermCI: 361 | name: HOT-TermCI 362 | title: HOT-TermCI 363 | description: Terminology Core Common Model 364 | homepage: https://github.com/HOT-Ecosystem/TermCI-model 365 | schema_url: '' 366 | github_repo: HOT-Ecosystem/TermCI-model 367 | schema_relative_path: src/schema/tccm_schema.yaml 368 | license: '' 369 | topics: 370 | - clinical 371 | class_count: 4 372 | slot_count: 15 373 | enum_count: 0 374 | type_count: 19 375 | github_stars: 3 376 | proportion_elements_with_a_description: 1.0 377 | proportion_elements_mapped: 0.868421052631579 378 | Alliance of Genome Resource Persistent Schema: 379 | name: Alliance of Genome Resource Persistent Schema 380 | title: Alliance of Genome Resources Persistent Schema 381 | description: Alliance Persistent Schema 382 | homepage: '' 383 | schema_url: '' 384 | github_repo: alliance-genome/agr_curation_schema 385 | schema_relative_path: model/schema/allianceModel.yaml 386 | license: https://creativecommons.org/publicdomain/zero/1.0/ 387 | topics: 388 | - genomics 389 | class_count: 285 390 | slot_count: 600 391 | enum_count: 21 392 | type_count: 20 393 | github_stars: 6 394 | proportion_elements_with_a_description: 0.712742980561555 395 | proportion_elements_mapped: 0.04103671706263499 396 | SESAR: 397 | name: SESAR 398 | title: '' 399 | homepage: '' 400 | schema_url: '' 401 | license: '' 402 | topics: 403 | - earth science 404 | OBOGraphs: 405 | name: OBOGraphs 406 | title: '' 407 | homepage: '' 408 | schema_url: '' 409 | github_repo: biodatamodels/obograph 410 | license: '' 411 | topics: 412 | - ontologies 413 | github_stars: 4 414 | GHGA Metadata: 415 | name: GHGA Metadata 416 | title: Metadata schema for the German Human Genome-Phenome Archive (GHGA) 417 | description: The submission centric metadata schema for the German Human Genome-Phenome 418 | Archive (GHGA). 419 | homepage: https://ghga-de.github.io/ghga-metadata-schema/ 420 | github_repo: ghga-de/ghga-metadata-schema 421 | schema_relative_path: src/schema/submission.yaml 422 | class_count: 26 423 | slot_count: 112 424 | enum_count: 30 425 | type_count: 19 426 | github_stars: 13 427 | proportion_elements_with_a_description: 0.9893048128342246 428 | proportion_elements_mapped: 0.18716577540106952 429 | MIANCT: 430 | name: MIANCT 431 | title: Minimal Information About a new Cell Type 432 | description: "\nThis schema is CJM's attempt to translate Tiago's [minimal info\ 433 | \ doc](https://docs.google.com/document/d/1EVgs2Z5dpJs7cbuSBwWlg1xOWQEqMtbSKRGgdneXnU8/edit#)\ 434 | \ into a LinkML schema\n\nThe schema is fairly minimal and is in the form of\ 435 | \ a \"checklist\" style schema. It is a set of fields mostly associated with\ 436 | \ this class:\n\n * [CellType](CellType.md)\n\nThere are a set of examples\ 437 | \ here:\n\n * [tests/input](https://github.com/cmungall/mianct-schema/tree/main/tests/input)\n\ 438 | \nCurrently the examples are YAML, but the YAML is deliberately flat as this\ 439 | \ is a \"checklist\" schema, and we could have TSV/CSV/xlsx here\n\nTODO:\n\n\ 440 | \ - include \"packages\" and \"checklists\"; e.g.\n - a neuron package\ 441 | \ would have the enum for morphologies constrained\n - a transcriptomics\ 442 | \ package would make it required to enter the set of marker genes\n - see\ 443 | \ [MIxS schema](https://cmungall.github.io/mixs-source/) for example of how\ 444 | \ this might work\n - document how this relates to dosdp/robot templates\n\ 445 | \ \nWhen should one provide an entry for a cell type in a MIANCT sheet?\n\n\ 446 | \ - When there is a claim of a new cell class (type or state) that has not been\ 447 | \ described before\n - When new information is discovered for a previously cataloged\ 448 | \ type that might influence its cataloguing (i.e. description of the presence\ 449 | \ in a different species or in a new location)\n - When a cell type mentioned\ 450 | \ in the article has been described before, but is not yet catalogued on an\ 451 | \ authoritative source like the Cell Ontology." 452 | homepage: https://cmungall.github.io/mianct-schema/ 453 | github_repo: cmungall/mianct-schema 454 | schema_relative_path: model/schema/mianct.yaml 455 | license: https://creativecommons.org/publicdomain/zero/1.0/ 456 | topics: 457 | - samples 458 | - cell types 459 | class_count: 2 460 | slot_count: 11 461 | enum_count: 3 462 | type_count: 20 463 | github_stars: 4 464 | proportion_elements_with_a_description: 0.6944444444444444 465 | proportion_elements_mapped: 0.75 466 | iSamples: 467 | name: iSamples 468 | title: iSamples 469 | homepage: https://github.com/isamplesorg/metadata 470 | github_repo: isamplesorg/metadata 471 | license: https://creativecommons.org/publicdomain/zero/1.0/ 472 | topics: 473 | - samples 474 | - metadata 475 | - earth science 476 | github_stars: 6 477 | sparqlfun: 478 | name: sparqlfun 479 | title: SPARQLFun 480 | description: SPARQL Templates 481 | homepage: https://github.com/linkml/sparqlfun 482 | github_repo: linkml/sparqlfun 483 | schema_relative_path: sparqlfun/schema/sparqlfun.yaml 484 | license: https://creativecommons.org/publicdomain/zero/1.0/ 485 | topics: 486 | - sparql 487 | - templates 488 | class_count: 92 489 | slot_count: 61 490 | enum_count: 2 491 | type_count: 21 492 | github_stars: 8 493 | proportion_elements_with_a_description: 0.3352272727272727 494 | proportion_elements_mapped: 0.3409090909090909 495 | LinkML-Phenopackets: 496 | name: LinkML-Phenopackets 497 | title: LinkML-Phenopackets 498 | description: 'Automatic translation of phenopackets protobuf to LinkML. Status: 499 | EXPERIMENTAL.' 500 | homepage: https://phenopackets-schema.readthedocs.io/en/latest/ 501 | github_repo: cmungall/linkml-phenopackets 502 | schema_relative_path: src/phenopackets/schema/phenopackets.yaml 503 | license: https://creativecommons.org/publicdomain/zero/1.0/ 504 | topics: 505 | - clinical 506 | class_count: 73 507 | slot_count: 0 508 | enum_count: 30 509 | type_count: 19 510 | github_stars: 7 511 | proportion_elements_with_a_description: 0.4918032786885246 512 | proportion_elements_mapped: 0.23770491803278687 513 | INCLUDE: 514 | name: INCLUDE 515 | title: The INvestigation of Co-occurring conditions across the Lifespan to Understand 516 | Down syndromE (INCLUDE) data model 517 | homepage: https://github.com/include-dcc/include-linkml 518 | schema_url: '' 519 | github_repo: include-dcc/include-linkml 520 | license: CC-0 521 | topics: 522 | - Ontologies 523 | - Down syndrome 524 | - Clinical research 525 | github_stars: 1 526 | title: This is the main LinkML registry 527 | -------------------------------------------------------------------------------- /src/docs/credits.md: -------------------------------------------------------------------------------- 1 | # Credits 2 | 3 | this project was made using the [LinkML framework](https://github.com/biolink/biolinkml) 4 | -------------------------------------------------------------------------------- /src/docs/home.md: -------------------------------------------------------------------------------- 1 | # LinkML Registry 2 | 3 | This site provides both 4 | 5 | * A schema for the LinkML schema registry 6 | * The registry itself 7 | 8 | ## Links 9 | 10 | * [linkml-registry](https://linkml.github.io/linkml-registry/registry/) 11 | 12 | Registry Schema: 13 | 14 | * [https://linkml.github.io/linkml-registry/registry/](https://linkml.github.io/linkml-registry/registry) 15 | 16 | Github: 17 | 18 | * https://github.com/linkml/linkml-registry 19 | 20 | ## Validation Steps 21 | 22 | todo 23 | 24 | ## Browsing 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/docs/registry.md: -------------------------------------------------------------------------------- 1 | # LinkML Registry Entries 2 | 3 | ## LinkML Schema Metamodel 4 | 5 | The metamodel for schemas defined using the Linked Data Modeling Language framework. 6 | 7 | For more information on LinkML: 8 | 9 | * [linkml.io](https://linkml.io) main website 10 | * [specification](https://w3id.org/linkml/docs/specification/) 11 | 12 | LinkML is self-describing. Every LinkML schema consists of elements 13 | that instantiate classes in this metamodel. 14 | 15 | Core metaclasses: 16 | 17 | * [SchemaDefinition](https://w3id.org/linkml/SchemaDefinition) 18 | * [ClassDefinition](https://w3id.org/linkml/ClassDefinition) 19 | * [SlotDefinition](https://w3id.org/linkml/SlotDefinition) 20 | * [TypeDefinition](https://w3id.org/linkml/TypeDefinition) 21 | 22 | There are many subsets of *profiles* of the metamodel, for different purposes: 23 | 24 | * [MinimalSubset](https://w3id.org/linkml/MinimalSubset) 25 | * [BasicSubset](https://w3id.org/linkml/BasicSubset) 26 | * [BasicSubset](https://w3id.org/linkml/BasicSubset) 27 | 28 | For canonical reference documentation on any metamodel construct, 29 | refer to the official URI for each construct, e.g. 30 | [https://w3id.org/linkml/is_a](https://w3id.org/linkml/is_a) 31 | 32 | 33 | |key|value| 34 | | :---: | :---: | 35 | |name|LinkML Model| 36 | |title|LinkML Schema Metamodel| 37 | |homepage|[https://linkml.github.io/linkml-model/docs/](https://linkml.github.io/linkml-model/docs/)| 38 | |schema_url|[https://github.com/linkml/linkml-model/blob/main/model/schema/meta.yaml](https://github.com/linkml/linkml-model/blob/main/model/schema/meta.yaml)| 39 | |github_repo|linkml/linkml-model| 40 | |schema_relative_path|linkml_model/model/schema/meta.yaml| 41 | |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| 42 | |topics|meta| 43 | |class_count|41| 44 | |slot_count|220| 45 | |enum_count|4| 46 | |type_count|19| 47 | |github_stars|26| 48 | |proportion_elements_with_a_description|0.96| 49 | |proportion_elements_mapped|0.29| 50 | 51 | ## LinkML template configuration 52 | 53 | None 54 | 55 | 56 | |key|value| 57 | | :---: | :---: | 58 | |name|LinkML Template Configuration Model| 59 | |title|LinkML template configuration| 60 | |homepage|[https://linkml.github.io/template-config-model/](https://linkml.github.io/template-config-model/)| 61 | |schema_url|[https://github.com/linkml/template-config-model/blob/main/model/schema/config_model.yaml](https://github.com/linkml/template-config-model/blob/main/model/schema/config_model.yaml)| 62 | |github_repo|linkml/template-config-model| 63 | |license|CC-0| 64 | |topics|meta| 65 | |github_stars|1| 66 | 67 | ## NMDC Schema 68 | 69 | Schema for National Microbiome Data Collaborative (NMDC). 70 | This schema is organized into multiple modules, such as: 71 | 72 | * a set of core types for representing data values 73 | * a subset of the mixs schema 74 | * an annotation schema 75 | * the NMDC schema itself, into which the other modules are imported 76 | 77 | 78 | |key|value| 79 | | :---: | :---: | 80 | |name|NMDC| 81 | |title|NMDC Schema| 82 | |homepage|[https://microbiomedata.github.io/nmdc-schema/](https://microbiomedata.github.io/nmdc-schema/)| 83 | |github_repo|microbiomedata/nmdc-schema| 84 | |schema_relative_path|src/schema/nmdc.yaml| 85 | |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| 86 | |topics|environmental microbiology| 87 | |class_count|69| 88 | |slot_count|864| 89 | |enum_count|124| 90 | |type_count|24| 91 | |github_stars|23| 92 | |proportion_elements_with_a_description|0.74| 93 | |proportion_elements_mapped|0.5| 94 | 95 | ## Biolink Model 96 | 97 | Entity and association taxonomy and datamodel for life-sciences data 98 | 99 | 100 | |key|value| 101 | | :---: | :---: | 102 | |name|Biolink-Model| 103 | |title|Biolink Model| 104 | |homepage|[https://biolink.github.io/biolink-model/](https://biolink.github.io/biolink-model/)| 105 | |github_repo|biolink/biolink-model| 106 | |schema_relative_path|biolink-model.yaml| 107 | |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| 108 | |topics|genomics; disease; phenotype; expression; GO; GO-CAM; human biology; model organism biology; biochemistry; biology| 109 | |class_count|302| 110 | |slot_count|460| 111 | |enum_count|19| 112 | |type_count|32| 113 | |github_stars|155| 114 | |proportion_elements_with_a_description|0.72| 115 | |proportion_elements_mapped|0.38| 116 | 117 | ## Simple Standard Sharing Object Mappings 118 | 119 | Datamodel for Simple Standard for Sharing Ontological Mappings (SSSOM) 120 | 121 | 122 | |key|value| 123 | | :---: | :---: | 124 | |name|SSSOM| 125 | |title|Simple Standard Sharing Object Mappings| 126 | |homepage|[https://mapping-commons.github.io/sssom/](https://mapping-commons.github.io/sssom/)| 127 | |github_repo|mapping-commons/SSSOM| 128 | |schema_relative_path|src/sssom_schema/schema/sssom_schema.yaml| 129 | |license|CC-0| 130 | |topics|information; mappings| 131 | |class_count|5| 132 | |slot_count|71| 133 | |enum_count|3| 134 | |type_count|20| 135 | |github_stars|128| 136 | |proportion_elements_with_a_description|0.96| 137 | |proportion_elements_mapped|0.39| 138 | 139 | ## Knowledge Graph Change Language 140 | 141 | A data model for describing change operations at a high level on an ontology or ontology-like artefact, such as a Knowledge Graph. 142 | 143 | * [Browse Schema](https://cmungall.github.io/knowledge-graph-change-language/) 144 | * [GitHub](https://github.com/cmungall/knowledge-graph-change-language) 145 | 146 | 147 | |key|value| 148 | | :---: | :---: | 149 | |name|KGCL| 150 | |title|Knowledge Graph Change Language| 151 | |homepage|[https://cmungall.github.io/knowledge-graph-change-language/](https://cmungall.github.io/knowledge-graph-change-language/)| 152 | |github_repo|cmungall/knowledge-graph-change-language| 153 | |schema_relative_path|src/schema/kgcl.yaml| 154 | |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| 155 | |topics|knowledge graphs| 156 | |class_count|71| 157 | |slot_count|70| 158 | |enum_count|2| 159 | |type_count|21| 160 | |github_stars|15| 161 | |proportion_elements_with_a_description|0.74| 162 | |proportion_elements_mapped|0.23| 163 | 164 | ## linkml-common 165 | 166 | Common Data Model Elements 167 | 168 | 169 | |key|value| 170 | | :---: | :---: | 171 | |name|COMET| 172 | |title|linkml-common| 173 | |homepage|[https://linkml.io/linkml-common/](https://linkml.io/linkml-common/)| 174 | |github_repo|linkml/linkml-common| 175 | |schema_relative_path|src/linkml_common/schema/linkml_common.yaml| 176 | |license|MIT| 177 | |topics|common data model| 178 | |class_count|84| 179 | |slot_count|26| 180 | |enum_count|6| 181 | |type_count|19| 182 | |github_stars|5| 183 | |proportion_elements_with_a_description|0.51| 184 | |proportion_elements_mapped|0.42| 185 | 186 | ## cmdr 187 | 188 | Core Model for Data Research (Tentative) 189 | 190 | 191 | |key|value| 192 | | :---: | :---: | 193 | |name|CMDR| 194 | |title|cmdr| 195 | |homepage|[https://linkml.io/cmdr/](https://linkml.io/cmdr/)| 196 | |github_repo|linkml/cmdr| 197 | |schema_relative_path|src/cmdr/schema/cmdr.yaml| 198 | |license|MIT| 199 | |topics|common data model| 200 | |class_count|10| 201 | |slot_count|21| 202 | |enum_count|0| 203 | |type_count|19| 204 | |github_stars|6| 205 | |proportion_elements_with_a_description|0.54| 206 | |proportion_elements_mapped|0.42| 207 | 208 | ## Knowledge Graph Visualization Configuration 209 | 210 | A data model for describing configurations / stylesheets for visualzing graphs, and 211 | in particular Knowledge Graphs or Ontologies. These graphs are characterized by having meaningful edge labels, 212 | node categories, IDs or URIs on each element, as well as additional rich metadata on the nodes or edges. 213 | 214 | An example of a use of this is https://github.com/INCATools/obographviz 215 | 216 | 217 | |key|value| 218 | | :---: | :---: | 219 | |name|KGViz| 220 | |title|Knowledge Graph Visualization Configuration| 221 | |homepage|[https://berkeleybop.github.io/kgviz-model/](https://berkeleybop.github.io/kgviz-model/)| 222 | |github_repo|berkeleybop/kgviz-model| 223 | |schema_relative_path|src/kgviz_model/linkml/kgviz.yaml| 224 | |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| 225 | |topics|visualization| 226 | |class_count|16| 227 | |slot_count|31| 228 | |enum_count|3| 229 | |type_count|21| 230 | |github_stars|4| 231 | |proportion_elements_with_a_description|0.57| 232 | |proportion_elements_mapped|0.32| 233 | 234 | ## Semantic SQL 235 | 236 | A datamodel for RDF, OWL, and OBO Ontologies designed to work harmoniously with SQL databases. 237 | 238 | Note that the primary purpose of this linkml schema is to organize and define SQL VIEWs to 239 | be used on top of a generic SQL database following the rdftab statements schema. 240 | These SQL views are encoded with the `sqlviews>>` tag inside the yaml. 241 | 242 | We use linkml to do this rather than a simple SQL DDL file because linkml gives 243 | us a standard way to do things such as: 244 | 245 | * attach descriptions to each view 246 | * define a data dictionary of all columns used, together with domains/ranges 247 | * modular structure with imports 248 | * the ability to attach rich semantic metadata to each schema element 249 | 250 | Additionally, the framework provides automatic compilation to SQLAlchemy models, 251 | and tools for being able to turn views into indexed tables for efficient querying, 252 | as well as a rich searchable documentation system and other tooling. 253 | 254 | This schema is best browsed online: https://cmungall.github.io/semantic-sql/ 255 | 256 | Note that things are in flux, and there some oddities that need ironed out, see 257 | issues for details. 258 | 259 | See the [github repo](https://github.com/cmungall/semantic-sql) for code to convert 260 | from the linkml yaml into SQL DDL 261 | 262 | 263 | |key|value| 264 | | :---: | :---: | 265 | |name|Semantic SQL| 266 | |title|Semantic SQL| 267 | |homepage|[https://cmungall.github.io/semantic-sql/](https://cmungall.github.io/semantic-sql/)| 268 | |github_repo|cmungall/semantic-sql| 269 | |schema_relative_path|src/semsql/linkml/semsql.yaml| 270 | |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| 271 | |topics|ontologies| 272 | |class_count|103| 273 | |slot_count|34| 274 | |enum_count|0| 275 | |type_count|21| 276 | |github_stars|32| 277 | |proportion_elements_with_a_description|0.54| 278 | |proportion_elements_mapped|0.27| 279 | 280 | ## Chemical Entities Mixtures and Reactions Ontological Framework 281 | 282 | A data model for managing information about chemical entities, ranging from atoms 283 | through molecules to complex mixtures. 284 | 285 | Aspects of this have been cribbed from various sources including CHEBI, SIO, 286 | Wikipedia/Wikidata, the NCATS Translator Chemical Working Group, but all mistakes 287 | are my own. 288 | 289 | For full context/motivation see the [GitHub repo](https://github.com/chemkg/chemrof). 290 | 291 | 292 | |key|value| 293 | | :---: | :---: | 294 | |name|Chemical Entities and Mixtures Model| 295 | |title|Chemical Entities Mixtures and Reactions Ontological Framework| 296 | |homepage|[https://chemkg.github.io/chemrof/](https://chemkg.github.io/chemrof/)| 297 | |github_repo|chemkg/chemrof| 298 | |schema_relative_path|src/schema/chemrof.yaml| 299 | |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| 300 | |topics|chemistry| 301 | |class_count|126| 302 | |slot_count|217| 303 | |enum_count|9| 304 | |type_count|27| 305 | |github_stars|11| 306 | |proportion_elements_with_a_description|0.54| 307 | |proportion_elements_mapped|0.19| 308 | 309 | ## CRDC-H Model 310 | 311 | None 312 | 313 | 314 | |key|value| 315 | | :---: | :---: | 316 | |name|CRDC-H-Model| 317 | |title|CRDC-H Model| 318 | |homepage|[https://cancerdhc.github.io/ccdhmodel](https://cancerdhc.github.io/ccdhmodel)| 319 | |github_repo|cancerdhc/ccdhmodel| 320 | |schema_relative_path|model/schema/crdch_model.yaml| 321 | |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| 322 | |topics|cancer| 323 | |class_count|41| 324 | |slot_count|0| 325 | |enum_count|106| 326 | |type_count|26| 327 | |github_stars|16| 328 | |proportion_elements_with_a_description|0.98| 329 | |proportion_elements_mapped|0.15| 330 | 331 | ## common association file formats 332 | 333 | None 334 | 335 | 336 | |key|value| 337 | | :---: | :---: | 338 | |name|Ontology-Associations| 339 | |title|common association file formats| 340 | |homepage|[https://biodatamodels.github.io/ontology-associations/](https://biodatamodels.github.io/ontology-associations/)| 341 | |github_repo|biodatamodels/ontology-associations| 342 | |license|CC-0| 343 | |topics|genomics| 344 | |github_stars|4| 345 | 346 | ## Genome Feature Format LinkML rendering 347 | 348 | Playing around with GFF spec 349 | 350 | 351 | |key|value| 352 | | :---: | :---: | 353 | |name|GFF3| 354 | |title|Genome Feature Format LinkML rendering| 355 | |homepage|[https://biodatamodels.github.io/gff-schema/](https://biodatamodels.github.io/gff-schema/)| 356 | |github_repo|biodatamodels/gff-schema| 357 | |schema_relative_path|src/schema/gff.yaml| 358 | |license|CC-0| 359 | |topics|genomics| 360 | |class_count|8| 361 | |slot_count|26| 362 | |enum_count|3| 363 | |type_count|21| 364 | |github_stars|5| 365 | |proportion_elements_with_a_description|0.67| 366 | |proportion_elements_mapped|0.43| 367 | 368 | ## Chromosome ontology and ETL 369 | 370 | None 371 | 372 | 373 | |key|value| 374 | | :---: | :---: | 375 | |name|Monochrom| 376 | |title|Chromosome ontology and ETL| 377 | |homepage|[https://monarch-initiative.github.io/monochrom/](https://monarch-initiative.github.io/monochrom/)| 378 | |schema_url|[https://github.com/monarch-initiative/monochrom/blob/master/model/schema/chromo.yaml](https://github.com/monarch-initiative/monochrom/blob/master/model/schema/chromo.yaml)| 379 | |github_repo|monarch-initiative/monochrom| 380 | |license|CC-0| 381 | |topics|genomics| 382 | |github_stars|12| 383 | 384 | ## 385 | 386 | None 387 | 388 | 389 | |key|value| 390 | | :---: | :---: | 391 | |name|GSC MIxS| 392 | |topics|genomics| 393 | 394 | ## A schema for describing translations and language profiles for ontologies 395 | 396 | None 397 | 398 | 399 | |key|value| 400 | | :---: | :---: | 401 | |name|Babelon| 402 | |title|A schema for describing translations and language profiles for ontologies| 403 | |homepage|[https://matentzn.github.io/babelon/](https://matentzn.github.io/babelon/)| 404 | |github_repo|matentzn/babelon| 405 | |license|CC-0| 406 | |topics|ontologies| 407 | |github_stars|7| 408 | 409 | ## HOT-TermCI 410 | 411 | Terminology Core Common Model 412 | 413 | 414 | |key|value| 415 | | :---: | :---: | 416 | |name|HOT-TermCI| 417 | |title|HOT-TermCI| 418 | |homepage|[https://github.com/HOT-Ecosystem/TermCI-model](https://github.com/HOT-Ecosystem/TermCI-model)| 419 | |github_repo|HOT-Ecosystem/TermCI-model| 420 | |schema_relative_path|src/schema/tccm_schema.yaml| 421 | |topics|clinical| 422 | |class_count|4| 423 | |slot_count|15| 424 | |enum_count|0| 425 | |type_count|19| 426 | |github_stars|3| 427 | |proportion_elements_with_a_description|1.0| 428 | |proportion_elements_mapped|0.86| 429 | 430 | ## Alliance of Genome Resources Persistent Schema 431 | 432 | Alliance Persistent Schema 433 | 434 | 435 | |key|value| 436 | | :---: | :---: | 437 | |name|Alliance of Genome Resource Persistent Schema| 438 | |title|Alliance of Genome Resources Persistent Schema| 439 | |github_repo|alliance-genome/agr_curation_schema| 440 | |schema_relative_path|model/schema/allianceModel.yaml| 441 | |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| 442 | |topics|genomics| 443 | |class_count|285| 444 | |slot_count|600| 445 | |enum_count|21| 446 | |type_count|20| 447 | |github_stars|6| 448 | |proportion_elements_with_a_description|0.71| 449 | |proportion_elements_mapped|0.04| 450 | 451 | ## 452 | 453 | None 454 | 455 | 456 | |key|value| 457 | | :---: | :---: | 458 | |name|SESAR| 459 | |topics|earth science| 460 | 461 | ## 462 | 463 | None 464 | 465 | 466 | |key|value| 467 | | :---: | :---: | 468 | |name|OBOGraphs| 469 | |github_repo|biodatamodels/obograph| 470 | |topics|ontologies| 471 | |github_stars|4| 472 | 473 | ## Metadata schema for the German Human Genome-Phenome Archive (GHGA) 474 | 475 | The submission centric metadata schema for the German Human Genome-Phenome Archive (GHGA). 476 | 477 | 478 | |key|value| 479 | | :---: | :---: | 480 | |name|GHGA Metadata| 481 | |title|Metadata schema for the German Human Genome-Phenome Archive (GHGA)| 482 | |homepage|[https://ghga-de.github.io/ghga-metadata-schema/](https://ghga-de.github.io/ghga-metadata-schema/)| 483 | |github_repo|ghga-de/ghga-metadata-schema| 484 | |schema_relative_path|src/schema/submission.yaml| 485 | |class_count|26| 486 | |slot_count|112| 487 | |enum_count|30| 488 | |type_count|19| 489 | |github_stars|13| 490 | |proportion_elements_with_a_description|0.98| 491 | |proportion_elements_mapped|0.18| 492 | 493 | ## Minimal Information About a new Cell Type 494 | 495 | 496 | This schema is CJM's attempt to translate Tiago's [minimal info doc](https://docs.google.com/document/d/1EVgs2Z5dpJs7cbuSBwWlg1xOWQEqMtbSKRGgdneXnU8/edit#) into a LinkML schema 497 | 498 | The schema is fairly minimal and is in the form of a "checklist" style schema. It is a set of fields mostly associated with this class: 499 | 500 | * [CellType](CellType.md) 501 | 502 | There are a set of examples here: 503 | 504 | * [tests/input](https://github.com/cmungall/mianct-schema/tree/main/tests/input) 505 | 506 | Currently the examples are YAML, but the YAML is deliberately flat as this is a "checklist" schema, and we could have TSV/CSV/xlsx here 507 | 508 | TODO: 509 | 510 | - include "packages" and "checklists"; e.g. 511 | - a neuron package would have the enum for morphologies constrained 512 | - a transcriptomics package would make it required to enter the set of marker genes 513 | - see [MIxS schema](https://cmungall.github.io/mixs-source/) for example of how this might work 514 | - document how this relates to dosdp/robot templates 515 | 516 | When should one provide an entry for a cell type in a MIANCT sheet? 517 | 518 | - When there is a claim of a new cell class (type or state) that has not been described before 519 | - When new information is discovered for a previously cataloged type that might influence its cataloguing (i.e. description of the presence in a different species or in a new location) 520 | - When a cell type mentioned in the article has been described before, but is not yet catalogued on an authoritative source like the Cell Ontology. 521 | 522 | 523 | |key|value| 524 | | :---: | :---: | 525 | |name|MIANCT| 526 | |title|Minimal Information About a new Cell Type| 527 | |homepage|[https://cmungall.github.io/mianct-schema/](https://cmungall.github.io/mianct-schema/)| 528 | |github_repo|cmungall/mianct-schema| 529 | |schema_relative_path|model/schema/mianct.yaml| 530 | |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| 531 | |topics|samples; cell types| 532 | |class_count|2| 533 | |slot_count|11| 534 | |enum_count|3| 535 | |type_count|20| 536 | |github_stars|4| 537 | |proportion_elements_with_a_description|0.69| 538 | |proportion_elements_mapped|0.75| 539 | 540 | ## iSamples 541 | 542 | None 543 | 544 | 545 | |key|value| 546 | | :---: | :---: | 547 | |name|iSamples| 548 | |title|iSamples| 549 | |homepage|[https://github.com/isamplesorg/metadata](https://github.com/isamplesorg/metadata)| 550 | |github_repo|isamplesorg/metadata| 551 | |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| 552 | |topics|samples; metadata; earth science| 553 | |github_stars|6| 554 | 555 | ## SPARQLFun 556 | 557 | SPARQL Templates 558 | 559 | 560 | |key|value| 561 | | :---: | :---: | 562 | |name|sparqlfun| 563 | |title|SPARQLFun| 564 | |homepage|[https://github.com/linkml/sparqlfun](https://github.com/linkml/sparqlfun)| 565 | |github_repo|linkml/sparqlfun| 566 | |schema_relative_path|sparqlfun/schema/sparqlfun.yaml| 567 | |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| 568 | |topics|sparql; templates| 569 | |class_count|92| 570 | |slot_count|61| 571 | |enum_count|2| 572 | |type_count|21| 573 | |github_stars|8| 574 | |proportion_elements_with_a_description|0.33| 575 | |proportion_elements_mapped|0.34| 576 | 577 | ## LinkML-Phenopackets 578 | 579 | Automatic translation of phenopackets protobuf to LinkML. Status: EXPERIMENTAL. 580 | 581 | 582 | |key|value| 583 | | :---: | :---: | 584 | |name|LinkML-Phenopackets| 585 | |title|LinkML-Phenopackets| 586 | |homepage|[https://phenopackets-schema.readthedocs.io/en/latest/](https://phenopackets-schema.readthedocs.io/en/latest/)| 587 | |github_repo|cmungall/linkml-phenopackets| 588 | |schema_relative_path|src/phenopackets/schema/phenopackets.yaml| 589 | |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| 590 | |topics|clinical| 591 | |class_count|73| 592 | |slot_count|0| 593 | |enum_count|30| 594 | |type_count|19| 595 | |github_stars|7| 596 | |proportion_elements_with_a_description|0.49| 597 | |proportion_elements_mapped|0.23| 598 | 599 | ## The INvestigation of Co-occurring conditions across the Lifespan to Understand Down syndromE (INCLUDE) data model 600 | 601 | None 602 | 603 | 604 | |key|value| 605 | | :---: | :---: | 606 | |name|INCLUDE| 607 | |title|The INvestigation of Co-occurring conditions across the Lifespan to Understand Down syndromE (INCLUDE) data model| 608 | |homepage|[https://github.com/include-dcc/include-linkml](https://github.com/include-dcc/include-linkml)| 609 | |github_repo|include-dcc/include-linkml| 610 | |license|CC-0| 611 | |topics|Ontologies; Down syndrome; Clinical research| 612 | |github_stars|1| 613 | 614 | -------------------------------------------------------------------------------- /src/linkml_registry/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkml/linkml-registry/4323b284f454ed4d32f435870b4f2b4e68795e20/src/linkml_registry/__init__.py -------------------------------------------------------------------------------- /src/linkml_registry/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkml/linkml-registry/4323b284f454ed4d32f435870b4f2b4e68795e20/src/linkml_registry/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /src/linkml_registry/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkml/linkml-registry/4323b284f454ed4d32f435870b4f2b4e68795e20/src/linkml_registry/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /src/linkml_registry/__pycache__/cli.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkml/linkml-registry/4323b284f454ed4d32f435870b4f2b4e68795e20/src/linkml_registry/__pycache__/cli.cpython-310.pyc -------------------------------------------------------------------------------- /src/linkml_registry/__pycache__/evaluate.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkml/linkml-registry/4323b284f454ed4d32f435870b4f2b4e68795e20/src/linkml_registry/__pycache__/evaluate.cpython-310.pyc -------------------------------------------------------------------------------- /src/linkml_registry/__pycache__/evaluate.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkml/linkml-registry/4323b284f454ed4d32f435870b4f2b4e68795e20/src/linkml_registry/__pycache__/evaluate.cpython-39.pyc -------------------------------------------------------------------------------- /src/linkml_registry/__pycache__/github_utils.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkml/linkml-registry/4323b284f454ed4d32f435870b4f2b4e68795e20/src/linkml_registry/__pycache__/github_utils.cpython-310.pyc -------------------------------------------------------------------------------- /src/linkml_registry/__pycache__/github_utils.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkml/linkml-registry/4323b284f454ed4d32f435870b4f2b4e68795e20/src/linkml_registry/__pycache__/github_utils.cpython-39.pyc -------------------------------------------------------------------------------- /src/linkml_registry/__pycache__/markdown_dumper.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkml/linkml-registry/4323b284f454ed4d32f435870b4f2b4e68795e20/src/linkml_registry/__pycache__/markdown_dumper.cpython-310.pyc -------------------------------------------------------------------------------- /src/linkml_registry/__pycache__/markdown_dumper.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkml/linkml-registry/4323b284f454ed4d32f435870b4f2b4e68795e20/src/linkml_registry/__pycache__/markdown_dumper.cpython-39.pyc -------------------------------------------------------------------------------- /src/linkml_registry/__pycache__/registry.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkml/linkml-registry/4323b284f454ed4d32f435870b4f2b4e68795e20/src/linkml_registry/__pycache__/registry.cpython-310.pyc -------------------------------------------------------------------------------- /src/linkml_registry/__pycache__/registry.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkml/linkml-registry/4323b284f454ed4d32f435870b4f2b4e68795e20/src/linkml_registry/__pycache__/registry.cpython-39.pyc -------------------------------------------------------------------------------- /src/linkml_registry/__pycache__/utils.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkml/linkml-registry/4323b284f454ed4d32f435870b4f2b4e68795e20/src/linkml_registry/__pycache__/utils.cpython-310.pyc -------------------------------------------------------------------------------- /src/linkml_registry/__pycache__/utils.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkml/linkml-registry/4323b284f454ed4d32f435870b4f2b4e68795e20/src/linkml_registry/__pycache__/utils.cpython-39.pyc -------------------------------------------------------------------------------- /src/linkml_registry/cli.py: -------------------------------------------------------------------------------- 1 | import click 2 | import logging 3 | from linkml_registry.registry import SchemaMetadata, SchemaRegistry 4 | from linkml_registry.evaluate import evaluate 5 | from linkml_registry.markdown_dumper import MarkdownTableDumper, MarkdownPageDumper 6 | from linkml_runtime.dumpers import json_dumper, yaml_dumper 7 | from linkml_runtime.loaders import yaml_loader 8 | 9 | 10 | # Click input options common across commands 11 | input_option = click.option('-i', '--input', required=True, type=click.Path(), 12 | help='Input file, e.g. a SSSOM tsv file.') 13 | output_directory_option = click.option('-d', '--output-directory', type=click.Path(), help='Output directory path.') 14 | output_option = click.option('-o', '--output', help='Output file, e.g. a YAML file.') 15 | 16 | @click.group() 17 | @click.option('-v', '--verbose', count=True) 18 | @click.option('-q', '--quiet') 19 | def main(verbose: int, quiet: bool): 20 | """Main 21 | 22 | Args: 23 | 24 | verbose (int): Verbose. 25 | quiet (bool): Quiet. 26 | 27 | Returns: 28 | 29 | None. 30 | 31 | """ 32 | if verbose >= 2: 33 | logging.basicConfig(level=logging.DEBUG) 34 | elif verbose == 1: 35 | logging.basicConfig(level=logging.INFO) 36 | else: 37 | logging.basicConfig(level=logging.WARNING) 38 | if quiet: 39 | logging.basicConfig(level=logging.ERROR) 40 | 41 | 42 | @main.command() 43 | @input_option 44 | @output_option 45 | @click.option('--use-github-api/--no-use-github-api', default=False, help='Use the github API to enhance results') 46 | @click.option('-m', '--markdown-output', 47 | default=None, 48 | help='path to markdown output') 49 | @click.option('-I', '--inclusion-list', 50 | multiple=True, 51 | help='Only include these names') 52 | @click.option('-w', '--workdir', 53 | default='tmp', 54 | help='working dir for checked out repos') 55 | def eval(input: str, output: str, inclusion_list = None, markdown_output: str = None, workdir: str = 'tmp', use_github_api: bool = False): 56 | """Evaluate 57 | 58 | Example: 59 | TODO 60 | 61 | Args: 62 | 63 | input (str): The path to the input models yaml file 64 | output (str): The path to the output file. 65 | 66 | Returns: 67 | 68 | None. 69 | 70 | """ 71 | registry = yaml_loader.load(input, SchemaRegistry) 72 | print(f'INCLUDES={list(inclusion_list)}') 73 | evaluate(registry, use_github_api=use_github_api, workdir=workdir, include=list(inclusion_list)) 74 | if markdown_output: 75 | d = MarkdownPageDumper() 76 | d.dump(registry, to_file=markdown_output) 77 | if output: 78 | with open(output, "w") as stream: 79 | stream.write(yaml_dumper.dumps(registry)) 80 | 81 | 82 | if __name__ == "__main__": 83 | main() -------------------------------------------------------------------------------- /src/linkml_registry/data/models.yaml: -------------------------------------------------------------------------------- 1 | name: LinkML-Main-Registry 2 | homepage: https://github.com/linkml/linkml-registry 3 | title: |- 4 | This is the main LinkML registry 5 | entries: 6 | LinkML Model: 7 | homepage: https://linkml.github.io/linkml-model/docs/ 8 | schema_url: https://github.com/linkml/linkml-model/blob/main/model/schema/meta.yaml 9 | github_repo: linkml/linkml-model 10 | schema_relative_path: linkml_model/model/schema/meta.yaml 11 | license: CC-0 12 | title: LinkML metamodel 13 | topics: 14 | - meta 15 | LinkML Template Configuration Model: 16 | homepage: https://linkml.github.io/template-config-model/ 17 | schema_url: https://github.com/linkml/template-config-model/blob/main/model/schema/config_model.yaml 18 | github_repo: linkml/template-config-model 19 | license: CC-0 20 | title: LinkML template configuration 21 | topics: 22 | - meta 23 | NMDC: 24 | homepage: https://microbiomedata.github.io/nmdc-schema/ 25 | github_repo: microbiomedata/nmdc-schema 26 | schema_relative_path: src/schema/nmdc.yaml 27 | license: CC-0 28 | title: National Microbiome Data Collaborative 29 | topics: 30 | - environmental microbiology 31 | Biolink-Model: 32 | homepage: https://biolink.github.io/biolink-model/ 33 | github_repo: biolink/biolink-model 34 | schema_relative_path: biolink-model.yaml 35 | license: CC-0 36 | title: Biolink Model 37 | topics: 38 | - genomics 39 | - disease 40 | - phenotype 41 | - expression 42 | - GO 43 | - GO-CAM 44 | - human biology 45 | - model organism biology 46 | - biochemistry 47 | - biology 48 | SSSOM: 49 | homepage: https://mapping-commons.github.io/sssom/ 50 | github_repo: mapping-commons/SSSOM 51 | schema_relative_path: src/sssom_schema/schema/sssom_schema.yaml 52 | license: CC-0 53 | title: Simple Standard Sharing Object Mappings 54 | topics: 55 | - information 56 | - mappings 57 | KGCL: 58 | homepage: https://incatools.github.io/kgcl/ 59 | schema_url: '' 60 | github_repo: INCATools/kgcl 61 | schema_relative_path: src/schema/kgcl.yaml 62 | license: CC-0 63 | title: Knowledge Graph Change Language 64 | topics: 65 | - knowledge graphs 66 | COMET: 67 | homepage: https://linkml.io/linkml-common/ 68 | github_repo: linkml/linkml-common 69 | schema_relative_path: src/linkml_common/schema/linkml_common.yaml 70 | license: CC-0 71 | title: LinkML Common Modeling Elements and Types (COMET) 72 | topics: 73 | - common data model 74 | CMDR: 75 | homepage: https://linkml.io/cmdr/ 76 | github_repo: linkml/cmdr 77 | schema_relative_path: src/cmdr/schema/cmdr.yaml 78 | license: CC-0 79 | title: Core Model for Data Research 80 | topics: 81 | - common data model 82 | KGViz: 83 | homepage: https://berkeleybop.github.io/kgviz-model/ 84 | schema_url: '' 85 | github_repo: berkeleybop/kgviz-model 86 | schema_relative_path: src/kgviz_model/linkml/kgviz.yaml 87 | license: CC-0 88 | title: Knowledge Graph Visualization Configuration 89 | topics: 90 | - visualization 91 | Semantic SQL: 92 | homepage: https://incatools.github.io/semantic-sql/ 93 | github_repo: INCATools/semantic-sql 94 | schema_relative_path: src/semsql/linkml/semsql.yaml 95 | license: CC-0 96 | title: Semantic SQL 97 | topics: 98 | - ontologies 99 | Chemical Entities and Mixtures Model: 100 | homepage: https://chemkg.github.io/chemrof/ 101 | license: CC-0 102 | github_repo: chemkg/chemrof 103 | schema_relative_path: src/schema/chemrof.yaml 104 | title: Chemistry Schema 105 | topics: 106 | - chemistry 107 | 108 | CRDC-H-Model: 109 | homepage: https://cancerdhc.github.io/ccdhmodel 110 | schema_url: '' 111 | license: CC-0 112 | github_repo: cancerdhc/ccdhmodel 113 | schema_relative_path: model/schema/crdch_model.yaml 114 | title: CRDC-H Model 115 | topics: 116 | - cancer 117 | Ontology-Associations: 118 | homepage: https://biodatamodels.github.io/ontology-associations/ 119 | schema_url: '' 120 | github_repo: biodatamodels/ontology-associations 121 | # schema_relative_path: src/schema/all.yaml 122 | license: CC-0 123 | title: common association file formats 124 | topics: 125 | - genomics 126 | GFF3: 127 | homepage: https://biodatamodels.github.io/gff-schema/ 128 | schema_url: '' 129 | github_repo: biodatamodels/gff-schema 130 | schema_relative_path: src/schema/gff.yaml 131 | license: CC-0 132 | title: Genome Feature Format LinkML rendering 133 | topics: 134 | - genomics 135 | Monochrom: 136 | homepage: https://monarch-initiative.github.io/monochrom/ 137 | schema_url: https://github.com/monarch-initiative/monochrom/blob/master/model/schema/chromo.yaml 138 | github_repo: monarch-initiative/monochrom 139 | license: CC-0 140 | title: Chromosome ontology and ETL 141 | topics: 142 | - genomics 143 | GSC MIxS: 144 | homepage: '' 145 | schema_url: '' 146 | license: '' 147 | title: '' 148 | topics: 149 | - genomics 150 | Babelon: 151 | homepage: https://matentzn.github.io/babelon/ 152 | schema_url: '' 153 | github_repo: matentzn/babelon 154 | license: CC-0 155 | title: A schema for describing translations and language profiles for ontologies 156 | topics: 157 | - ontologies 158 | HOT-TermCI: 159 | homepage: https://github.com/HOT-Ecosystem/TermCI-model 160 | github_repo: HOT-Ecosystem/TermCI-model 161 | schema_url: '' 162 | schema_relative_path: src/schema/tccm_schema.yaml 163 | license: '' 164 | title: '' 165 | topics: 166 | - clinical 167 | Alliance of Genome Resource Persistent Schema: 168 | title: Alliance of Genome Resources Persistent Schema 169 | description: Alliance Persistent Schema 170 | homepage: '' 171 | schema_url: '' 172 | github_repo: alliance-genome/agr_curation_schema 173 | schema_relative_path: model/schema/allianceModel.yaml 174 | license: https://creativecommons.org/publicdomain/zero/1.0/ 175 | topics: 176 | - genomics 177 | SESAR: 178 | homepage: '' 179 | schema_url: '' 180 | license: '' 181 | title: '' 182 | topics: 183 | - earth science 184 | OBOGraphs: 185 | homepage: '' 186 | schema_url: '' 187 | github_repo: biodatamodels/obograph 188 | license: '' 189 | title: '' 190 | topics: 191 | - ontologies 192 | GHGA Metadata: 193 | homepage: https://ghga-de.github.io/ghga-metadata-schema/ 194 | title: Metadata schema for the German Human Genome-Phenome Archive (GHGA) 195 | github_repo: ghga-de/ghga-metadata-schema 196 | schema_relative_path: src/schema/submission.yaml 197 | MIANCT: 198 | title: Minimal information about a New Cell Type 199 | homepage: https://cmungall.github.io/mianct-schema/ 200 | github_repo: cmungall/mianct-schema 201 | schema_relative_path: model/schema/mianct.yaml 202 | topics: 203 | - samples 204 | - cell types 205 | iSamples: 206 | title: iSamples 207 | homepage: https://github.com/isamplesorg/metadata 208 | github_repo: isamplesorg/metadata 209 | #schema_relative_path: src/schemas/isamples_core.yaml 210 | license: https://creativecommons.org/publicdomain/zero/1.0/ 211 | topics: 212 | - samples 213 | - metadata 214 | - earth science 215 | sparqlfun: 216 | homepage: https://github.com/linkml/sparqlfun 217 | github_repo: linkml/sparqlfun 218 | schema_relative_path: sparqlfun/schema/sparqlfun.yaml 219 | license: https://creativecommons.org/publicdomain/zero/1.0/ 220 | topics: 221 | - sparql 222 | - templates 223 | 224 | LinkML-Phenopackets: 225 | homepage: https://phenopacket-schema.readthedocs.io/en/latest/ 226 | github_repo: cmungall/linkml-phenopackets 227 | schema_relative_path: src/phenopackets/schema/phenopackets.yaml 228 | license: https://creativecommons.org/publicdomain/zero/1.0/ 229 | topics: 230 | - clinical 231 | 232 | INCLUDE: 233 | homepage: https://github.com/include-dcc/include-linkml 234 | schema_url: '' 235 | github_repo: include-dcc/include-linkml 236 | license: CC-0 237 | title: The INvestigation of Co-occurring conditions across the Lifespan to Understand Down syndromE (INCLUDE) data model 238 | topics: 239 | - Ontologies 240 | - Down syndrome 241 | - Clinical research 242 | 243 | -------------------------------------------------------------------------------- /src/linkml_registry/datamodel/registry.py: -------------------------------------------------------------------------------- 1 | # Auto generated from registry.yaml by pythongen.py version: 0.0.1 2 | # Generation date: 2024-02-08T18:09:30 3 | # Schema: linkml_registry 4 | # 5 | # id: https://w3id.org/linkml_registry 6 | # description: Datamodel for LinkML Registry and evaluation framework 7 | # license: https://creativecommons.org/publicdomain/zero/1.0/ 8 | 9 | import dataclasses 10 | import re 11 | from jsonasobj2 import JsonObj, as_dict 12 | from typing import Optional, List, Union, Dict, ClassVar, Any 13 | from dataclasses import dataclass 14 | from linkml_runtime.linkml_model.meta import EnumDefinition, PermissibleValue, PvFormulaOptions 15 | 16 | from linkml_runtime.utils.slot import Slot 17 | from linkml_runtime.utils.metamodelcore import empty_list, empty_dict, bnode 18 | from linkml_runtime.utils.yamlutils import YAMLRoot, extended_str, extended_float, extended_int 19 | from linkml_runtime.utils.dataclass_extensions_376 import dataclasses_init_fn_with_kwargs 20 | from linkml_runtime.utils.formatutils import camelcase, underscore, sfx 21 | from linkml_runtime.utils.enumerations import EnumDefinitionImpl 22 | from rdflib import Namespace, URIRef 23 | from linkml_runtime.utils.curienamespace import CurieNamespace 24 | from linkml_runtime.linkml_model.types import Float, Integer, String, Uriorcurie 25 | from linkml_runtime.utils.metamodelcore import URIorCURIE 26 | 27 | metamodel_version = "1.7.0" 28 | version = None 29 | 30 | # Overwrite dataclasses _init_fn to add **kwargs in __init__ 31 | dataclasses._init_fn = dataclasses_init_fn_with_kwargs 32 | 33 | # Namespaces 34 | OIO = CurieNamespace('OIO', 'http://www.geneontology.org/formats/oboInOwl#') 35 | BIBO = CurieNamespace('bibo', 'http://purl.org/ontology/bibo/') 36 | DCAT = CurieNamespace('dcat', 'http://www.w3.org/ns/dcat#') 37 | DCTERMS = CurieNamespace('dcterms', 'http://example.org/UNKNOWN/dcterms/') 38 | DOAP = CurieNamespace('doap', 'http://usefulinc.com/ns/doap#') 39 | FOAF = CurieNamespace('foaf', 'http://xmlns.com/foaf/0.1/') 40 | LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/') 41 | LINKML_REGISTRY = CurieNamespace('linkml_registry', 'https://w3id.org/linkml_registry') 42 | OSLC = CurieNamespace('oslc', 'http://open-services.net/ns/core#') 43 | PAV = CurieNamespace('pav', 'http://purl.org/pav/') 44 | RDFS = CurieNamespace('rdfs', 'http://example.org/UNKNOWN/rdfs/') 45 | SCHEMA = CurieNamespace('schema', 'http://schema.org/') 46 | SKOS = CurieNamespace('skos', 'http://www.w3.org/2004/02/skos/core#') 47 | XSD = CurieNamespace('xsd', 'http://www.w3.org/2001/XMLSchema#') 48 | DEFAULT_ = LINKML_REGISTRY 49 | 50 | 51 | # Types 52 | class HttpsIdentifier(String): 53 | type_class_uri = XSD["string"] 54 | type_class_curie = "xsd:string" 55 | type_name = "https identifier" 56 | type_model_uri = LINKML_REGISTRY.HttpsIdentifier 57 | 58 | 59 | # Class references 60 | class SchemaRegistryName(extended_str): 61 | pass 62 | 63 | 64 | class SchemaMetadataName(extended_str): 65 | pass 66 | 67 | 68 | @dataclass 69 | class SchemaRegistry(YAMLRoot): 70 | _inherited_slots: ClassVar[List[str]] = [] 71 | 72 | class_class_uri: ClassVar[URIRef] = LINKML_REGISTRY["SchemaRegistry"] 73 | class_class_curie: ClassVar[str] = "linkml_registry:SchemaRegistry" 74 | class_name: ClassVar[str] = "schema registry" 75 | class_model_uri: ClassVar[URIRef] = LINKML_REGISTRY.SchemaRegistry 76 | 77 | name: Union[str, SchemaRegistryName] = None 78 | homepage: Optional[Union[str, HttpsIdentifier]] = None 79 | entries: Optional[Union[Dict[Union[str, SchemaMetadataName], Union[dict, "SchemaMetadata"]], List[Union[dict, "SchemaMetadata"]]]] = empty_dict() 80 | license: Optional[str] = None 81 | title: Optional[str] = None 82 | description: Optional[str] = None 83 | domain: Optional[Union[str, List[str]]] = empty_list() 84 | topics: Optional[Union[str, List[str]]] = empty_list() 85 | 86 | def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): 87 | if self._is_empty(self.name): 88 | self.MissingRequiredField("name") 89 | if not isinstance(self.name, SchemaRegistryName): 90 | self.name = SchemaRegistryName(self.name) 91 | 92 | if self.homepage is not None and not isinstance(self.homepage, HttpsIdentifier): 93 | self.homepage = HttpsIdentifier(self.homepage) 94 | 95 | self._normalize_inlined_as_dict(slot_name="entries", slot_type=SchemaMetadata, key_name="name", keyed=True) 96 | 97 | if self.license is not None and not isinstance(self.license, str): 98 | self.license = str(self.license) 99 | 100 | if self.title is not None and not isinstance(self.title, str): 101 | self.title = str(self.title) 102 | 103 | if self.description is not None and not isinstance(self.description, str): 104 | self.description = str(self.description) 105 | 106 | if not isinstance(self.domain, list): 107 | self.domain = [self.domain] if self.domain is not None else [] 108 | self.domain = [v if isinstance(v, str) else str(v) for v in self.domain] 109 | 110 | if not isinstance(self.topics, list): 111 | self.topics = [self.topics] if self.topics is not None else [] 112 | self.topics = [v if isinstance(v, str) else str(v) for v in self.topics] 113 | 114 | super().__post_init__(**kwargs) 115 | 116 | 117 | @dataclass 118 | class SchemaMetadata(YAMLRoot): 119 | _inherited_slots: ClassVar[List[str]] = [] 120 | 121 | class_class_uri: ClassVar[URIRef] = LINKML_REGISTRY["SchemaMetadata"] 122 | class_class_curie: ClassVar[str] = "linkml_registry:SchemaMetadata" 123 | class_name: ClassVar[str] = "schema metadata" 124 | class_model_uri: ClassVar[URIRef] = LINKML_REGISTRY.SchemaMetadata 125 | 126 | name: Union[str, SchemaMetadataName] = None 127 | title: Optional[str] = None 128 | description: Optional[str] = None 129 | homepage: Optional[Union[str, HttpsIdentifier]] = None 130 | schema_url: Optional[Union[str, HttpsIdentifier]] = None 131 | github_repo: Optional[str] = None 132 | schema_relative_path: Optional[str] = None 133 | license: Optional[str] = None 134 | domain: Optional[Union[str, List[str]]] = empty_list() 135 | topics: Optional[Union[str, List[str]]] = empty_list() 136 | score: Optional[str] = None 137 | class_count: Optional[int] = None 138 | slot_count: Optional[int] = None 139 | enum_count: Optional[int] = None 140 | type_count: Optional[int] = None 141 | github_stars: Optional[int] = None 142 | proportion_elements_with_a_description: Optional[float] = None 143 | proportion_elements_mapped: Optional[float] = None 144 | errors: Optional[Union[str, List[str]]] = empty_list() 145 | 146 | def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): 147 | if self._is_empty(self.name): 148 | self.MissingRequiredField("name") 149 | if not isinstance(self.name, SchemaMetadataName): 150 | self.name = SchemaMetadataName(self.name) 151 | 152 | if self.title is not None and not isinstance(self.title, str): 153 | self.title = str(self.title) 154 | 155 | if self.description is not None and not isinstance(self.description, str): 156 | self.description = str(self.description) 157 | 158 | if self.homepage is not None and not isinstance(self.homepage, HttpsIdentifier): 159 | self.homepage = HttpsIdentifier(self.homepage) 160 | 161 | if self.schema_url is not None and not isinstance(self.schema_url, HttpsIdentifier): 162 | self.schema_url = HttpsIdentifier(self.schema_url) 163 | 164 | if self.github_repo is not None and not isinstance(self.github_repo, str): 165 | self.github_repo = str(self.github_repo) 166 | 167 | if self.schema_relative_path is not None and not isinstance(self.schema_relative_path, str): 168 | self.schema_relative_path = str(self.schema_relative_path) 169 | 170 | if self.license is not None and not isinstance(self.license, str): 171 | self.license = str(self.license) 172 | 173 | if not isinstance(self.domain, list): 174 | self.domain = [self.domain] if self.domain is not None else [] 175 | self.domain = [v if isinstance(v, str) else str(v) for v in self.domain] 176 | 177 | if not isinstance(self.topics, list): 178 | self.topics = [self.topics] if self.topics is not None else [] 179 | self.topics = [v if isinstance(v, str) else str(v) for v in self.topics] 180 | 181 | if self.score is not None and not isinstance(self.score, str): 182 | self.score = str(self.score) 183 | 184 | if self.class_count is not None and not isinstance(self.class_count, int): 185 | self.class_count = int(self.class_count) 186 | 187 | if self.slot_count is not None and not isinstance(self.slot_count, int): 188 | self.slot_count = int(self.slot_count) 189 | 190 | if self.enum_count is not None and not isinstance(self.enum_count, int): 191 | self.enum_count = int(self.enum_count) 192 | 193 | if self.type_count is not None and not isinstance(self.type_count, int): 194 | self.type_count = int(self.type_count) 195 | 196 | if self.github_stars is not None and not isinstance(self.github_stars, int): 197 | self.github_stars = int(self.github_stars) 198 | 199 | if self.proportion_elements_with_a_description is not None and not isinstance(self.proportion_elements_with_a_description, float): 200 | self.proportion_elements_with_a_description = float(self.proportion_elements_with_a_description) 201 | 202 | if self.proportion_elements_mapped is not None and not isinstance(self.proportion_elements_mapped, float): 203 | self.proportion_elements_mapped = float(self.proportion_elements_mapped) 204 | 205 | if not isinstance(self.errors, list): 206 | self.errors = [self.errors] if self.errors is not None else [] 207 | self.errors = [v if isinstance(v, str) else str(v) for v in self.errors] 208 | 209 | super().__post_init__(**kwargs) 210 | 211 | 212 | @dataclass 213 | class Evaluation(YAMLRoot): 214 | _inherited_slots: ClassVar[List[str]] = [] 215 | 216 | class_class_uri: ClassVar[URIRef] = LINKML_REGISTRY["Evaluation"] 217 | class_class_curie: ClassVar[str] = "linkml_registry:Evaluation" 218 | class_name: ClassVar[str] = "evaluation" 219 | class_model_uri: ClassVar[URIRef] = LINKML_REGISTRY.Evaluation 220 | 221 | score: Optional[str] = None 222 | class_count: Optional[int] = None 223 | slot_count: Optional[int] = None 224 | enum_count: Optional[int] = None 225 | type_count: Optional[int] = None 226 | github_stars: Optional[int] = None 227 | proportion_elements_with_a_description: Optional[float] = None 228 | proportion_elements_mapped: Optional[float] = None 229 | errors: Optional[Union[str, List[str]]] = empty_list() 230 | 231 | def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): 232 | if self.score is not None and not isinstance(self.score, str): 233 | self.score = str(self.score) 234 | 235 | if self.class_count is not None and not isinstance(self.class_count, int): 236 | self.class_count = int(self.class_count) 237 | 238 | if self.slot_count is not None and not isinstance(self.slot_count, int): 239 | self.slot_count = int(self.slot_count) 240 | 241 | if self.enum_count is not None and not isinstance(self.enum_count, int): 242 | self.enum_count = int(self.enum_count) 243 | 244 | if self.type_count is not None and not isinstance(self.type_count, int): 245 | self.type_count = int(self.type_count) 246 | 247 | if self.github_stars is not None and not isinstance(self.github_stars, int): 248 | self.github_stars = int(self.github_stars) 249 | 250 | if self.proportion_elements_with_a_description is not None and not isinstance(self.proportion_elements_with_a_description, float): 251 | self.proportion_elements_with_a_description = float(self.proportion_elements_with_a_description) 252 | 253 | if self.proportion_elements_mapped is not None and not isinstance(self.proportion_elements_mapped, float): 254 | self.proportion_elements_mapped = float(self.proportion_elements_mapped) 255 | 256 | if not isinstance(self.errors, list): 257 | self.errors = [self.errors] if self.errors is not None else [] 258 | self.errors = [v if isinstance(v, str) else str(v) for v in self.errors] 259 | 260 | super().__post_init__(**kwargs) 261 | 262 | 263 | # Enumerations 264 | class LicenseEnum(EnumDefinitionImpl): 265 | 266 | _defn = EnumDefinition( 267 | name="LicenseEnum", 268 | ) 269 | 270 | @classmethod 271 | def _addvals(cls): 272 | setattr(cls, "CC-BY-v4", 273 | PermissibleValue( 274 | text="CC-BY-v4", 275 | description="CC-BY", 276 | meaning=None)) 277 | setattr(cls, "CC-0-v1", 278 | PermissibleValue( 279 | text="CC-0-v1", 280 | description="CC-0", 281 | meaning=None)) 282 | 283 | # Slots 284 | class slots: 285 | pass 286 | 287 | slots.name = Slot(uri=RDFS.label, name="name", curie=RDFS.curie('label'), 288 | model_uri=LINKML_REGISTRY.name, domain=None, range=URIRef) 289 | 290 | slots.base_purl = Slot(uri=LINKML_REGISTRY.base_purl, name="base purl", curie=LINKML_REGISTRY.curie('base_purl'), 291 | model_uri=LINKML_REGISTRY.base_purl, domain=None, range=Optional[Union[str, URIorCURIE]]) 292 | 293 | slots.schema_purl = Slot(uri=LINKML_REGISTRY.schema_purl, name="schema purl", curie=LINKML_REGISTRY.curie('schema_purl'), 294 | model_uri=LINKML_REGISTRY.schema_purl, domain=None, range=Optional[Union[str, URIorCURIE]]) 295 | 296 | slots.homepage = Slot(uri=FOAF.homepage, name="homepage", curie=FOAF.curie('homepage'), 297 | model_uri=LINKML_REGISTRY.homepage, domain=None, range=Optional[Union[str, HttpsIdentifier]]) 298 | 299 | slots.schema_url = Slot(uri=DCTERMS.source, name="schema url", curie=DCTERMS.curie('source'), 300 | model_uri=LINKML_REGISTRY.schema_url, domain=None, range=Optional[Union[str, HttpsIdentifier]]) 301 | 302 | slots.github_repo = Slot(uri=LINKML_REGISTRY.github_repo, name="github repo", curie=LINKML_REGISTRY.curie('github_repo'), 303 | model_uri=LINKML_REGISTRY.github_repo, domain=None, range=Optional[str]) 304 | 305 | slots.issue_tracker = Slot(uri=DOAP['bug-database'], name="issue tracker", curie=DOAP.curie('bug-database'), 306 | model_uri=LINKML_REGISTRY.issue_tracker, domain=None, range=Optional[str]) 307 | 308 | slots.license = Slot(uri=DCTERMS.license, name="license", curie=DCTERMS.curie('license'), 309 | model_uri=LINKML_REGISTRY.license, domain=None, range=Optional[str]) 310 | 311 | slots.title = Slot(uri=DCTERMS.title, name="title", curie=DCTERMS.curie('title'), 312 | model_uri=LINKML_REGISTRY.title, domain=None, range=Optional[str]) 313 | 314 | slots.description = Slot(uri=SKOS.definition, name="description", curie=SKOS.curie('definition'), 315 | model_uri=LINKML_REGISTRY.description, domain=None, range=Optional[str]) 316 | 317 | slots.domain = Slot(uri=DCTERMS.subject, name="domain", curie=DCTERMS.curie('subject'), 318 | model_uri=LINKML_REGISTRY.domain, domain=None, range=Optional[Union[str, List[str]]]) 319 | 320 | slots.topics = Slot(uri=DCTERMS.subject, name="topics", curie=DCTERMS.curie('subject'), 321 | model_uri=LINKML_REGISTRY.topics, domain=None, range=Optional[Union[str, List[str]]]) 322 | 323 | slots.entries = Slot(uri=DCTERMS.hasPart, name="entries", curie=DCTERMS.curie('hasPart'), 324 | model_uri=LINKML_REGISTRY.entries, domain=None, range=Optional[Union[Dict[Union[str, SchemaMetadataName], Union[dict, SchemaMetadata]], List[Union[dict, SchemaMetadata]]]]) 325 | 326 | slots.score = Slot(uri=LINKML_REGISTRY.score, name="score", curie=LINKML_REGISTRY.curie('score'), 327 | model_uri=LINKML_REGISTRY.score, domain=None, range=Optional[int]) 328 | 329 | slots.github_stars = Slot(uri=LINKML_REGISTRY.github_stars, name="github stars", curie=LINKML_REGISTRY.curie('github_stars'), 330 | model_uri=LINKML_REGISTRY.github_stars, domain=None, range=Optional[int]) 331 | 332 | slots.schema_relative_path = Slot(uri=LINKML_REGISTRY.schema_relative_path, name="schema relative path", curie=LINKML_REGISTRY.curie('schema_relative_path'), 333 | model_uri=LINKML_REGISTRY.schema_relative_path, domain=None, range=Optional[str]) 334 | 335 | slots.statistic = Slot(uri=LINKML_REGISTRY.statistic, name="statistic", curie=LINKML_REGISTRY.curie('statistic'), 336 | model_uri=LINKML_REGISTRY.statistic, domain=None, range=Optional[str]) 337 | 338 | slots.count_statistic = Slot(uri=LINKML_REGISTRY.count_statistic, name="count statistic", curie=LINKML_REGISTRY.curie('count_statistic'), 339 | model_uri=LINKML_REGISTRY.count_statistic, domain=None, range=Optional[int]) 340 | 341 | slots.proportion_statistic = Slot(uri=LINKML_REGISTRY.proportion_statistic, name="proportion statistic", curie=LINKML_REGISTRY.curie('proportion_statistic'), 342 | model_uri=LINKML_REGISTRY.proportion_statistic, domain=None, range=Optional[float]) 343 | 344 | slots.evaluation__score = Slot(uri=LINKML_REGISTRY.score, name="evaluation__score", curie=LINKML_REGISTRY.curie('score'), 345 | model_uri=LINKML_REGISTRY.evaluation__score, domain=None, range=Optional[str]) 346 | 347 | slots.evaluation__class_count = Slot(uri=LINKML_REGISTRY.class_count, name="evaluation__class_count", curie=LINKML_REGISTRY.curie('class_count'), 348 | model_uri=LINKML_REGISTRY.evaluation__class_count, domain=None, range=Optional[int]) 349 | 350 | slots.evaluation__slot_count = Slot(uri=LINKML_REGISTRY.slot_count, name="evaluation__slot_count", curie=LINKML_REGISTRY.curie('slot_count'), 351 | model_uri=LINKML_REGISTRY.evaluation__slot_count, domain=None, range=Optional[int]) 352 | 353 | slots.evaluation__enum_count = Slot(uri=LINKML_REGISTRY.enum_count, name="evaluation__enum_count", curie=LINKML_REGISTRY.curie('enum_count'), 354 | model_uri=LINKML_REGISTRY.evaluation__enum_count, domain=None, range=Optional[int]) 355 | 356 | slots.evaluation__type_count = Slot(uri=LINKML_REGISTRY.type_count, name="evaluation__type_count", curie=LINKML_REGISTRY.curie('type_count'), 357 | model_uri=LINKML_REGISTRY.evaluation__type_count, domain=None, range=Optional[int]) 358 | 359 | slots.evaluation__github_stars = Slot(uri=LINKML_REGISTRY.github_stars, name="evaluation__github_stars", curie=LINKML_REGISTRY.curie('github_stars'), 360 | model_uri=LINKML_REGISTRY.evaluation__github_stars, domain=None, range=Optional[int]) 361 | 362 | slots.evaluation__proportion_elements_with_a_description = Slot(uri=LINKML_REGISTRY.proportion_elements_with_a_description, name="evaluation__proportion_elements_with_a_description", curie=LINKML_REGISTRY.curie('proportion_elements_with_a_description'), 363 | model_uri=LINKML_REGISTRY.evaluation__proportion_elements_with_a_description, domain=None, range=Optional[float]) 364 | 365 | slots.evaluation__proportion_elements_mapped = Slot(uri=LINKML_REGISTRY.proportion_elements_mapped, name="evaluation__proportion_elements_mapped", curie=LINKML_REGISTRY.curie('proportion_elements_mapped'), 366 | model_uri=LINKML_REGISTRY.evaluation__proportion_elements_mapped, domain=None, range=Optional[float]) 367 | 368 | slots.evaluation__errors = Slot(uri=LINKML_REGISTRY.errors, name="evaluation__errors", curie=LINKML_REGISTRY.curie('errors'), 369 | model_uri=LINKML_REGISTRY.evaluation__errors, domain=None, range=Optional[Union[str, List[str]]]) -------------------------------------------------------------------------------- /src/linkml_registry/evaluate.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from linkml_runtime import SchemaView 4 | from linkml_runtime.linkml_model.meta import SchemaDefinition, Element, ClassDefinition, \ 5 | SlotDefinition, TypeDefinition, EnumDefinition 6 | from linkml_runtime.loaders import yaml_loader 7 | from linkml.utils.schemaloader import load_raw_schema 8 | from linkml.generators.yamlgen import YAMLGenerator 9 | from .github_utils import get_stars, clone_repo 10 | from .registry import SchemaMetadata, SchemaRegistry 11 | import logging 12 | 13 | 14 | def evaluate(sr: SchemaRegistry, use_github_api=True, workdir: str = None, include: List[str] = None): 15 | n = 0 16 | for s in sr.entries.values(): 17 | skip = False 18 | if include: 19 | if s.name not in include: 20 | skip = True 21 | if skip: 22 | print(f'SKIPPING: {s.name}') 23 | else: 24 | evaluate_schema_metadata(s, use_github_api=use_github_api, workdir=workdir) 25 | n += 1 26 | if n == 0: 27 | logging.error('No schemas evaluated') 28 | if include: 29 | logging.error(f'Is include set correctly? Current: {include}') 30 | logging.info(f'Evaluated {n} schemas') 31 | 32 | def evaluate_schema_metadata(sm: SchemaMetadata, use_github_api=True, workdir=None): 33 | if use_github_api: 34 | stars = get_stars(sm) 35 | sm.github_stars = stars 36 | if sm.schema_relative_path: 37 | try: 38 | dir = clone_repo(sm, workdir=workdir) 39 | print(f'Cloned to: {dir}') 40 | path = f'{dir}/{sm.schema_relative_path}' 41 | schema = load_schema(path) 42 | evaluate_schema(schema, sm) 43 | except Exception as e: 44 | logging.error(f'Exception: {e}') 45 | sm.errors.append(f'Error with obtaining schema for {sm.name}: {e}') 46 | raise e 47 | 48 | def load_schema(path: str) -> SchemaDefinition: 49 | #schema = load_raw_schema(path, merge_modules=True) 50 | sv = SchemaView(path) 51 | #gen = YAMLGenerator(path, mergeimports=True) 52 | #yaml = gen.serialize() 53 | #print(f'YAML={yaml}') 54 | schema = get_merged_schema(sv) 55 | print(f'Parsed schema: {schema.name} type: {type(schema)} classes: {type(schema.classes)} = {len(schema.classes)}') 56 | # filter_schema(schema) 57 | return schema 58 | 59 | def get_merged_schema(sv: SchemaView) -> SchemaDefinition: 60 | schema = sv.schema 61 | to_merge = [s2 for s2 in sv.all_schema(True) if s2 != schema] 62 | for s2 in to_merge: 63 | sv.merge_schema(s2) 64 | return sv.schema 65 | 66 | def filter_schema(schema: SchemaDefinition): 67 | """ 68 | trim internal imports from schema 69 | """ 70 | # TODO: ask Harold how to do this 71 | #nu_classes = [x for x in schema.classes.values() if not exclude_element(x)] 72 | #schema.classes = nu_classes 73 | #schema.classes = [x for x in schema.classes.values() if not exclude_element(x)] 74 | #schema.slots = [x for x in schema.slots.values() if not exclude_element(x)] 75 | #schema.types = [x for x in schema.types.values() if not exclude_element(x)] 76 | #schema.enums = [x for x in schema.enums.values() if not exclude_element(x)] 77 | None 78 | 79 | def exclude_element(x: Element) -> bool: 80 | """ 81 | true if element should be excluded. 82 | 83 | Currently the only criteria is that this is an import of a 'builtin' linkml type 84 | """ 85 | if x.from_schema and x.from_schema.startswith('https://w3id.org/linkml/'): 86 | return True 87 | else: 88 | return False 89 | 90 | def evaluate_schema(schema: SchemaDefinition, sm: SchemaMetadata): 91 | name = schema.name 92 | print(f'Loaded schema: {name}') 93 | if schema.license: 94 | sm.license = schema.license 95 | if schema.description and schema.description != '': 96 | sm.description = schema.description 97 | if schema.title and schema.title != '': 98 | sm.title = schema.title 99 | if sm.title is None or sm.title == '': 100 | sm.title = sm.name 101 | sm.class_count = len(schema.classes.values()) 102 | print(f'CC: {sm.class_count}') 103 | sm.slot_count = len(schema.slots.values()) 104 | sm.enum_count = len(schema.enums.values()) 105 | sm.type_count = len(schema.types.values()) 106 | elements = list(schema.classes.values()) + list(schema.slots.values()) + \ 107 | list(schema.types.values()) + list(schema.enums.values()) 108 | elements_with_descriptions = [x for x in elements if x.description is not None and x.description != ''] 109 | sm.proportion_elements_with_a_description = len(elements_with_descriptions) / len(elements) 110 | elements_mapped = [x for x in elements if _is_mapped(x)] 111 | sm.proportion_elements_mapped = len(elements_mapped) / len(elements) 112 | 113 | def _is_mapped(x: Element) -> bool: 114 | if (x.exact_mappings and len(x.exact_mappings) > 0): 115 | return True 116 | # todo: check if class_uri is distinct from 117 | if isinstance(x, ClassDefinition): 118 | if x.class_uri: 119 | return True 120 | if isinstance(x, SlotDefinition): 121 | if x.slot_uri: 122 | return True 123 | if isinstance(x, TypeDefinition): 124 | return True 125 | if isinstance(x, EnumDefinition): 126 | if x.permissible_values and len(x.permissible_values) > 0: 127 | if len([v for v in x.permissible_values.values() if not v.meaning]) > 0: 128 | return False 129 | else: 130 | return True 131 | return False 132 | 133 | -------------------------------------------------------------------------------- /src/linkml_registry/github_utils.py: -------------------------------------------------------------------------------- 1 | from .registry import SchemaRegistry, SchemaMetadata 2 | from typing import Dict, List, Optional 3 | from github import Github 4 | import logging 5 | import re 6 | import subprocess 7 | from pathlib import Path 8 | import os 9 | 10 | 11 | g = Github() 12 | 13 | def get_repo(s: SchemaMetadata): 14 | repo_name = get_repo_name(s) 15 | if repo_name: 16 | print(f'Repo = {repo_name}') 17 | try: 18 | return g.get_repo(repo_name) 19 | except: 20 | logging.error(f'Error accessing {repo_name}') 21 | return None 22 | 23 | def get_repo_name(s: SchemaMetadata) -> str: 24 | if s.github_repo is not None: 25 | return s.github_repo 26 | if s.schema_url is not None: 27 | m = re.search('github.com/([\\w-]+/[\\w-]+)/', s.schema_url) 28 | if m: 29 | return m.group(1) 30 | 31 | def get_stars(s: SchemaMetadata) -> Optional[int]: 32 | repo = get_repo(s) 33 | print(f'Repo for {s.name} = {repo}') 34 | if repo: 35 | try: 36 | return repo.stargazers_count 37 | except: 38 | logging.error(f'Error accessing {repo}') 39 | 40 | def get_repo_clone_url(s: SchemaMetadata): 41 | repo = get_repo_name(s) 42 | return f'https://github.com/{repo}.git' 43 | 44 | def clone_repo(s: SchemaMetadata, workdir=None, replace=False) -> str: 45 | if workdir is None: 46 | workdir = 'tmp' 47 | [owner, repo] = get_repo_name(s).split('/') 48 | path = f'{workdir}/{repo}' 49 | print(f'{s.name} Path={path}') 50 | if os.path.exists(path): 51 | if replace: 52 | os.remove(path) 53 | else: 54 | return path 55 | url = get_repo_clone_url(s) 56 | Path(workdir).mkdir(parents=True, exist_ok=True) 57 | runcmds([f'cd {workdir}', 58 | f'git clone {url}']) 59 | return path 60 | 61 | 62 | 63 | def runcmds(cmds: List[str]): 64 | return runcmd(" && ".join(cmds)) 65 | 66 | def runcmd(cmd): 67 | logging.info("RUNNING: {}".format(cmd)) 68 | p = subprocess.Popen([cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, universal_newlines=True) 69 | (out, err) = p.communicate() 70 | logging.info('OUT: {}'.format(out)) 71 | if err: 72 | logging.error(err) 73 | if p.returncode != 0: 74 | raise Exception('Failed: {}'.format(cmd)) -------------------------------------------------------------------------------- /src/linkml_registry/jsonld/registry.context.jsonld: -------------------------------------------------------------------------------- 1 | { 2 | "_comments": "Auto generated from registry.yaml by jsonldcontextgen.py version: 0.1.1\n Generation date: 2021-11-08 20:40\n Schema: linkml_registry\n \n id: https://w3id.org/linkml_registry\n description: Datamodel for LinkML Registry and evaluation framework\n license: https://creativecommons.org/publicdomain/zero/1.0/\n ", 3 | "@context": { 4 | "OIO": "http://www.geneontology.org/formats/oboInOwl#", 5 | "bibo": "http://purl.org/ontology/bibo/", 6 | "dcat": "http://www.w3.org/ns/dcat#", 7 | "dcterms": "http://example.org/UNKNOWN/dcterms/", 8 | "doap": "http://usefulinc.com/ns/doap#", 9 | "foaf": "http://xmlns.com/foaf/0.1/", 10 | "linkml": "https://w3id.org/linkml/", 11 | "linkml_registry": { 12 | "@id": "https://w3id.org/linkml_registry", 13 | "@prefix": true 14 | }, 15 | "oslc": "http://open-services.net/ns/core#", 16 | "pav": "http://purl.org/pav/", 17 | "schema": "http://schema.org/", 18 | "skos": "http://www.w3.org/2004/02/skos/core#", 19 | "@vocab": "https://w3id.org/linkml_registry", 20 | "base_purl": { 21 | "@type": "@id" 22 | }, 23 | "count_statistic": { 24 | "@type": "xsd:integer" 25 | }, 26 | "description": { 27 | "@id": "skos:definition" 28 | }, 29 | "domain": { 30 | "@id": "dcterms:subject" 31 | }, 32 | "entries": { 33 | "@type": "@id", 34 | "@id": "dcterms:hasPart" 35 | }, 36 | "class_count": { 37 | "@type": "xsd:integer" 38 | }, 39 | "enum_count": { 40 | "@type": "xsd:integer" 41 | }, 42 | "github_stars": { 43 | "@type": "xsd:integer" 44 | }, 45 | "proportion_elements_mapped": { 46 | "@type": "xsd:float" 47 | }, 48 | "proportion_elements_with_a_description": { 49 | "@type": "xsd:float" 50 | }, 51 | "slot_count": { 52 | "@type": "xsd:integer" 53 | }, 54 | "type_count": { 55 | "@type": "xsd:integer" 56 | }, 57 | "homepage": { 58 | "@id": "foaf:homepage" 59 | }, 60 | "issue_tracker": { 61 | "@id": "doap:bug-database" 62 | }, 63 | "license": { 64 | "@id": "dcterms:license" 65 | }, 66 | "name": "@id", 67 | "proportion_statistic": { 68 | "@type": "xsd:float" 69 | }, 70 | "schema_purl": { 71 | "@type": "@id" 72 | }, 73 | "schema_url": { 74 | "@id": "dcterms:source" 75 | }, 76 | "score": { 77 | "@type": "xsd:integer" 78 | }, 79 | "title": { 80 | "@id": "dcterms:title" 81 | }, 82 | "topics": { 83 | "@id": "dcterms:subject" 84 | } 85 | } 86 | } 87 | 88 | -------------------------------------------------------------------------------- /src/linkml_registry/jsonld/registry.model.context.jsonld: -------------------------------------------------------------------------------- 1 | { 2 | "_comments": "Auto generated from registry.yaml by jsonldcontextgen.py version: 0.1.1\n Generation date: 2021-11-08 20:40\n Schema: linkml_registry\n \n id: https://w3id.org/linkml_registry\n description: Datamodel for LinkML Registry and evaluation framework\n license: https://creativecommons.org/publicdomain/zero/1.0/\n ", 3 | "@context": { 4 | "OIO": "http://www.geneontology.org/formats/oboInOwl#", 5 | "bibo": "http://purl.org/ontology/bibo/", 6 | "dcat": "http://www.w3.org/ns/dcat#", 7 | "dcterms": "http://example.org/UNKNOWN/dcterms/", 8 | "doap": "http://usefulinc.com/ns/doap#", 9 | "foaf": "http://xmlns.com/foaf/0.1/", 10 | "linkml": "https://w3id.org/linkml/", 11 | "linkml_registry": { 12 | "@id": "https://w3id.org/linkml_registry", 13 | "@prefix": true 14 | }, 15 | "oslc": "http://open-services.net/ns/core#", 16 | "pav": "http://purl.org/pav/", 17 | "schema": "http://schema.org/", 18 | "skos": "http://www.w3.org/2004/02/skos/core#", 19 | "@vocab": "https://w3id.org/linkml_registry", 20 | "base_purl": { 21 | "@type": "@id" 22 | }, 23 | "count_statistic": { 24 | "@type": "xsd:integer" 25 | }, 26 | "description": { 27 | "@id": "skos:definition" 28 | }, 29 | "domain": { 30 | "@id": "dcterms:subject" 31 | }, 32 | "entries": { 33 | "@type": "@id", 34 | "@id": "dcterms:hasPart" 35 | }, 36 | "class_count": { 37 | "@type": "xsd:integer" 38 | }, 39 | "enum_count": { 40 | "@type": "xsd:integer" 41 | }, 42 | "github_stars": { 43 | "@type": "xsd:integer" 44 | }, 45 | "proportion_elements_mapped": { 46 | "@type": "xsd:float" 47 | }, 48 | "proportion_elements_with_a_description": { 49 | "@type": "xsd:float" 50 | }, 51 | "slot_count": { 52 | "@type": "xsd:integer" 53 | }, 54 | "type_count": { 55 | "@type": "xsd:integer" 56 | }, 57 | "homepage": { 58 | "@id": "foaf:homepage" 59 | }, 60 | "issue_tracker": { 61 | "@id": "doap:bug-database" 62 | }, 63 | "license": { 64 | "@id": "dcterms:license" 65 | }, 66 | "name": "@id", 67 | "proportion_statistic": { 68 | "@type": "xsd:float" 69 | }, 70 | "schema_purl": { 71 | "@type": "@id" 72 | }, 73 | "schema_url": { 74 | "@id": "dcterms:source" 75 | }, 76 | "score": { 77 | "@type": "xsd:integer" 78 | }, 79 | "title": { 80 | "@id": "dcterms:title" 81 | }, 82 | "topics": { 83 | "@id": "dcterms:subject" 84 | } 85 | } 86 | } 87 | 88 | -------------------------------------------------------------------------------- /src/linkml_registry/jsonschema/registry.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$id": "https://w3id.org/linkml_registry", 3 | "$schema": "http://json-schema.org/draft-07/schema#", 4 | "definitions": { 5 | "SchemaMetadata": { 6 | "additionalProperties": false, 7 | "description": "", 8 | "properties": { 9 | "class_count": { 10 | "type": "integer" 11 | }, 12 | "description": { 13 | "type": "string" 14 | }, 15 | "domain": { 16 | "items": { 17 | "type": "string" 18 | }, 19 | "type": "array" 20 | }, 21 | "enum_count": { 22 | "type": "integer" 23 | }, 24 | "errors": { 25 | "items": { 26 | "type": "string" 27 | }, 28 | "type": "array" 29 | }, 30 | "github_repo": { 31 | "type": "string" 32 | }, 33 | "github_stars": { 34 | "type": "integer" 35 | }, 36 | "homepage": { 37 | "type": "string" 38 | }, 39 | "license": { 40 | "type": "string" 41 | }, 42 | "name": { 43 | "type": "string" 44 | }, 45 | "proportion_elements_mapped": { 46 | "type": "number" 47 | }, 48 | "proportion_elements_with_a_description": { 49 | "type": "number" 50 | }, 51 | "schema_relative_path": { 52 | "type": "string" 53 | }, 54 | "schema_url": { 55 | "type": "string" 56 | }, 57 | "score": { 58 | "type": "string" 59 | }, 60 | "slot_count": { 61 | "type": "integer" 62 | }, 63 | "title": { 64 | "description": "the official title of the schema", 65 | "type": "string" 66 | }, 67 | "topics": { 68 | "items": { 69 | "type": "string" 70 | }, 71 | "type": "array" 72 | }, 73 | "type_count": { 74 | "type": "integer" 75 | } 76 | }, 77 | "required": [ 78 | "name" 79 | ], 80 | "title": "SchemaMetadata", 81 | "type": "object" 82 | }, 83 | "SchemaRegistry": { 84 | "additionalProperties": false, 85 | "description": "", 86 | "properties": { 87 | "description": { 88 | "type": "string" 89 | }, 90 | "domain": { 91 | "items": { 92 | "type": "string" 93 | }, 94 | "type": "array" 95 | }, 96 | "entries": { 97 | "items": { 98 | "$ref": "#/definitions/SchemaMetadata" 99 | }, 100 | "type": "array" 101 | }, 102 | "homepage": { 103 | "type": "string" 104 | }, 105 | "license": { 106 | "type": "string" 107 | }, 108 | "name": { 109 | "type": "string" 110 | }, 111 | "title": { 112 | "description": "the official title of the schema", 113 | "type": "string" 114 | }, 115 | "topics": { 116 | "items": { 117 | "type": "string" 118 | }, 119 | "type": "array" 120 | } 121 | }, 122 | "required": [ 123 | "name" 124 | ], 125 | "title": "SchemaRegistry", 126 | "type": "object" 127 | } 128 | }, 129 | "properties": {}, 130 | "title": "linkml_registry", 131 | "type": "object" 132 | } 133 | 134 | -------------------------------------------------------------------------------- /src/linkml_registry/markdown_dumper.py: -------------------------------------------------------------------------------- 1 | from .registry import SchemaRegistry, SchemaMetadata 2 | from mdutils.tools.Table import Table 3 | from mdutils import MdUtils 4 | import io 5 | from io import StringIO 6 | from contextlib import redirect_stdout 7 | 8 | import json 9 | from typing import Dict, List 10 | from jsonasobj2 import items, JsonObj, as_dict 11 | from dataclasses import astuple, dataclass, fields 12 | 13 | from linkml_runtime.dumpers.dumper_root import Dumper 14 | 15 | 16 | class MarkdownDumper(Dumper): 17 | def dump(self, sr: SchemaRegistry, to_file: str) -> None: 18 | with open(to_file, 'w') as stream: 19 | stream.write(self.dumps(sr)) 20 | 21 | def _get_header_dict(self, pycls) -> Dict: 22 | h = {} 23 | for f in fields(pycls): 24 | # TODO: use metadata 25 | h[f.name] = f.name 26 | return h 27 | 28 | def _autoformat(self, text) -> str: 29 | if isinstance(text, list): 30 | return '; '.join([self._autoformat(x) for x in text]) 31 | if isinstance(text, float): 32 | text = int(text * 100) / 100 33 | text = str(text) 34 | if text.startswith('http'): 35 | return self._link(text) 36 | else: 37 | return text 38 | def _link(self, url, text: str=None) -> str: 39 | if text is None: 40 | text = url 41 | return f'[{text}]({url})' 42 | 43 | class MarkdownTableDumper(MarkdownDumper): 44 | 45 | def dumps(self, sr: SchemaRegistry) -> None: 46 | h = self._get_header_dict(SchemaMetadata) 47 | text_list = list(h.values()) 48 | rows = 1 49 | s: SchemaMetadata 50 | for s in sr.entries.values(): 51 | print(f'S={s}') 52 | row = self._create_row(s, h) 53 | cols = len(row) 54 | text_list += [str(x) for x in row] 55 | rows += 1 56 | table = Table().create_table(columns=cols, rows=rows, text=text_list, text_align='center') 57 | return str(table) 58 | 59 | def _create_row(self, s: SchemaMetadata, h: dict) -> List[str]: 60 | row = [] 61 | for k in h.keys(): 62 | v = s.__getattr__(k) 63 | if v is None: 64 | v = '' 65 | row.append(v) 66 | return row 67 | 68 | class MarkdownPageDumper(MarkdownDumper): 69 | 70 | def dumps(self, sr: SchemaRegistry) -> None: 71 | output = StringIO() 72 | with redirect_stdout(output): 73 | print(f'# LinkML Registry Entries\n') 74 | h = self._get_header_dict(SchemaMetadata) 75 | s: SchemaMetadata 76 | for s in sr.entries.values(): 77 | print(f'## {s.title}\n') 78 | print(f'{s.description}\n') 79 | text_list = ['key', 'value'] 80 | rows = 1 81 | for k in h.keys(): 82 | if k == 'description': 83 | continue 84 | v = s.__getattr__(k) 85 | if v is not None and v != '' and v != []: 86 | text_list += [k, self._autoformat(v)] 87 | rows += 1 88 | table = Table().create_table(columns=2, rows=rows, text=text_list, text_align='center') 89 | print(str(table)) 90 | return output.getvalue() 91 | 92 | def _get_header_dict(self, pycls) -> Dict: 93 | h = {} 94 | for f in fields(pycls): 95 | # TODO: use metadata 96 | h[f.name] = f.name 97 | return h 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /src/linkml_registry/registry.py: -------------------------------------------------------------------------------- 1 | # Auto generated from registry.yaml by pythongen.py version: 0.9.0 2 | # Generation date: 2022-01-14T16:33:29 3 | # Schema: linkml_registry 4 | # 5 | # id: https://w3id.org/linkml_registry 6 | # description: Datamodel for LinkML Registry and evaluation framework 7 | # license: https://creativecommons.org/publicdomain/zero/1.0/ 8 | 9 | import dataclasses 10 | import sys 11 | import re 12 | from jsonasobj2 import JsonObj, as_dict 13 | from typing import Optional, List, Union, Dict, ClassVar, Any 14 | from dataclasses import dataclass 15 | from linkml_runtime.linkml_model.meta import EnumDefinition, PermissibleValue, PvFormulaOptions 16 | 17 | from linkml_runtime.utils.slot import Slot 18 | from linkml_runtime.utils.metamodelcore import empty_list, empty_dict, bnode 19 | from linkml_runtime.utils.yamlutils import YAMLRoot, extended_str, extended_float, extended_int 20 | from linkml_runtime.utils.dataclass_extensions_376 import dataclasses_init_fn_with_kwargs 21 | from linkml_runtime.utils.formatutils import camelcase, underscore, sfx 22 | from linkml_runtime.utils.enumerations import EnumDefinitionImpl 23 | from rdflib import Namespace, URIRef 24 | from linkml_runtime.utils.curienamespace import CurieNamespace 25 | from linkml_runtime.linkml_model.types import Float, Integer, String, Uriorcurie 26 | from linkml_runtime.utils.metamodelcore import URIorCURIE 27 | 28 | metamodel_version = "1.7.0" 29 | 30 | # Overwrite dataclasses _init_fn to add **kwargs in __init__ 31 | dataclasses._init_fn = dataclasses_init_fn_with_kwargs 32 | 33 | # Namespaces 34 | OIO = CurieNamespace('OIO', 'http://www.geneontology.org/formats/oboInOwl#') 35 | BIBO = CurieNamespace('bibo', 'http://purl.org/ontology/bibo/') 36 | DCAT = CurieNamespace('dcat', 'http://www.w3.org/ns/dcat#') 37 | DCTERMS = CurieNamespace('dcterms', 'http://example.org/UNKNOWN/dcterms/') 38 | DOAP = CurieNamespace('doap', 'http://usefulinc.com/ns/doap#') 39 | FOAF = CurieNamespace('foaf', 'http://xmlns.com/foaf/0.1/') 40 | LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/') 41 | LINKML_REGISTRY = CurieNamespace('linkml_registry', 'https://w3id.org/linkml_registry') 42 | OSLC = CurieNamespace('oslc', 'http://open-services.net/ns/core#') 43 | PAV = CurieNamespace('pav', 'http://purl.org/pav/') 44 | RDFS = CurieNamespace('rdfs', 'http://example.org/UNKNOWN/rdfs/') 45 | SCHEMA = CurieNamespace('schema', 'http://schema.org/') 46 | SKOS = CurieNamespace('skos', 'http://www.w3.org/2004/02/skos/core#') 47 | XSD = CurieNamespace('xsd', 'http://www.w3.org/2001/XMLSchema#') 48 | DEFAULT_ = LINKML_REGISTRY 49 | 50 | 51 | # Types 52 | class HttpsIdentifier(String): 53 | type_class_uri = XSD.string 54 | type_class_curie = "xsd:string" 55 | type_name = "https identifier" 56 | type_model_uri = LINKML_REGISTRY.HttpsIdentifier 57 | 58 | 59 | # Class references 60 | class SchemaRegistryName(extended_str): 61 | pass 62 | 63 | 64 | class SchemaMetadataName(extended_str): 65 | pass 66 | 67 | 68 | @dataclass 69 | class SchemaRegistry(YAMLRoot): 70 | _inherited_slots: ClassVar[List[str]] = [] 71 | 72 | class_class_uri: ClassVar[URIRef] = LINKML_REGISTRY.SchemaRegistry 73 | class_class_curie: ClassVar[str] = "linkml_registry:SchemaRegistry" 74 | class_name: ClassVar[str] = "schema registry" 75 | class_model_uri: ClassVar[URIRef] = LINKML_REGISTRY.SchemaRegistry 76 | 77 | name: Union[str, SchemaRegistryName] = None 78 | homepage: Optional[Union[str, HttpsIdentifier]] = None 79 | entries: Optional[Union[Dict[Union[str, SchemaMetadataName], Union[dict, "SchemaMetadata"]], List[Union[dict, "SchemaMetadata"]]]] = empty_dict() 80 | license: Optional[str] = None 81 | title: Optional[str] = None 82 | description: Optional[str] = None 83 | domain: Optional[Union[str, List[str]]] = empty_list() 84 | topics: Optional[Union[str, List[str]]] = empty_list() 85 | 86 | def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): 87 | if self._is_empty(self.name): 88 | self.MissingRequiredField("name") 89 | if not isinstance(self.name, SchemaRegistryName): 90 | self.name = SchemaRegistryName(self.name) 91 | 92 | if self.homepage is not None and not isinstance(self.homepage, HttpsIdentifier): 93 | self.homepage = HttpsIdentifier(self.homepage) 94 | 95 | self._normalize_inlined_as_dict(slot_name="entries", slot_type=SchemaMetadata, key_name="name", keyed=True) 96 | 97 | if self.license is not None and not isinstance(self.license, str): 98 | self.license = str(self.license) 99 | 100 | if self.title is not None and not isinstance(self.title, str): 101 | self.title = str(self.title) 102 | 103 | if self.description is not None and not isinstance(self.description, str): 104 | self.description = str(self.description) 105 | 106 | if not isinstance(self.domain, list): 107 | self.domain = [self.domain] if self.domain is not None else [] 108 | self.domain = [v if isinstance(v, str) else str(v) for v in self.domain] 109 | 110 | if not isinstance(self.topics, list): 111 | self.topics = [self.topics] if self.topics is not None else [] 112 | self.topics = [v if isinstance(v, str) else str(v) for v in self.topics] 113 | 114 | super().__post_init__(**kwargs) 115 | 116 | 117 | @dataclass 118 | class SchemaMetadata(YAMLRoot): 119 | _inherited_slots: ClassVar[List[str]] = [] 120 | 121 | class_class_uri: ClassVar[URIRef] = LINKML_REGISTRY.SchemaMetadata 122 | class_class_curie: ClassVar[str] = "linkml_registry:SchemaMetadata" 123 | class_name: ClassVar[str] = "schema metadata" 124 | class_model_uri: ClassVar[URIRef] = LINKML_REGISTRY.SchemaMetadata 125 | 126 | name: Union[str, SchemaMetadataName] = None 127 | title: Optional[str] = None 128 | description: Optional[str] = None 129 | homepage: Optional[Union[str, HttpsIdentifier]] = None 130 | schema_url: Optional[Union[str, HttpsIdentifier]] = None 131 | github_repo: Optional[str] = None 132 | schema_relative_path: Optional[str] = None 133 | license: Optional[str] = None 134 | domain: Optional[Union[str, List[str]]] = empty_list() 135 | topics: Optional[Union[str, List[str]]] = empty_list() 136 | score: Optional[str] = None 137 | class_count: Optional[int] = None 138 | slot_count: Optional[int] = None 139 | enum_count: Optional[int] = None 140 | type_count: Optional[int] = None 141 | github_stars: Optional[int] = None 142 | proportion_elements_with_a_description: Optional[float] = None 143 | proportion_elements_mapped: Optional[float] = None 144 | errors: Optional[Union[str, List[str]]] = empty_list() 145 | 146 | def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): 147 | if self._is_empty(self.name): 148 | self.MissingRequiredField("name") 149 | if not isinstance(self.name, SchemaMetadataName): 150 | self.name = SchemaMetadataName(self.name) 151 | 152 | if self.title is not None and not isinstance(self.title, str): 153 | self.title = str(self.title) 154 | 155 | if self.description is not None and not isinstance(self.description, str): 156 | self.description = str(self.description) 157 | 158 | if self.homepage is not None and not isinstance(self.homepage, HttpsIdentifier): 159 | self.homepage = HttpsIdentifier(self.homepage) 160 | 161 | if self.schema_url is not None and not isinstance(self.schema_url, HttpsIdentifier): 162 | self.schema_url = HttpsIdentifier(self.schema_url) 163 | 164 | if self.github_repo is not None and not isinstance(self.github_repo, str): 165 | self.github_repo = str(self.github_repo) 166 | 167 | if self.schema_relative_path is not None and not isinstance(self.schema_relative_path, str): 168 | self.schema_relative_path = str(self.schema_relative_path) 169 | 170 | if self.license is not None and not isinstance(self.license, str): 171 | self.license = str(self.license) 172 | 173 | if not isinstance(self.domain, list): 174 | self.domain = [self.domain] if self.domain is not None else [] 175 | self.domain = [v if isinstance(v, str) else str(v) for v in self.domain] 176 | 177 | if not isinstance(self.topics, list): 178 | self.topics = [self.topics] if self.topics is not None else [] 179 | self.topics = [v if isinstance(v, str) else str(v) for v in self.topics] 180 | 181 | if self.score is not None and not isinstance(self.score, str): 182 | self.score = str(self.score) 183 | 184 | if self.class_count is not None and not isinstance(self.class_count, int): 185 | self.class_count = int(self.class_count) 186 | 187 | if self.slot_count is not None and not isinstance(self.slot_count, int): 188 | self.slot_count = int(self.slot_count) 189 | 190 | if self.enum_count is not None and not isinstance(self.enum_count, int): 191 | self.enum_count = int(self.enum_count) 192 | 193 | if self.type_count is not None and not isinstance(self.type_count, int): 194 | self.type_count = int(self.type_count) 195 | 196 | if self.github_stars is not None and not isinstance(self.github_stars, int): 197 | self.github_stars = int(self.github_stars) 198 | 199 | if self.proportion_elements_with_a_description is not None and not isinstance(self.proportion_elements_with_a_description, float): 200 | self.proportion_elements_with_a_description = float(self.proportion_elements_with_a_description) 201 | 202 | if self.proportion_elements_mapped is not None and not isinstance(self.proportion_elements_mapped, float): 203 | self.proportion_elements_mapped = float(self.proportion_elements_mapped) 204 | 205 | if not isinstance(self.errors, list): 206 | self.errors = [self.errors] if self.errors is not None else [] 207 | self.errors = [v if isinstance(v, str) else str(v) for v in self.errors] 208 | 209 | super().__post_init__(**kwargs) 210 | 211 | 212 | @dataclass 213 | class Evaluation(YAMLRoot): 214 | _inherited_slots: ClassVar[List[str]] = [] 215 | 216 | class_class_uri: ClassVar[URIRef] = LINKML_REGISTRY.Evaluation 217 | class_class_curie: ClassVar[str] = "linkml_registry:Evaluation" 218 | class_name: ClassVar[str] = "evaluation" 219 | class_model_uri: ClassVar[URIRef] = LINKML_REGISTRY.Evaluation 220 | 221 | score: Optional[str] = None 222 | class_count: Optional[int] = None 223 | slot_count: Optional[int] = None 224 | enum_count: Optional[int] = None 225 | type_count: Optional[int] = None 226 | github_stars: Optional[int] = None 227 | proportion_elements_with_a_description: Optional[float] = None 228 | proportion_elements_mapped: Optional[float] = None 229 | errors: Optional[Union[str, List[str]]] = empty_list() 230 | 231 | def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): 232 | if self.score is not None and not isinstance(self.score, str): 233 | self.score = str(self.score) 234 | 235 | if self.class_count is not None and not isinstance(self.class_count, int): 236 | self.class_count = int(self.class_count) 237 | 238 | if self.slot_count is not None and not isinstance(self.slot_count, int): 239 | self.slot_count = int(self.slot_count) 240 | 241 | if self.enum_count is not None and not isinstance(self.enum_count, int): 242 | self.enum_count = int(self.enum_count) 243 | 244 | if self.type_count is not None and not isinstance(self.type_count, int): 245 | self.type_count = int(self.type_count) 246 | 247 | if self.github_stars is not None and not isinstance(self.github_stars, int): 248 | self.github_stars = int(self.github_stars) 249 | 250 | if self.proportion_elements_with_a_description is not None and not isinstance(self.proportion_elements_with_a_description, float): 251 | self.proportion_elements_with_a_description = float(self.proportion_elements_with_a_description) 252 | 253 | if self.proportion_elements_mapped is not None and not isinstance(self.proportion_elements_mapped, float): 254 | self.proportion_elements_mapped = float(self.proportion_elements_mapped) 255 | 256 | if not isinstance(self.errors, list): 257 | self.errors = [self.errors] if self.errors is not None else [] 258 | self.errors = [v if isinstance(v, str) else str(v) for v in self.errors] 259 | 260 | super().__post_init__(**kwargs) 261 | 262 | 263 | # Enumerations 264 | class LicenseEnum(EnumDefinitionImpl): 265 | 266 | _defn = EnumDefinition( 267 | name="LicenseEnum", 268 | ) 269 | 270 | @classmethod 271 | def _addvals(cls): 272 | setattr(cls, "CC-BY-v4", 273 | PermissibleValue(text="CC-BY-v4", 274 | description="CC-BY", 275 | meaning=None) ) 276 | setattr(cls, "CC-0-v1", 277 | PermissibleValue(text="CC-0-v1", 278 | description="CC-0", 279 | meaning=None) ) 280 | 281 | # Slots 282 | class slots: 283 | pass 284 | 285 | slots.name = Slot(uri=RDFS.label, name="name", curie=RDFS.curie('label'), 286 | model_uri=LINKML_REGISTRY.name, domain=None, range=URIRef) 287 | 288 | slots.base_purl = Slot(uri=LINKML_REGISTRY.base_purl, name="base purl", curie=LINKML_REGISTRY.curie('base_purl'), 289 | model_uri=LINKML_REGISTRY.base_purl, domain=None, range=Optional[Union[str, URIorCURIE]]) 290 | 291 | slots.schema_purl = Slot(uri=LINKML_REGISTRY.schema_purl, name="schema purl", curie=LINKML_REGISTRY.curie('schema_purl'), 292 | model_uri=LINKML_REGISTRY.schema_purl, domain=None, range=Optional[Union[str, URIorCURIE]]) 293 | 294 | slots.homepage = Slot(uri=FOAF.homepage, name="homepage", curie=FOAF.curie('homepage'), 295 | model_uri=LINKML_REGISTRY.homepage, domain=None, range=Optional[Union[str, HttpsIdentifier]]) 296 | 297 | slots.schema_url = Slot(uri=DCTERMS.source, name="schema url", curie=DCTERMS.curie('source'), 298 | model_uri=LINKML_REGISTRY.schema_url, domain=None, range=Optional[Union[str, HttpsIdentifier]]) 299 | 300 | slots.github_repo = Slot(uri=LINKML_REGISTRY.github_repo, name="github repo", curie=LINKML_REGISTRY.curie('github_repo'), 301 | model_uri=LINKML_REGISTRY.github_repo, domain=None, range=Optional[str]) 302 | 303 | slots.issue_tracker = Slot(uri=DOAP['bug-database'], name="issue tracker", curie=DOAP.curie('bug-database'), 304 | model_uri=LINKML_REGISTRY.issue_tracker, domain=None, range=Optional[str]) 305 | 306 | slots.license = Slot(uri=DCTERMS.license, name="license", curie=DCTERMS.curie('license'), 307 | model_uri=LINKML_REGISTRY.license, domain=None, range=Optional[str]) 308 | 309 | slots.title = Slot(uri=DCTERMS.title, name="title", curie=DCTERMS.curie('title'), 310 | model_uri=LINKML_REGISTRY.title, domain=None, range=Optional[str]) 311 | 312 | slots.description = Slot(uri=SKOS.definition, name="description", curie=SKOS.curie('definition'), 313 | model_uri=LINKML_REGISTRY.description, domain=None, range=Optional[str]) 314 | 315 | slots.domain = Slot(uri=DCTERMS.subject, name="domain", curie=DCTERMS.curie('subject'), 316 | model_uri=LINKML_REGISTRY.domain, domain=None, range=Optional[Union[str, List[str]]]) 317 | 318 | slots.topics = Slot(uri=DCTERMS.subject, name="topics", curie=DCTERMS.curie('subject'), 319 | model_uri=LINKML_REGISTRY.topics, domain=None, range=Optional[Union[str, List[str]]]) 320 | 321 | slots.entries = Slot(uri=DCTERMS.hasPart, name="entries", curie=DCTERMS.curie('hasPart'), 322 | model_uri=LINKML_REGISTRY.entries, domain=None, range=Optional[Union[Dict[Union[str, SchemaMetadataName], Union[dict, SchemaMetadata]], List[Union[dict, SchemaMetadata]]]]) 323 | 324 | slots.score = Slot(uri=LINKML_REGISTRY.score, name="score", curie=LINKML_REGISTRY.curie('score'), 325 | model_uri=LINKML_REGISTRY.score, domain=None, range=Optional[int]) 326 | 327 | slots.github_stars = Slot(uri=LINKML_REGISTRY.github_stars, name="github stars", curie=LINKML_REGISTRY.curie('github_stars'), 328 | model_uri=LINKML_REGISTRY.github_stars, domain=None, range=Optional[int]) 329 | 330 | slots.schema_relative_path = Slot(uri=LINKML_REGISTRY.schema_relative_path, name="schema relative path", curie=LINKML_REGISTRY.curie('schema_relative_path'), 331 | model_uri=LINKML_REGISTRY.schema_relative_path, domain=None, range=Optional[str]) 332 | 333 | slots.statistic = Slot(uri=LINKML_REGISTRY.statistic, name="statistic", curie=LINKML_REGISTRY.curie('statistic'), 334 | model_uri=LINKML_REGISTRY.statistic, domain=None, range=Optional[str]) 335 | 336 | slots.count_statistic = Slot(uri=LINKML_REGISTRY.count_statistic, name="count statistic", curie=LINKML_REGISTRY.curie('count_statistic'), 337 | model_uri=LINKML_REGISTRY.count_statistic, domain=None, range=Optional[int]) 338 | 339 | slots.proportion_statistic = Slot(uri=LINKML_REGISTRY.proportion_statistic, name="proportion statistic", curie=LINKML_REGISTRY.curie('proportion_statistic'), 340 | model_uri=LINKML_REGISTRY.proportion_statistic, domain=None, range=Optional[float]) 341 | 342 | slots.evaluation__score = Slot(uri=LINKML_REGISTRY.score, name="evaluation__score", curie=LINKML_REGISTRY.curie('score'), 343 | model_uri=LINKML_REGISTRY.evaluation__score, domain=None, range=Optional[str]) 344 | 345 | slots.evaluation__class_count = Slot(uri=LINKML_REGISTRY.class_count, name="evaluation__class_count", curie=LINKML_REGISTRY.curie('class_count'), 346 | model_uri=LINKML_REGISTRY.evaluation__class_count, domain=None, range=Optional[int]) 347 | 348 | slots.evaluation__slot_count = Slot(uri=LINKML_REGISTRY.slot_count, name="evaluation__slot_count", curie=LINKML_REGISTRY.curie('slot_count'), 349 | model_uri=LINKML_REGISTRY.evaluation__slot_count, domain=None, range=Optional[int]) 350 | 351 | slots.evaluation__enum_count = Slot(uri=LINKML_REGISTRY.enum_count, name="evaluation__enum_count", curie=LINKML_REGISTRY.curie('enum_count'), 352 | model_uri=LINKML_REGISTRY.evaluation__enum_count, domain=None, range=Optional[int]) 353 | 354 | slots.evaluation__type_count = Slot(uri=LINKML_REGISTRY.type_count, name="evaluation__type_count", curie=LINKML_REGISTRY.curie('type_count'), 355 | model_uri=LINKML_REGISTRY.evaluation__type_count, domain=None, range=Optional[int]) 356 | 357 | slots.evaluation__github_stars = Slot(uri=LINKML_REGISTRY.github_stars, name="evaluation__github_stars", curie=LINKML_REGISTRY.curie('github_stars'), 358 | model_uri=LINKML_REGISTRY.evaluation__github_stars, domain=None, range=Optional[int]) 359 | 360 | slots.evaluation__proportion_elements_with_a_description = Slot(uri=LINKML_REGISTRY.proportion_elements_with_a_description, name="evaluation__proportion_elements_with_a_description", curie=LINKML_REGISTRY.curie('proportion_elements_with_a_description'), 361 | model_uri=LINKML_REGISTRY.evaluation__proportion_elements_with_a_description, domain=None, range=Optional[float]) 362 | 363 | slots.evaluation__proportion_elements_mapped = Slot(uri=LINKML_REGISTRY.proportion_elements_mapped, name="evaluation__proportion_elements_mapped", curie=LINKML_REGISTRY.curie('proportion_elements_mapped'), 364 | model_uri=LINKML_REGISTRY.evaluation__proportion_elements_mapped, domain=None, range=Optional[float]) 365 | 366 | slots.evaluation__errors = Slot(uri=LINKML_REGISTRY.errors, name="evaluation__errors", curie=LINKML_REGISTRY.curie('errors'), 367 | model_uri=LINKML_REGISTRY.evaluation__errors, domain=None, range=Optional[Union[str, List[str]]]) -------------------------------------------------------------------------------- /src/linkml_registry/registry_db_mapping.py: -------------------------------------------------------------------------------- 1 | 2 | from dataclasses import dataclass 3 | from dataclasses import field 4 | from typing import List 5 | 6 | from sqlalchemy import Column 7 | from sqlalchemy import ForeignKey 8 | from sqlalchemy import Integer 9 | from sqlalchemy import MetaData 10 | from sqlalchemy import String 11 | from sqlalchemy import Table 12 | from sqlalchemy import Text 13 | from sqlalchemy import Integer 14 | from sqlalchemy.orm import registry 15 | from sqlalchemy.orm import relationship 16 | 17 | mapper_registry = registry() 18 | metadata = MetaData() 19 | 20 | from linkml_registry import * 21 | 22 | 23 | tbl_schema_metadata = Table('schema_metadata', metadata, 24 | Column('name', Text, primary_key=True), 25 | Column('title', Text), 26 | Column('description', Text), 27 | Column('homepage', Text), 28 | Column('schema_url', Text), 29 | Column('github_repo', Text), 30 | Column('schema_relative_path', Text), 31 | Column('license', Text), 32 | Column('score', Text), 33 | Column('class_count', Text), 34 | Column('slot_count', Text), 35 | Column('enum_count', Text), 36 | Column('type_count', Text), 37 | Column('github_stars', Text), 38 | Column('proportion_elements_with_a_description', Text), 39 | Column('proportion_elements_mapped', Text), 40 | Column('schema_registry_name', Text, ForeignKey('schema_registry.name')), 41 | ) 42 | tbl_schema_registry = Table('schema_registry', metadata, 43 | Column('name', Text, primary_key=True), 44 | Column('homepage', Text), 45 | Column('license', Text), 46 | Column('title', Text), 47 | Column('description', Text), 48 | ) 49 | tbl_schema_metadata_domain = Table('schema_metadata_domain', metadata, 50 | Column('backref_id', Text, ForeignKey('schema_metadata.name'), primary_key=True), 51 | Column('domain', Text, primary_key=True), 52 | ) 53 | tbl_schema_metadata_topics = Table('schema_metadata_topics', metadata, 54 | Column('backref_id', Text, ForeignKey('schema_metadata.name'), primary_key=True), 55 | Column('topics', Text, primary_key=True), 56 | ) 57 | tbl_schema_metadata_errors = Table('schema_metadata_errors', metadata, 58 | Column('backref_id', Text, ForeignKey('schema_metadata.name'), primary_key=True), 59 | Column('errors', Text, primary_key=True), 60 | ) 61 | tbl_schema_registry_domain = Table('schema_registry_domain', metadata, 62 | Column('backref_id', Text, ForeignKey('schema_registry.name'), primary_key=True), 63 | Column('domain', Text, primary_key=True), 64 | ) 65 | tbl_schema_registry_topics = Table('schema_registry_topics', metadata, 66 | Column('backref_id', Text, ForeignKey('schema_registry.name'), primary_key=True), 67 | Column('topics', Text, primary_key=True), 68 | ) 69 | mapper_registry.map_imperatively(SchemaMetadata, tbl_schema_metadata, properties={ 70 | }) 71 | mapper_registry.map_imperatively(SchemaRegistry, tbl_schema_registry, properties={ 72 | 73 | 'entries': 74 | relationship(schema metadata, 75 | foreign_keys=tbl_schema_metadata.columns["schema_registry_name"], 76 | backref='SchemaRegistry'), 77 | 78 | }) 79 | -------------------------------------------------------------------------------- /src/linkml_registry/schema/registry.yaml: -------------------------------------------------------------------------------- 1 | id: https://w3id.org/linkml_registry 2 | name: linkml_registry 3 | title: Schema for LinkML Schema Registry 4 | description: |- 5 | Datamodel for LinkML Registry and evaluation framework 6 | 7 | imports: 8 | - linkml:types 9 | prefixes: 10 | linkml: https://w3id.org/linkml/ 11 | linkml_registry: https://w3id.org/linkml_registry 12 | skos: http://www.w3.org/2004/02/skos/core# 13 | OIO: http://www.geneontology.org/formats/oboInOwl# 14 | pav: http://purl.org/pav/ 15 | oslc: http://open-services.net/ns/core# 16 | schema: http://schema.org/ 17 | bibo: http://purl.org/ontology/bibo/ 18 | foaf: http://xmlns.com/foaf/0.1/ 19 | dcat: http://www.w3.org/ns/dcat# 20 | doap: http://usefulinc.com/ns/doap# 21 | 22 | default_prefix: linkml_registry 23 | types: 24 | https identifier: 25 | typeof: string 26 | classes: 27 | schema registry: 28 | slots: 29 | - name 30 | - homepage 31 | - entries 32 | - license 33 | - title 34 | - description 35 | - domain 36 | - topics 37 | schema metadata: 38 | mixins: 39 | - evaluation 40 | slots: 41 | - name 42 | - title 43 | - description 44 | - homepage 45 | - schema url 46 | - github repo 47 | - schema relative path 48 | - license 49 | - domain 50 | - topics 51 | slot_usage: {} 52 | evaluation: 53 | mixin: true 54 | attributes: 55 | score: 56 | class_count: 57 | is_a: count statistic 58 | slot_count: 59 | is_a: count statistic 60 | enum_count: 61 | is_a: count statistic 62 | type_count: 63 | is_a: count statistic 64 | github stars: 65 | is_a: count statistic 66 | proportion elements with a description: 67 | is_a: proportion statistic 68 | proportion elements mapped: 69 | is_a: proportion statistic 70 | errors: 71 | multivalued: true 72 | slots: 73 | name: 74 | range: string 75 | examples: 76 | - value: HOT-TermCI 77 | identifier: true 78 | slot_uri: rdfs:label 79 | base purl: 80 | range: uriorcurie 81 | schema purl: 82 | range: uriorcurie 83 | homepage: 84 | range: https identifier 85 | examples: 86 | - value: https://github.com/HOT-Ecosystem/TermCI-model 87 | slot_uri: foaf:homepage 88 | recommended: true 89 | schema url: 90 | range: https identifier 91 | examples: 92 | - value: https://w3id.org/biolink/ 93 | slot_uri: dcterms:source 94 | github repo: 95 | examples: 96 | - value: linkml/linkml-registry 97 | recommended: true 98 | issue tracker: 99 | slot_uri: doap:bug-database 100 | license: 101 | #range: license_enum 102 | recommended: true 103 | slot_uri: dcterms:license 104 | examples: 105 | - value: CC-0 106 | title: 107 | description: the official title of the schema 108 | slot_uri: dcterms:title 109 | recommended: true 110 | description: 111 | range: string 112 | slot_uri: skos:definition 113 | examples: 114 | - value: Genome Feature Format LinkML rendering 115 | recommended: true 116 | domain: 117 | range: string 118 | examples: 119 | - value: clinical 120 | slot_uri: dcterms:subject 121 | multivalued: true 122 | topics: 123 | range: string 124 | examples: 125 | - value: clinical 126 | slot_uri: dcterms:subject 127 | multivalued: true 128 | entries: 129 | range: schema metadata 130 | inlined: true 131 | multivalued: true 132 | slot_uri: dcterms:hasPart 133 | score: 134 | range: integer 135 | github stars: 136 | range: integer 137 | schema relative path: 138 | statistic: 139 | count statistic: 140 | range: integer 141 | proportion statistic: 142 | range: float 143 | enums: 144 | license_enum: 145 | permissible_values: 146 | CC-BY-v4: 147 | description: CC-BY 148 | meaning: http://creativecommons.org/licenses/by/4.0/ 149 | CC-0-v1: 150 | description: CC-0 151 | meaning: https://creativecommons.org/publicdomain/zero/1.0/ 152 | 153 | -------------------------------------------------------------------------------- /src/linkml_registry/sqlddl/registry.sql: -------------------------------------------------------------------------------- 1 | 2 | 3 | CREATE TABLE schema_registry ( 4 | name TEXT NOT NULL, 5 | homepage TEXT, 6 | license TEXT, 7 | title TEXT, 8 | description TEXT, 9 | PRIMARY KEY (name) 10 | ); 11 | 12 | CREATE TABLE schema_metadata ( 13 | name TEXT NOT NULL, 14 | title TEXT, 15 | description TEXT, 16 | homepage TEXT, 17 | schema_url TEXT, 18 | github_repo TEXT, 19 | schema_relative_path TEXT, 20 | license TEXT, 21 | score TEXT, 22 | class_count INTEGER, 23 | slot_count INTEGER, 24 | enum_count INTEGER, 25 | type_count INTEGER, 26 | github_stars INTEGER, 27 | proportion_elements_with_a_description FLOAT, 28 | proportion_elements_mapped FLOAT, 29 | schema_registry_name TEXT, 30 | PRIMARY KEY (name), 31 | FOREIGN KEY(schema_registry_name) REFERENCES schema_registry (name) 32 | ); 33 | 34 | CREATE TABLE schema_registry_domain ( 35 | backref_id TEXT, 36 | domain TEXT, 37 | PRIMARY KEY (backref_id, domain), 38 | FOREIGN KEY(backref_id) REFERENCES schema_registry (name) 39 | ); 40 | 41 | CREATE TABLE schema_registry_topics ( 42 | backref_id TEXT, 43 | topics TEXT, 44 | PRIMARY KEY (backref_id, topics), 45 | FOREIGN KEY(backref_id) REFERENCES schema_registry (name) 46 | ); 47 | 48 | CREATE TABLE schema_metadata_domain ( 49 | backref_id TEXT, 50 | domain TEXT, 51 | PRIMARY KEY (backref_id, domain), 52 | FOREIGN KEY(backref_id) REFERENCES schema_metadata (name) 53 | ); 54 | 55 | CREATE TABLE schema_metadata_topics ( 56 | backref_id TEXT, 57 | topics TEXT, 58 | PRIMARY KEY (backref_id, topics), 59 | FOREIGN KEY(backref_id) REFERENCES schema_metadata (name) 60 | ); 61 | 62 | CREATE TABLE schema_metadata_errors ( 63 | backref_id TEXT, 64 | errors TEXT, 65 | PRIMARY KEY (backref_id, errors), 66 | FOREIGN KEY(backref_id) REFERENCES schema_metadata (name) 67 | ); 68 | 69 | -------------------------------------------------------------------------------- /src/linkml_registry/utils.py: -------------------------------------------------------------------------------- 1 | """ 2 | convenience wrappers around linkml runtime, for doing basic conversion between objects 3 | and serialization formats. 4 | 5 | The top level class is a Registry object 6 | 7 | Some of this will become unnecessary in the future 8 | """ 9 | import yaml 10 | import click 11 | import logging 12 | import os 13 | import csv 14 | from linkml_registry.registry import SchemaMetadata, SchemaRegistry 15 | from typing import List 16 | 17 | 18 | THIS_DIR = os.path.abspath(os.path.dirname(__file__)) 19 | 20 | 21 | def from_csv(filename: str, sep=',', name='default') -> SchemaRegistry: 22 | """ 23 | Will be replaced by runtime csv method 24 | """ 25 | logging.info(f'Converting {filename}') 26 | registry = SchemaRegistry(name=name) 27 | with open(filename, newline='') as tsvfile: 28 | rr = csv.DictReader(tsvfile, delimiter=sep) 29 | for row in rr: 30 | m = SchemaMetadata(**dict(row)) 31 | registry.entries[m.name] = m 32 | return registry 33 | 34 | @click.command() 35 | @click.argument('files', nargs=-1) 36 | def cli(files: List[str]): 37 | for f in files: 38 | registry = from_csv(f) 39 | 40 | if __name__ == "__main__": 41 | cli() 42 | 43 | 44 | -------------------------------------------------------------------------------- /tests/inputs/test_models.yaml: -------------------------------------------------------------------------------- 1 | name: default 2 | entries: 3 | LinkML Model: 4 | homepage: https://linkml.github.io/linkml-model/docs/ 5 | schema_url: https://github.com/linkml/linkml-model/blob/main/model/schema/meta.yaml 6 | github_repo: linkml/linkml-model 7 | schema_relative_path: model/schema/meta.yaml 8 | license: CC-0 9 | title: LinkML metamodel 10 | domain: meta 11 | NMDC: 12 | homepage: https://microbiomedata.github.io/nmdc-schema/ 13 | github_repo: microbiomedata/nmdc-schema 14 | schema_relative_path: src/schema/nmdc.yaml 15 | license: CC-0 16 | title: National Microbiome Data Collaborative 17 | topics: 18 | - environmental microbiology 19 | - genomics 20 | - microbiome 21 | -------------------------------------------------------------------------------- /tests/outputs/README.md: -------------------------------------------------------------------------------- 1 | test outputs 2 | -------------------------------------------------------------------------------- /tests/test_imports.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from linkml_registry.registry import SchemaMetadata, SchemaRegistry 3 | 4 | class ConversionTestSuite(unittest.TestCase): 5 | 6 | def test_import(self): 7 | r = SchemaRegistry(name='test') 8 | -------------------------------------------------------------------------------- /tests/test_registry.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import unittest 3 | import os 4 | from linkml_registry.registry import SchemaMetadata, SchemaRegistry 5 | from linkml_registry.evaluate import evaluate 6 | from linkml_registry.utils import from_csv 7 | from linkml_registry.markdown_dumper import MarkdownTableDumper, MarkdownPageDumper 8 | from linkml_runtime.dumpers import json_dumper, yaml_dumper 9 | from linkml_runtime.loaders import yaml_loader 10 | 11 | cwd = os.path.abspath(os.path.dirname(__file__)) 12 | EXAMPLE_DIR = os.path.join(cwd, 'inputs') 13 | OUTPUT_DIR = os.path.join(cwd, 'outputs') 14 | MARKDOWN_TABLE_OUTPUT = os.path.join(OUTPUT_DIR, 'registry.table.md') 15 | MARKDOWN_OUTPUT = os.path.join(OUTPUT_DIR, 'registry.md') 16 | 17 | 18 | class ConversionTestSuite(unittest.TestCase): 19 | """ 20 | Reads examples from root /examples/ folder, converts them to json and rdf 21 | """ 22 | 23 | def test_convert(self): 24 | #registry = from_csv(f'{EXAMPLE_DIR}/models.csv') 25 | registry = yaml_loader.load(os.path.join(EXAMPLE_DIR, 'test_models.yaml'), SchemaRegistry) 26 | ofn = os.path.join(OUTPUT_DIR, "test.yaml") 27 | with open(ofn, "w") as stream: 28 | stream.write(yaml_dumper.dumps(registry)) 29 | evaluate(registry, use_github_api=False) 30 | print(f'R: {registry}') 31 | json = json_dumper.dumps(registry) 32 | ofn = os.path.join(OUTPUT_DIR, "test.json") 33 | with open(ofn, "w") as stream: 34 | stream.write(json) 35 | d = MarkdownTableDumper() 36 | d.dump(registry, to_file=MARKDOWN_TABLE_OUTPUT) 37 | d = MarkdownPageDumper() 38 | d.dump(registry, to_file=MARKDOWN_OUTPUT) 39 | #with open(os.path.join(OUTPUT_DIR, "test.jsonld"), "w") as stream: 40 | # stream.write(to_jsonld(session)) 41 | #G: Graph 42 | #G = to_rdf(session) 43 | #G.serialize(os.path.join(OUTPUT_DIR, "test.rdf"), format='turtle') 44 | 45 | -------------------------------------------------------------------------------- /utils/get-value.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # get the value of a key in the about.yaml file 3 | # https://stackoverflow.com/questions/1221833/pipe-output-and-capture-exit-status-in-bash 4 | grep "^$1:" about.yaml | sed "s/$1:[[:space:]]//" ; test "${PIPESTATUS[0]}" -eq 0 5 | --------------------------------------------------------------------------------