diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/linkml-registry.iml b/.idea/linkml-registry.iml index 8b8c395..333d7d3 100644 --- a/.idea/linkml-registry.iml +++ b/.idea/linkml-registry.iml @@ -1,12 +1,15 @@ - + + + + - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 0b6c724..93de2e1 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,28 +1,17 @@ - - - - - - - - - + + + + - - - - - - @@ -35,6 +24,5 @@ - \ No newline at end of file diff --git a/Makefile b/Makefile index ee5350c..af207fc 100644 --- a/Makefile +++ b/Makefile @@ -1,90 +1,191 @@ -# All artifacts of the build should be preserved +MAKEFLAGS += --warn-undefined-variables +SHELL := bash +.SHELLFLAGS := -eu -o pipefail -c +.DEFAULT_GOAL := help +.DELETE_ON_ERROR: +.SUFFIXES: .SECONDARY: -# ---------------------------------------- -# Model documentation and schema directory -# ---------------------------------------- -SRC_DIR = src -PKG_DIR = linkml_registry -SCHEMA_DIR = $(SRC_DIR)/schema -MODEL_DOCS_DIR = $(SRC_DIR)/docs -SOURCE_FILES := $(shell find $(SCHEMA_DIR) -name '*.yaml') -SRC = $(SCHEMA_DIR)/registry.yaml -SCHEMA_NAMES = $(patsubst $(SCHEMA_DIR)/%.yaml, %, $(SOURCE_FILES)) - -SCHEMA_NAME = registry -SCHEMA_SRC = $(SCHEMA_DIR)/$(SCHEMA_NAME).yaml -PKG_TGTS = python jsonld_context json_schema -TGTS = docs python $(PKG_TGTS) - -# Targets by PKG_TGT -PKG_T_GRAPHQL = $(PKG_DIR)/graphql -PKG_T_JSON = $(PKG_DIR)/json -PKG_T_JSONLD_CONTEXT = $(PKG_DIR)/jsonld -PKG_T_JSON_SCHEMA = $(PKG_DIR)/jsonschema -PKG_T_OWL = $(PKG_DIR)/owl -PKG_T_RDF = $(PKG_DIR)/rdf -PKG_T_SHEX = $(PKG_DIR)/shex -PKG_T_SQLDDL = $(PKG_DIR)/sqlddl -PKG_T_DOCS = $(MODEL_DOCS_DIR) -PKG_T_PYTHON = $(PKG_DIR) -PKG_T_MODEL = $(PKG_DIR)/model -PKG_T_SCHEMA = $(PKG_T_MODEL)/schema - -# Global generation options -GEN_OPTS = --log_level WARNING -ENV = export PIPENV_VENV_IN_PROJECT=true && export PIPENV_PIPFILE=make-venv/Pipfile && export PIPENV_IGNORE_VIRTUALENVS=1 -RUN = pipenv run - -# ---------------------------------------- -# TOP LEVEL TARGETS -# ---------------------------------------- -all: install gen -index: models.yaml all - -# --------------------------------------- -# We don't want to pollute the python environment with linkml tool specific packages. For this reason, -# we install an isolated instance of linkml in the pipenv-linkml directory -# --------------------------------------- -install: make-venv/env.lock - -make-venv/env.lock: - $(ENV) && pipenv install - touch make-venv/env.lock - -uninstall: - rm -f make-venv/env.lock - $(ENV) && pipenv --rm - -# --------------------------------------- -# Test runner -# ---------------------------------------- -test: - pipenv install --dev - pipenv run python -m unittest discover -p 'test_*.py' - -# --------------------------------------- -# GEN: run generator for each target -# --------------------------------------- -#gen: $(patsubst %,gen-%,$(TGTS)) - -gen: - $(RUN) gen-project -d . $(SRC) - -markdown: - $(RUN) gen-markdown -d target/docs/ -I index.md $(SRC) && \ - cp src/docs/*.md target/docs/ - -linkml_registry/registry.py: registry.py - cp $< $@ - - - -# test docs locally. -docserve: - $(RUN) mkdocs serve -gh-deploy: - $(RUN) mkdocs gh-deploy - -models.yaml src/docs/registry.md: src/data/models.yaml - pipenv run python -m linkml_registry.cli eval -i $< --use-github-api -m src/docs/registry.md -o models.yaml +RUN = poetry run +# get values from about.yaml file +SCHEMA_NAME = $(shell ${SHELL} ./utils/get-value.sh name) +SOURCE_SCHEMA_PATH = $(shell ${SHELL} ./utils/get-value.sh source_schema_path) +SOURCE_SCHEMA_DIR = $(dir $(SOURCE_SCHEMA_PATH)) +SRC = src +DEST = project +PYMODEL = $(SRC)/$(SCHEMA_NAME)/datamodel +DOCDIR = docs +EXAMPLEDIR = examples +SHEET_MODULE = personinfo_enums +SHEET_ID = $(shell ${SHELL} ./utils/get-value.sh google_sheet_id) +SHEET_TABS = $(shell ${SHELL} ./utils/get-value.sh google_sheet_tabs) +SHEET_MODULE_PATH = $(SOURCE_SCHEMA_DIR)/$(SHEET_MODULE).yaml + +# environment variables +include config.env + +GEN_PARGS = +ifdef LINKML_GENERATORS_PROJECT_ARGS +GEN_PARGS = ${LINKML_GENERATORS_PROJECT_ARGS} +endif + +GEN_DARGS = +ifdef LINKML_GENERATORS_MARKDOWN_ARGS +GEN_DARGS = ${LINKML_GENERATORS_MARKDOWN_ARGS} +endif + + +# basename of a YAML file in model/ +.PHONY: all clean + +# note: "help" MUST be the first target in the file, +# when the user types "make" they should get help info +help: status + @echo "" + @echo "make setup -- initial setup (run this first)" + @echo "make site -- makes site locally" + @echo "make install -- install dependencies" + @echo "make test -- runs tests" + @echo "make lint -- perform linting" + @echo "make testdoc -- builds docs and runs local test server" + @echo "make deploy -- deploys site" + @echo "make update -- updates linkml version" + @echo "make help -- show this help" + @echo "" + +status: check-config + @echo "Project: $(SCHEMA_NAME)" + @echo "Source: $(SOURCE_SCHEMA_PATH)" + +# generate products and add everything to github +setup: install gen-project gen-examples gendoc git-init-add + +# install any dependencies required for building +install: + git init + poetry install +.PHONY: install + +# --- +# Project Synchronization +# --- +# +# check we are up to date +check: cruft-check +cruft-check: + cruft check +cruft-diff: + cruft diff + +update: update-template update-linkml +update-template: + cruft update + +# todo: consider pinning to template +update-linkml: + poetry add -D linkml@latest + +# EXPERIMENTAL +create-data-harmonizer: + npm init data-harmonizer $(SOURCE_SCHEMA_PATH) + +all: site +site: gen-project gendoc +%.yaml: gen-project +deploy: all mkd-gh-deploy + +compile-sheets: + $(RUN) sheets2linkml --gsheet-id $(SHEET_ID) $(SHEET_TABS) > $(SHEET_MODULE_PATH).tmp && mv $(SHEET_MODULE_PATH).tmp $(SHEET_MODULE_PATH) + +# In future this will be done by conversion +gen-examples: + cp src/data/examples/* $(EXAMPLEDIR) + +# generates all project files + +gen-project: $(PYMODEL) + $(RUN) gen-project ${GEN_PARGS} -d $(DEST) $(SOURCE_SCHEMA_PATH) && mv $(DEST)/*.py $(PYMODEL) + + +test: test-schema test-python test-examples + +test-schema: + $(RUN) gen-project ${GEN_PARGS} -d tmp $(SOURCE_SCHEMA_PATH) + +test-python: + $(RUN) python -m unittest discover + +lint: + $(RUN) linkml-lint $(SOURCE_SCHEMA_PATH) + +check-config: + @(grep my-datamodel about.yaml > /dev/null && printf "\n**Project not configured**:\n\n - Remember to edit 'about.yaml'\n\n" || exit 0) + +convert-examples-to-%: + $(patsubst %, $(RUN) linkml-convert % -s $(SOURCE_SCHEMA_PATH) -C Person, $(shell ${SHELL} find src/data/examples -name "*.yaml")) + +examples/%.yaml: src/data/examples/%.yaml + $(RUN) linkml-convert -s $(SOURCE_SCHEMA_PATH) -C Person $< -o $@ +examples/%.json: src/data/examples/%.yaml + $(RUN) linkml-convert -s $(SOURCE_SCHEMA_PATH) -C Person $< -o $@ +examples/%.ttl: src/data/examples/%.yaml + $(RUN) linkml-convert -P EXAMPLE=http://example.org/ -s $(SOURCE_SCHEMA_PATH) -C Person $< -o $@ + +test-examples: examples/output + +examples/output: src/linkml_common/schema/linkml_common.yaml + mkdir -p $@ + $(RUN) linkml-run-examples \ + --output-formats json \ + --output-formats yaml \ + --counter-example-input-directory src/data/examples/invalid \ + --input-directory src/data/examples/valid \ + --output-directory $@ \ + --schema $< > $@/README.md +.PHONY: examples/output + +# Test documentation locally +serve: mkd-serve + +# Python datamodel +$(PYMODEL): + mkdir -p $@ + + +$(DOCDIR): + mkdir -p $@ + +gendoc: $(DOCDIR) + cp $(SRC)/docs/*md $(DOCDIR) ; \ + $(RUN) gen-doc ${GEN_DARGS} -d $(DOCDIR) $(SOURCE_SCHEMA_PATH) + +testdoc: gendoc serve + +MKDOCS = $(RUN) mkdocs +mkd-%: + $(MKDOCS) $* + +PROJECT_FOLDERS = sqlschema shex shacl protobuf prefixmap owl jsonschema jsonld graphql excel +git-init-add: git-init git-add git-commit git-status +git-init: + git init +git-add: .cruft.json + 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 + git add $(patsubst %, project/%, $(PROJECT_FOLDERS)) +git-commit: + git commit -m 'chore: initial commit' -a +git-status: + git status + +# only necessary if setting up via cookiecutter +.cruft.json: + echo "creating a stub for .cruft.json. IMPORTANT: setup via cruft not cookiecutter recommended!" ; \ + touch $@ + +clean: + rm -rf $(DEST) + rm -rf tmp + rm -fr docs/* + rm -fr $(PYMODEL)/* + +include project.Makefile diff --git a/README.md b/README.md index c523a72..9d12b62 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Registry Schema: Make a Pull Request on: - * [src/data/models.yaml](src/data/models.yaml) + * [src/linkml_registry/data/models.yaml](src/linkml_registry/data/models.yaml) 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) diff --git a/graphql/README.md b/graphql/README.md deleted file mode 100644 index 7d21cb2..0000000 --- a/graphql/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Python - -Do not edit the files in here - these are autogenerated from the schema. See the Makefile for details. diff --git a/graphql/registry.graphql b/graphql/registry.graphql deleted file mode 100644 index 0cfa55f..0000000 --- a/graphql/registry.graphql +++ /dev/null @@ -1,48 +0,0 @@ -interface Evaluation - { - score: String - classCount: Integer - slotCount: Integer - enumCount: Integer - typeCount: Integer - githubStars: Integer - proportionElementsWithADescription: Float - proportionElementsMapped: Float - errors: [String] - } - -type SchemaMetadata implements Evaluation - { - name: String! - title: String - description: String - homepage: HttpsIdentifier - schemaUrl: HttpsIdentifier - githubRepo: String - schemaRelativePath: String - license: String - domain: [String] - topics: [String] - score: String - classCount: Integer - slotCount: Integer - enumCount: Integer - typeCount: Integer - githubStars: Integer - proportionElementsWithADescription: Float - proportionElementsMapped: Float - errors: [String] - } - -type SchemaRegistry - { - name: String! - homepage: HttpsIdentifier - entries: [SchemaMetadata] - license: String - title: String - description: String - domain: [String] - topics: [String] - } - diff --git a/jsonschema/README.md b/jsonschema/README.md deleted file mode 100644 index 22bf6fa..0000000 --- a/jsonschema/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# JSON-Schema - -[JSON Schema](https://json-schema.org/) is a schema language for JSON documents - -Do not edit the files in here - these are autogenerated from the schema. See the Makefile for details. diff --git a/jsonschema/registry.schema.json b/jsonschema/registry.schema.json deleted file mode 100644 index ece72e8..0000000 --- a/jsonschema/registry.schema.json +++ /dev/null @@ -1,218 +0,0 @@ -{ - "$defs": { - "LicenseEnum": { - "description": "", - "enum": [ - "CC-BY-v4", - "CC-0-v1" - ], - "title": "LicenseEnum", - "type": "string" - }, - "SchemaMetadata": { - "additionalProperties": false, - "description": "", - "properties": { - "class_count": { - "type": "integer" - }, - "description": { - "type": "string" - }, - "domain": { - "items": { - "type": "string" - }, - "type": "array" - }, - "enum_count": { - "type": "integer" - }, - "errors": { - "items": { - "type": "string" - }, - "type": "array" - }, - "github_repo": { - "type": "string" - }, - "github_stars": { - "type": "integer" - }, - "homepage": { - "type": "string" - }, - "license": { - "type": "string" - }, - "name": { - "type": "string" - }, - "proportion_elements_mapped": { - "type": "number" - }, - "proportion_elements_with_a_description": { - "type": "number" - }, - "schema_relative_path": { - "type": "string" - }, - "schema_url": { - "type": "string" - }, - "score": { - "type": "string" - }, - "slot_count": { - "type": "integer" - }, - "title": { - "description": "the official title of the schema", - "type": "string" - }, - "topics": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type_count": { - "type": "integer" - } - }, - "required": [ - "name" - ], - "title": "SchemaMetadata", - "type": "object" - }, - "SchemaMetadata__identifier_optional": { - "additionalProperties": false, - "description": "", - "properties": { - "class_count": { - "type": "integer" - }, - "description": { - "type": "string" - }, - "domain": { - "items": { - "type": "string" - }, - "type": "array" - }, - "enum_count": { - "type": "integer" - }, - "errors": { - "items": { - "type": "string" - }, - "type": "array" - }, - "github_repo": { - "type": "string" - }, - "github_stars": { - "type": "integer" - }, - "homepage": { - "type": "string" - }, - "license": { - "type": "string" - }, - "name": { - "type": "string" - }, - "proportion_elements_mapped": { - "type": "number" - }, - "proportion_elements_with_a_description": { - "type": "number" - }, - "schema_relative_path": { - "type": "string" - }, - "schema_url": { - "type": "string" - }, - "score": { - "type": "string" - }, - "slot_count": { - "type": "integer" - }, - "title": { - "description": "the official title of the schema", - "type": "string" - }, - "topics": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type_count": { - "type": "integer" - } - }, - "required": [], - "title": "SchemaMetadata", - "type": "object" - }, - "SchemaRegistry": { - "additionalProperties": false, - "description": "", - "properties": { - "description": { - "type": "string" - }, - "domain": { - "items": { - "type": "string" - }, - "type": "array" - }, - "entries": { - "additionalProperties": { - "$ref": "#/$defs/SchemaMetadata__identifier_optional" - } - }, - "homepage": { - "type": "string" - }, - "license": { - "type": "string" - }, - "name": { - "type": "string" - }, - "title": { - "description": "the official title of the schema", - "type": "string" - }, - "topics": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "title": "SchemaRegistry", - "type": "object" - } - }, - "$id": "https://w3id.org/linkml_registry", - "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": true, - "properties": {}, - "required": [], - "title": "linkml_registry", - "type": "object" -} diff --git a/linkml_registry/cli.py b/linkml_registry/cli.py deleted file mode 100644 index a6998d6..0000000 --- a/linkml_registry/cli.py +++ /dev/null @@ -1,83 +0,0 @@ -import click -import logging -from linkml_registry.registry import SchemaMetadata, SchemaRegistry -from linkml_registry.evaluate import evaluate -from linkml_registry.markdown_dumper import MarkdownTableDumper, MarkdownPageDumper -from linkml_runtime.dumpers import json_dumper, yaml_dumper -from linkml_runtime.loaders import yaml_loader - - -# Click input options common across commands -input_option = click.option('-i', '--input', required=True, type=click.Path(), - help='Input file, e.g. a SSSOM tsv file.') -output_directory_option = click.option('-d', '--output-directory', type=click.Path(), help='Output directory path.') -output_option = click.option('-o', '--output', help='Output file, e.g. a YAML file.') - -@click.group() -@click.option('-v', '--verbose', count=True) -@click.option('-q', '--quiet') -def main(verbose: int, quiet: bool): - """Main - - Args: - - verbose (int): Verbose. - quiet (bool): Quiet. - - Returns: - - None. - - """ - if verbose >= 2: - logging.basicConfig(level=logging.DEBUG) - elif verbose == 1: - logging.basicConfig(level=logging.INFO) - else: - logging.basicConfig(level=logging.WARNING) - if quiet: - logging.basicConfig(level=logging.ERROR) - - -@main.command() -@input_option -@output_option -@click.option('--use-github-api/--no-use-github-api', default=False, help='Use the github API to enhance results') -@click.option('-m', '--markdown-output', - default=None, - help='path to markdown output') -@click.option('-I', '--inclusion-list', - multiple=True, - help='Only include these names') -@click.option('-w', '--workdir', - default='tmp', - help='working dir for checked out repos') -def eval(input: str, output: str, inclusion_list = None, markdown_output: str = None, workdir: str = 'tmp', use_github_api: bool = False): - """Evaluate - - Example: - TODO - - Args: - - input (str): The path to the input models yaml file - output (str): The path to the output file. - - Returns: - - None. - - """ - registry = yaml_loader.load(input, SchemaRegistry) - print(f'INCLUDES={list(inclusion_list)}') - evaluate(registry, use_github_api=use_github_api, workdir=workdir, include=list(inclusion_list)) - if markdown_output: - d = MarkdownPageDumper() - d.dump(registry, to_file=markdown_output) - if output: - with open(output, "w") as stream: - stream.write(yaml_dumper.dumps(registry)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/linkml_registry/evaluate.py b/linkml_registry/evaluate.py deleted file mode 100644 index e989a6f..0000000 --- a/linkml_registry/evaluate.py +++ /dev/null @@ -1,132 +0,0 @@ -from typing import List - -from linkml_runtime import SchemaView -from linkml_runtime.linkml_model.meta import SchemaDefinition, Element, ClassDefinition, \ - SlotDefinition, TypeDefinition, EnumDefinition -from linkml_runtime.loaders import yaml_loader -from linkml.utils.schemaloader import load_raw_schema -from linkml.generators.yamlgen import YAMLGenerator -from .github_utils import get_stars, clone_repo -from .registry import SchemaMetadata, SchemaRegistry -import logging - - -def evaluate(sr: SchemaRegistry, use_github_api=True, workdir: str = None, include: List[str] = None): - n = 0 - for s in sr.entries.values(): - skip = False - if include: - if s.name not in include: - skip = True - if skip: - print(f'SKIPPING: {s.name}') - else: - evaluate_schema_metadata(s, use_github_api=use_github_api, workdir=workdir) - n += 1 - if n == 0: - logging.error('No schemas evaluated') - if include: - logging.error(f'Is include set correctly? Current: {include}') - logging.info(f'Evaluated {n} schemas') - -def evaluate_schema_metadata(sm: SchemaMetadata, use_github_api=True, workdir=None): - if use_github_api: - stars = get_stars(sm) - sm.github_stars = stars - if sm.schema_relative_path: - try: - dir = clone_repo(sm, workdir=workdir) - print(f'Cloned to: {dir}') - path = f'{dir}/{sm.schema_relative_path}' - schema = load_schema(path) - evaluate_schema(schema, sm) - except Exception as e: - logging.error(f'Exception: {e}') - sm.errors.append(f'Error with obtaining schema for {sm.name}: {e}') - raise e - -def load_schema(path: str) -> SchemaDefinition: - #schema = load_raw_schema(path, merge_modules=True) - sv = SchemaView(path) - #gen = YAMLGenerator(path, mergeimports=True) - #yaml = gen.serialize() - #print(f'YAML={yaml}') - schema = get_merged_schema(sv) - print(f'Parsed schema: {schema.name} type: {type(schema)} classes: {type(schema.classes)} = {len(schema.classes)}') -# filter_schema(schema) - return schema - -def get_merged_schema(sv: SchemaView) -> SchemaDefinition: - schema = sv.schema - to_merge = [s2 for s2 in sv.all_schema(True) if s2 != schema] - for s2 in to_merge: - sv.merge_schema(s2) - return sv.schema - -def filter_schema(schema: SchemaDefinition): - """ - trim internal imports from schema - """ - # TODO: ask Harold how to do this - #nu_classes = [x for x in schema.classes.values() if not exclude_element(x)] - #schema.classes = nu_classes - #schema.classes = [x for x in schema.classes.values() if not exclude_element(x)] - #schema.slots = [x for x in schema.slots.values() if not exclude_element(x)] - #schema.types = [x for x in schema.types.values() if not exclude_element(x)] - #schema.enums = [x for x in schema.enums.values() if not exclude_element(x)] - None - -def exclude_element(x: Element) -> bool: - """ - true if element should be excluded. - - Currently the only criteria is that this is an import of a 'builtin' linkml type - """ - if x.from_schema and x.from_schema.startswith('https://w3id.org/linkml/'): - return True - else: - return False - -def evaluate_schema(schema: SchemaDefinition, sm: SchemaMetadata): - name = schema.name - print(f'Loaded schema: {name}') - if schema.license: - sm.license = schema.license - if schema.description and schema.description != '': - sm.description = schema.description - if schema.title and schema.title != '': - sm.title = schema.title - if sm.title is None or sm.title == '': - sm.title = sm.name - sm.class_count = len(schema.classes.values()) - print(f'CC: {sm.class_count}') - sm.slot_count = len(schema.slots.values()) - sm.enum_count = len(schema.enums.values()) - sm.type_count = len(schema.types.values()) - elements = list(schema.classes.values()) + list(schema.slots.values()) + \ - list(schema.types.values()) + list(schema.enums.values()) - elements_with_descriptions = [x for x in elements if x.description is not None and x.description != ''] - sm.proportion_elements_with_a_description = len(elements_with_descriptions) / len(elements) - elements_mapped = [x for x in elements if _is_mapped(x)] - sm.proportion_elements_mapped = len(elements_mapped) / len(elements) - -def _is_mapped(x: Element) -> bool: - if (x.exact_mappings and len(x.exact_mappings) > 0): - return True - # todo: check if class_uri is distinct from - if isinstance(x, ClassDefinition): - if x.class_uri: - return True - if isinstance(x, SlotDefinition): - if x.slot_uri: - return True - if isinstance(x, TypeDefinition): - return True - if isinstance(x, EnumDefinition): - if x.permissible_values and len(x.permissible_values) > 0: - if len([v for v in x.permissible_values.values() if not v.meaning]) > 0: - return False - else: - return True - return False - diff --git a/linkml_registry/github_utils.py b/linkml_registry/github_utils.py deleted file mode 100644 index d943f90..0000000 --- a/linkml_registry/github_utils.py +++ /dev/null @@ -1,74 +0,0 @@ -from .registry import SchemaRegistry, SchemaMetadata -from typing import Dict, List, Optional -from github import Github -import logging -import re -import subprocess -from pathlib import Path -import os - - -g = Github() - -def get_repo(s: SchemaMetadata): - repo_name = get_repo_name(s) - if repo_name: - print(f'Repo = {repo_name}') - try: - return g.get_repo(repo_name) - except: - logging.error(f'Error accessing {repo_name}') - return None - -def get_repo_name(s: SchemaMetadata) -> str: - if s.github_repo is not None: - return s.github_repo - if s.schema_url is not None: - m = re.search('github.com/([\\w-]+/[\\w-]+)/', s.schema_url) - if m: - return m.group(1) - -def get_stars(s: SchemaMetadata) -> Optional[int]: - repo = get_repo(s) - print(f'Repo for {s.name} = {repo}') - if repo: - try: - return repo.stargazers_count - except: - logging.error(f'Error accessing {repo}') - -def get_repo_clone_url(s: SchemaMetadata): - repo = get_repo_name(s) - return f'https://github.com/{repo}.git' - -def clone_repo(s: SchemaMetadata, workdir=None, replace=False) -> str: - if workdir is None: - workdir = 'tmp' - [owner, repo] = get_repo_name(s).split('/') - path = f'{workdir}/{repo}' - print(f'{s.name} Path={path}') - if os.path.exists(path): - if replace: - os.remove(path) - else: - return path - url = get_repo_clone_url(s) - Path(workdir).mkdir(parents=True, exist_ok=True) - runcmds([f'cd {workdir}', - f'git clone {url}']) - return path - - - -def runcmds(cmds: List[str]): - return runcmd(" && ".join(cmds)) - -def runcmd(cmd): - logging.info("RUNNING: {}".format(cmd)) - p = subprocess.Popen([cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, universal_newlines=True) - (out, err) = p.communicate() - logging.info('OUT: {}'.format(out)) - if err: - logging.error(err) - if p.returncode != 0: - raise Exception('Failed: {}'.format(cmd)) \ No newline at end of file diff --git a/linkml_registry/jsonld/registry.context.jsonld b/linkml_registry/jsonld/registry.context.jsonld deleted file mode 100644 index d207d1b..0000000 --- a/linkml_registry/jsonld/registry.context.jsonld +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_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 ", - "@context": { - "OIO": "http://www.geneontology.org/formats/oboInOwl#", - "bibo": "http://purl.org/ontology/bibo/", - "dcat": "http://www.w3.org/ns/dcat#", - "dcterms": "http://example.org/UNKNOWN/dcterms/", - "doap": "http://usefulinc.com/ns/doap#", - "foaf": "http://xmlns.com/foaf/0.1/", - "linkml": "https://w3id.org/linkml/", - "linkml_registry": { - "@id": "https://w3id.org/linkml_registry", - "@prefix": true - }, - "oslc": "http://open-services.net/ns/core#", - "pav": "http://purl.org/pav/", - "schema": "http://schema.org/", - "skos": "http://www.w3.org/2004/02/skos/core#", - "@vocab": "https://w3id.org/linkml_registry", - "base_purl": { - "@type": "@id" - }, - "count_statistic": { - "@type": "xsd:integer" - }, - "description": { - "@id": "skos:definition" - }, - "domain": { - "@id": "dcterms:subject" - }, - "entries": { - "@type": "@id", - "@id": "dcterms:hasPart" - }, - "class_count": { - "@type": "xsd:integer" - }, - "enum_count": { - "@type": "xsd:integer" - }, - "github_stars": { - "@type": "xsd:integer" - }, - "proportion_elements_mapped": { - "@type": "xsd:float" - }, - "proportion_elements_with_a_description": { - "@type": "xsd:float" - }, - "slot_count": { - "@type": "xsd:integer" - }, - "type_count": { - "@type": "xsd:integer" - }, - "homepage": { - "@id": "foaf:homepage" - }, - "issue_tracker": { - "@id": "doap:bug-database" - }, - "license": { - "@id": "dcterms:license" - }, - "name": "@id", - "proportion_statistic": { - "@type": "xsd:float" - }, - "schema_purl": { - "@type": "@id" - }, - "schema_url": { - "@id": "dcterms:source" - }, - "score": { - "@type": "xsd:integer" - }, - "title": { - "@id": "dcterms:title" - }, - "topics": { - "@id": "dcterms:subject" - } - } -} - diff --git a/linkml_registry/jsonld/registry.model.context.jsonld b/linkml_registry/jsonld/registry.model.context.jsonld deleted file mode 100644 index d207d1b..0000000 --- a/linkml_registry/jsonld/registry.model.context.jsonld +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_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 ", - "@context": { - "OIO": "http://www.geneontology.org/formats/oboInOwl#", - "bibo": "http://purl.org/ontology/bibo/", - "dcat": "http://www.w3.org/ns/dcat#", - "dcterms": "http://example.org/UNKNOWN/dcterms/", - "doap": "http://usefulinc.com/ns/doap#", - "foaf": "http://xmlns.com/foaf/0.1/", - "linkml": "https://w3id.org/linkml/", - "linkml_registry": { - "@id": "https://w3id.org/linkml_registry", - "@prefix": true - }, - "oslc": "http://open-services.net/ns/core#", - "pav": "http://purl.org/pav/", - "schema": "http://schema.org/", - "skos": "http://www.w3.org/2004/02/skos/core#", - "@vocab": "https://w3id.org/linkml_registry", - "base_purl": { - "@type": "@id" - }, - "count_statistic": { - "@type": "xsd:integer" - }, - "description": { - "@id": "skos:definition" - }, - "domain": { - "@id": "dcterms:subject" - }, - "entries": { - "@type": "@id", - "@id": "dcterms:hasPart" - }, - "class_count": { - "@type": "xsd:integer" - }, - "enum_count": { - "@type": "xsd:integer" - }, - "github_stars": { - "@type": "xsd:integer" - }, - "proportion_elements_mapped": { - "@type": "xsd:float" - }, - "proportion_elements_with_a_description": { - "@type": "xsd:float" - }, - "slot_count": { - "@type": "xsd:integer" - }, - "type_count": { - "@type": "xsd:integer" - }, - "homepage": { - "@id": "foaf:homepage" - }, - "issue_tracker": { - "@id": "doap:bug-database" - }, - "license": { - "@id": "dcterms:license" - }, - "name": "@id", - "proportion_statistic": { - "@type": "xsd:float" - }, - "schema_purl": { - "@type": "@id" - }, - "schema_url": { - "@id": "dcterms:source" - }, - "score": { - "@type": "xsd:integer" - }, - "title": { - "@id": "dcterms:title" - }, - "topics": { - "@id": "dcterms:subject" - } - } -} - diff --git a/linkml_registry/jsonschema/registry.schema.json b/linkml_registry/jsonschema/registry.schema.json deleted file mode 100644 index 9e6c5e9..0000000 --- a/linkml_registry/jsonschema/registry.schema.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "$id": "https://w3id.org/linkml_registry", - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "SchemaMetadata": { - "additionalProperties": false, - "description": "", - "properties": { - "class_count": { - "type": "integer" - }, - "description": { - "type": "string" - }, - "domain": { - "items": { - "type": "string" - }, - "type": "array" - }, - "enum_count": { - "type": "integer" - }, - "errors": { - "items": { - "type": "string" - }, - "type": "array" - }, - "github_repo": { - "type": "string" - }, - "github_stars": { - "type": "integer" - }, - "homepage": { - "type": "string" - }, - "license": { - "type": "string" - }, - "name": { - "type": "string" - }, - "proportion_elements_mapped": { - "type": "number" - }, - "proportion_elements_with_a_description": { - "type": "number" - }, - "schema_relative_path": { - "type": "string" - }, - "schema_url": { - "type": "string" - }, - "score": { - "type": "string" - }, - "slot_count": { - "type": "integer" - }, - "title": { - "description": "the official title of the schema", - "type": "string" - }, - "topics": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type_count": { - "type": "integer" - } - }, - "required": [ - "name" - ], - "title": "SchemaMetadata", - "type": "object" - }, - "SchemaRegistry": { - "additionalProperties": false, - "description": "", - "properties": { - "description": { - "type": "string" - }, - "domain": { - "items": { - "type": "string" - }, - "type": "array" - }, - "entries": { - "items": { - "$ref": "#/definitions/SchemaMetadata" - }, - "type": "array" - }, - "homepage": { - "type": "string" - }, - "license": { - "type": "string" - }, - "name": { - "type": "string" - }, - "title": { - "description": "the official title of the schema", - "type": "string" - }, - "topics": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "name" - ], - "title": "SchemaRegistry", - "type": "object" - } - }, - "properties": {}, - "title": "linkml_registry", - "type": "object" -} - diff --git a/linkml_registry/markdown_dumper.py b/linkml_registry/markdown_dumper.py deleted file mode 100644 index 8b86356..0000000 --- a/linkml_registry/markdown_dumper.py +++ /dev/null @@ -1,100 +0,0 @@ -from .registry import SchemaRegistry, SchemaMetadata -from mdutils.tools.Table import Table -from mdutils import MdUtils -import io -from io import StringIO -from contextlib import redirect_stdout - -import json -from typing import Dict, List -from jsonasobj2 import items, JsonObj, as_dict -from dataclasses import astuple, dataclass, fields - -from linkml_runtime.dumpers.dumper_root import Dumper - - -class MarkdownDumper(Dumper): - def dump(self, sr: SchemaRegistry, to_file: str) -> None: - with open(to_file, 'w') as stream: - stream.write(self.dumps(sr)) - - def _get_header_dict(self, pycls) -> Dict: - h = {} - for f in fields(pycls): - # TODO: use metadata - h[f.name] = f.name - return h - - def _autoformat(self, text) -> str: - if isinstance(text, list): - return '; '.join([self._autoformat(x) for x in text]) - if isinstance(text, float): - text = int(text * 100) / 100 - text = str(text) - if text.startswith('http'): - return self._link(text) - else: - return text - def _link(self, url, text: str=None) -> str: - if text is None: - text = url - return f'[{text}]({url})' - -class MarkdownTableDumper(MarkdownDumper): - - def dumps(self, sr: SchemaRegistry) -> None: - h = self._get_header_dict(SchemaMetadata) - text_list = list(h.values()) - rows = 1 - s: SchemaMetadata - for s in sr.entries.values(): - print(f'S={s}') - row = self._create_row(s, h) - cols = len(row) - text_list += [str(x) for x in row] - rows += 1 - table = Table().create_table(columns=cols, rows=rows, text=text_list, text_align='center') - return str(table) - - def _create_row(self, s: SchemaMetadata, h: dict) -> List[str]: - row = [] - for k in h.keys(): - v = s.__getattr__(k) - if v is None: - v = '' - row.append(v) - return row - -class MarkdownPageDumper(MarkdownDumper): - - def dumps(self, sr: SchemaRegistry) -> None: - output = StringIO() - with redirect_stdout(output): - print(f'# LinkML Registry Entries\n') - h = self._get_header_dict(SchemaMetadata) - s: SchemaMetadata - for s in sr.entries.values(): - print(f'## {s.title}\n') - print(f'{s.description}\n') - text_list = ['key', 'value'] - rows = 1 - for k in h.keys(): - if k == 'description': - continue - v = s.__getattr__(k) - if v is not None and v != '' and v != []: - text_list += [k, self._autoformat(v)] - rows += 1 - table = Table().create_table(columns=2, rows=rows, text=text_list, text_align='center') - print(str(table)) - return output.getvalue() - - def _get_header_dict(self, pycls) -> Dict: - h = {} - for f in fields(pycls): - # TODO: use metadata - h[f.name] = f.name - return h - - - diff --git a/linkml_registry/registry.py b/linkml_registry/registry.py deleted file mode 100644 index d96f755..0000000 --- a/linkml_registry/registry.py +++ /dev/null @@ -1,367 +0,0 @@ -# Auto generated from registry.yaml by pythongen.py version: 0.9.0 -# Generation date: 2022-01-14T16:33:29 -# Schema: linkml_registry -# -# id: https://w3id.org/linkml_registry -# description: Datamodel for LinkML Registry and evaluation framework -# license: https://creativecommons.org/publicdomain/zero/1.0/ - -import dataclasses -import sys -import re -from jsonasobj2 import JsonObj, as_dict -from typing import Optional, List, Union, Dict, ClassVar, Any -from dataclasses import dataclass -from linkml_runtime.linkml_model.meta import EnumDefinition, PermissibleValue, PvFormulaOptions - -from linkml_runtime.utils.slot import Slot -from linkml_runtime.utils.metamodelcore import empty_list, empty_dict, bnode -from linkml_runtime.utils.yamlutils import YAMLRoot, extended_str, extended_float, extended_int -from linkml_runtime.utils.dataclass_extensions_376 import dataclasses_init_fn_with_kwargs -from linkml_runtime.utils.formatutils import camelcase, underscore, sfx -from linkml_runtime.utils.enumerations import EnumDefinitionImpl -from rdflib import Namespace, URIRef -from linkml_runtime.utils.curienamespace import CurieNamespace -from linkml_runtime.linkml_model.types import Float, Integer, String, Uriorcurie -from linkml_runtime.utils.metamodelcore import URIorCURIE - -metamodel_version = "1.7.0" - -# Overwrite dataclasses _init_fn to add **kwargs in __init__ -dataclasses._init_fn = dataclasses_init_fn_with_kwargs - -# Namespaces -OIO = CurieNamespace('OIO', 'http://www.geneontology.org/formats/oboInOwl#') -BIBO = CurieNamespace('bibo', 'http://purl.org/ontology/bibo/') -DCAT = CurieNamespace('dcat', 'http://www.w3.org/ns/dcat#') -DCTERMS = CurieNamespace('dcterms', 'http://example.org/UNKNOWN/dcterms/') -DOAP = CurieNamespace('doap', 'http://usefulinc.com/ns/doap#') -FOAF = CurieNamespace('foaf', 'http://xmlns.com/foaf/0.1/') -LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/') -LINKML_REGISTRY = CurieNamespace('linkml_registry', 'https://w3id.org/linkml_registry') -OSLC = CurieNamespace('oslc', 'http://open-services.net/ns/core#') -PAV = CurieNamespace('pav', 'http://purl.org/pav/') -RDFS = CurieNamespace('rdfs', 'http://example.org/UNKNOWN/rdfs/') -SCHEMA = CurieNamespace('schema', 'http://schema.org/') -SKOS = CurieNamespace('skos', 'http://www.w3.org/2004/02/skos/core#') -XSD = CurieNamespace('xsd', 'http://www.w3.org/2001/XMLSchema#') -DEFAULT_ = LINKML_REGISTRY - - -# Types -class HttpsIdentifier(String): - type_class_uri = XSD.string - type_class_curie = "xsd:string" - type_name = "https identifier" - type_model_uri = LINKML_REGISTRY.HttpsIdentifier - - -# Class references -class SchemaRegistryName(extended_str): - pass - - -class SchemaMetadataName(extended_str): - pass - - -@dataclass -class SchemaRegistry(YAMLRoot): - _inherited_slots: ClassVar[List[str]] = [] - - class_class_uri: ClassVar[URIRef] = LINKML_REGISTRY.SchemaRegistry - class_class_curie: ClassVar[str] = "linkml_registry:SchemaRegistry" - class_name: ClassVar[str] = "schema registry" - class_model_uri: ClassVar[URIRef] = LINKML_REGISTRY.SchemaRegistry - - name: Union[str, SchemaRegistryName] = None - homepage: Optional[Union[str, HttpsIdentifier]] = None - entries: Optional[Union[Dict[Union[str, SchemaMetadataName], Union[dict, "SchemaMetadata"]], List[Union[dict, "SchemaMetadata"]]]] = empty_dict() - license: Optional[str] = None - title: Optional[str] = None - description: Optional[str] = None - domain: Optional[Union[str, List[str]]] = empty_list() - topics: Optional[Union[str, List[str]]] = empty_list() - - def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): - if self._is_empty(self.name): - self.MissingRequiredField("name") - if not isinstance(self.name, SchemaRegistryName): - self.name = SchemaRegistryName(self.name) - - if self.homepage is not None and not isinstance(self.homepage, HttpsIdentifier): - self.homepage = HttpsIdentifier(self.homepage) - - self._normalize_inlined_as_dict(slot_name="entries", slot_type=SchemaMetadata, key_name="name", keyed=True) - - if self.license is not None and not isinstance(self.license, str): - self.license = str(self.license) - - if self.title is not None and not isinstance(self.title, str): - self.title = str(self.title) - - if self.description is not None and not isinstance(self.description, str): - self.description = str(self.description) - - if not isinstance(self.domain, list): - self.domain = [self.domain] if self.domain is not None else [] - self.domain = [v if isinstance(v, str) else str(v) for v in self.domain] - - if not isinstance(self.topics, list): - self.topics = [self.topics] if self.topics is not None else [] - self.topics = [v if isinstance(v, str) else str(v) for v in self.topics] - - super().__post_init__(**kwargs) - - -@dataclass -class SchemaMetadata(YAMLRoot): - _inherited_slots: ClassVar[List[str]] = [] - - class_class_uri: ClassVar[URIRef] = LINKML_REGISTRY.SchemaMetadata - class_class_curie: ClassVar[str] = "linkml_registry:SchemaMetadata" - class_name: ClassVar[str] = "schema metadata" - class_model_uri: ClassVar[URIRef] = LINKML_REGISTRY.SchemaMetadata - - name: Union[str, SchemaMetadataName] = None - title: Optional[str] = None - description: Optional[str] = None - homepage: Optional[Union[str, HttpsIdentifier]] = None - schema_url: Optional[Union[str, HttpsIdentifier]] = None - github_repo: Optional[str] = None - schema_relative_path: Optional[str] = None - license: Optional[str] = None - domain: Optional[Union[str, List[str]]] = empty_list() - topics: Optional[Union[str, List[str]]] = empty_list() - score: Optional[str] = None - class_count: Optional[int] = None - slot_count: Optional[int] = None - enum_count: Optional[int] = None - type_count: Optional[int] = None - github_stars: Optional[int] = None - proportion_elements_with_a_description: Optional[float] = None - proportion_elements_mapped: Optional[float] = None - errors: Optional[Union[str, List[str]]] = empty_list() - - def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): - if self._is_empty(self.name): - self.MissingRequiredField("name") - if not isinstance(self.name, SchemaMetadataName): - self.name = SchemaMetadataName(self.name) - - if self.title is not None and not isinstance(self.title, str): - self.title = str(self.title) - - if self.description is not None and not isinstance(self.description, str): - self.description = str(self.description) - - if self.homepage is not None and not isinstance(self.homepage, HttpsIdentifier): - self.homepage = HttpsIdentifier(self.homepage) - - if self.schema_url is not None and not isinstance(self.schema_url, HttpsIdentifier): - self.schema_url = HttpsIdentifier(self.schema_url) - - if self.github_repo is not None and not isinstance(self.github_repo, str): - self.github_repo = str(self.github_repo) - - if self.schema_relative_path is not None and not isinstance(self.schema_relative_path, str): - self.schema_relative_path = str(self.schema_relative_path) - - if self.license is not None and not isinstance(self.license, str): - self.license = str(self.license) - - if not isinstance(self.domain, list): - self.domain = [self.domain] if self.domain is not None else [] - self.domain = [v if isinstance(v, str) else str(v) for v in self.domain] - - if not isinstance(self.topics, list): - self.topics = [self.topics] if self.topics is not None else [] - self.topics = [v if isinstance(v, str) else str(v) for v in self.topics] - - if self.score is not None and not isinstance(self.score, str): - self.score = str(self.score) - - if self.class_count is not None and not isinstance(self.class_count, int): - self.class_count = int(self.class_count) - - if self.slot_count is not None and not isinstance(self.slot_count, int): - self.slot_count = int(self.slot_count) - - if self.enum_count is not None and not isinstance(self.enum_count, int): - self.enum_count = int(self.enum_count) - - if self.type_count is not None and not isinstance(self.type_count, int): - self.type_count = int(self.type_count) - - if self.github_stars is not None and not isinstance(self.github_stars, int): - self.github_stars = int(self.github_stars) - - if self.proportion_elements_with_a_description is not None and not isinstance(self.proportion_elements_with_a_description, float): - self.proportion_elements_with_a_description = float(self.proportion_elements_with_a_description) - - if self.proportion_elements_mapped is not None and not isinstance(self.proportion_elements_mapped, float): - self.proportion_elements_mapped = float(self.proportion_elements_mapped) - - if not isinstance(self.errors, list): - self.errors = [self.errors] if self.errors is not None else [] - self.errors = [v if isinstance(v, str) else str(v) for v in self.errors] - - super().__post_init__(**kwargs) - - -@dataclass -class Evaluation(YAMLRoot): - _inherited_slots: ClassVar[List[str]] = [] - - class_class_uri: ClassVar[URIRef] = LINKML_REGISTRY.Evaluation - class_class_curie: ClassVar[str] = "linkml_registry:Evaluation" - class_name: ClassVar[str] = "evaluation" - class_model_uri: ClassVar[URIRef] = LINKML_REGISTRY.Evaluation - - score: Optional[str] = None - class_count: Optional[int] = None - slot_count: Optional[int] = None - enum_count: Optional[int] = None - type_count: Optional[int] = None - github_stars: Optional[int] = None - proportion_elements_with_a_description: Optional[float] = None - proportion_elements_mapped: Optional[float] = None - errors: Optional[Union[str, List[str]]] = empty_list() - - def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): - if self.score is not None and not isinstance(self.score, str): - self.score = str(self.score) - - if self.class_count is not None and not isinstance(self.class_count, int): - self.class_count = int(self.class_count) - - if self.slot_count is not None and not isinstance(self.slot_count, int): - self.slot_count = int(self.slot_count) - - if self.enum_count is not None and not isinstance(self.enum_count, int): - self.enum_count = int(self.enum_count) - - if self.type_count is not None and not isinstance(self.type_count, int): - self.type_count = int(self.type_count) - - if self.github_stars is not None and not isinstance(self.github_stars, int): - self.github_stars = int(self.github_stars) - - if self.proportion_elements_with_a_description is not None and not isinstance(self.proportion_elements_with_a_description, float): - self.proportion_elements_with_a_description = float(self.proportion_elements_with_a_description) - - if self.proportion_elements_mapped is not None and not isinstance(self.proportion_elements_mapped, float): - self.proportion_elements_mapped = float(self.proportion_elements_mapped) - - if not isinstance(self.errors, list): - self.errors = [self.errors] if self.errors is not None else [] - self.errors = [v if isinstance(v, str) else str(v) for v in self.errors] - - super().__post_init__(**kwargs) - - -# Enumerations -class LicenseEnum(EnumDefinitionImpl): - - _defn = EnumDefinition( - name="LicenseEnum", - ) - - @classmethod - def _addvals(cls): - setattr(cls, "CC-BY-v4", - PermissibleValue(text="CC-BY-v4", - description="CC-BY", - meaning=None) ) - setattr(cls, "CC-0-v1", - PermissibleValue(text="CC-0-v1", - description="CC-0", - meaning=None) ) - -# Slots -class slots: - pass - -slots.name = Slot(uri=RDFS.label, name="name", curie=RDFS.curie('label'), - model_uri=LINKML_REGISTRY.name, domain=None, range=URIRef) - -slots.base_purl = Slot(uri=LINKML_REGISTRY.base_purl, name="base purl", curie=LINKML_REGISTRY.curie('base_purl'), - model_uri=LINKML_REGISTRY.base_purl, domain=None, range=Optional[Union[str, URIorCURIE]]) - -slots.schema_purl = Slot(uri=LINKML_REGISTRY.schema_purl, name="schema purl", curie=LINKML_REGISTRY.curie('schema_purl'), - model_uri=LINKML_REGISTRY.schema_purl, domain=None, range=Optional[Union[str, URIorCURIE]]) - -slots.homepage = Slot(uri=FOAF.homepage, name="homepage", curie=FOAF.curie('homepage'), - model_uri=LINKML_REGISTRY.homepage, domain=None, range=Optional[Union[str, HttpsIdentifier]]) - -slots.schema_url = Slot(uri=DCTERMS.source, name="schema url", curie=DCTERMS.curie('source'), - model_uri=LINKML_REGISTRY.schema_url, domain=None, range=Optional[Union[str, HttpsIdentifier]]) - -slots.github_repo = Slot(uri=LINKML_REGISTRY.github_repo, name="github repo", curie=LINKML_REGISTRY.curie('github_repo'), - model_uri=LINKML_REGISTRY.github_repo, domain=None, range=Optional[str]) - -slots.issue_tracker = Slot(uri=DOAP['bug-database'], name="issue tracker", curie=DOAP.curie('bug-database'), - model_uri=LINKML_REGISTRY.issue_tracker, domain=None, range=Optional[str]) - -slots.license = Slot(uri=DCTERMS.license, name="license", curie=DCTERMS.curie('license'), - model_uri=LINKML_REGISTRY.license, domain=None, range=Optional[str]) - -slots.title = Slot(uri=DCTERMS.title, name="title", curie=DCTERMS.curie('title'), - model_uri=LINKML_REGISTRY.title, domain=None, range=Optional[str]) - -slots.description = Slot(uri=SKOS.definition, name="description", curie=SKOS.curie('definition'), - model_uri=LINKML_REGISTRY.description, domain=None, range=Optional[str]) - -slots.domain = Slot(uri=DCTERMS.subject, name="domain", curie=DCTERMS.curie('subject'), - model_uri=LINKML_REGISTRY.domain, domain=None, range=Optional[Union[str, List[str]]]) - -slots.topics = Slot(uri=DCTERMS.subject, name="topics", curie=DCTERMS.curie('subject'), - model_uri=LINKML_REGISTRY.topics, domain=None, range=Optional[Union[str, List[str]]]) - -slots.entries = Slot(uri=DCTERMS.hasPart, name="entries", curie=DCTERMS.curie('hasPart'), - model_uri=LINKML_REGISTRY.entries, domain=None, range=Optional[Union[Dict[Union[str, SchemaMetadataName], Union[dict, SchemaMetadata]], List[Union[dict, SchemaMetadata]]]]) - -slots.score = Slot(uri=LINKML_REGISTRY.score, name="score", curie=LINKML_REGISTRY.curie('score'), - model_uri=LINKML_REGISTRY.score, domain=None, range=Optional[int]) - -slots.github_stars = Slot(uri=LINKML_REGISTRY.github_stars, name="github stars", curie=LINKML_REGISTRY.curie('github_stars'), - model_uri=LINKML_REGISTRY.github_stars, domain=None, range=Optional[int]) - -slots.schema_relative_path = Slot(uri=LINKML_REGISTRY.schema_relative_path, name="schema relative path", curie=LINKML_REGISTRY.curie('schema_relative_path'), - model_uri=LINKML_REGISTRY.schema_relative_path, domain=None, range=Optional[str]) - -slots.statistic = Slot(uri=LINKML_REGISTRY.statistic, name="statistic", curie=LINKML_REGISTRY.curie('statistic'), - model_uri=LINKML_REGISTRY.statistic, domain=None, range=Optional[str]) - -slots.count_statistic = Slot(uri=LINKML_REGISTRY.count_statistic, name="count statistic", curie=LINKML_REGISTRY.curie('count_statistic'), - model_uri=LINKML_REGISTRY.count_statistic, domain=None, range=Optional[int]) - -slots.proportion_statistic = Slot(uri=LINKML_REGISTRY.proportion_statistic, name="proportion statistic", curie=LINKML_REGISTRY.curie('proportion_statistic'), - model_uri=LINKML_REGISTRY.proportion_statistic, domain=None, range=Optional[float]) - -slots.evaluation__score = Slot(uri=LINKML_REGISTRY.score, name="evaluation__score", curie=LINKML_REGISTRY.curie('score'), - model_uri=LINKML_REGISTRY.evaluation__score, domain=None, range=Optional[str]) - -slots.evaluation__class_count = Slot(uri=LINKML_REGISTRY.class_count, name="evaluation__class_count", curie=LINKML_REGISTRY.curie('class_count'), - model_uri=LINKML_REGISTRY.evaluation__class_count, domain=None, range=Optional[int]) - -slots.evaluation__slot_count = Slot(uri=LINKML_REGISTRY.slot_count, name="evaluation__slot_count", curie=LINKML_REGISTRY.curie('slot_count'), - model_uri=LINKML_REGISTRY.evaluation__slot_count, domain=None, range=Optional[int]) - -slots.evaluation__enum_count = Slot(uri=LINKML_REGISTRY.enum_count, name="evaluation__enum_count", curie=LINKML_REGISTRY.curie('enum_count'), - model_uri=LINKML_REGISTRY.evaluation__enum_count, domain=None, range=Optional[int]) - -slots.evaluation__type_count = Slot(uri=LINKML_REGISTRY.type_count, name="evaluation__type_count", curie=LINKML_REGISTRY.curie('type_count'), - model_uri=LINKML_REGISTRY.evaluation__type_count, domain=None, range=Optional[int]) - -slots.evaluation__github_stars = Slot(uri=LINKML_REGISTRY.github_stars, name="evaluation__github_stars", curie=LINKML_REGISTRY.curie('github_stars'), - model_uri=LINKML_REGISTRY.evaluation__github_stars, domain=None, range=Optional[int]) - -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'), - model_uri=LINKML_REGISTRY.evaluation__proportion_elements_with_a_description, domain=None, range=Optional[float]) - -slots.evaluation__proportion_elements_mapped = Slot(uri=LINKML_REGISTRY.proportion_elements_mapped, name="evaluation__proportion_elements_mapped", curie=LINKML_REGISTRY.curie('proportion_elements_mapped'), - model_uri=LINKML_REGISTRY.evaluation__proportion_elements_mapped, domain=None, range=Optional[float]) - -slots.evaluation__errors = Slot(uri=LINKML_REGISTRY.errors, name="evaluation__errors", curie=LINKML_REGISTRY.curie('errors'), - model_uri=LINKML_REGISTRY.evaluation__errors, domain=None, range=Optional[Union[str, List[str]]]) \ No newline at end of file diff --git a/linkml_registry/sqlddl/registry.sql b/linkml_registry/sqlddl/registry.sql deleted file mode 100644 index 8a18b70..0000000 --- a/linkml_registry/sqlddl/registry.sql +++ /dev/null @@ -1,68 +0,0 @@ - - -CREATE TABLE schema_registry ( - name TEXT NOT NULL, - homepage TEXT, - license TEXT, - title TEXT, - description TEXT, - PRIMARY KEY (name) -); - -CREATE TABLE schema_metadata ( - name TEXT NOT NULL, - title TEXT, - description TEXT, - homepage TEXT, - schema_url TEXT, - github_repo TEXT, - schema_relative_path TEXT, - license TEXT, - score TEXT, - class_count INTEGER, - slot_count INTEGER, - enum_count INTEGER, - type_count INTEGER, - github_stars INTEGER, - proportion_elements_with_a_description FLOAT, - proportion_elements_mapped FLOAT, - schema_registry_name TEXT, - PRIMARY KEY (name), - FOREIGN KEY(schema_registry_name) REFERENCES schema_registry (name) -); - -CREATE TABLE schema_registry_domain ( - backref_id TEXT, - domain TEXT, - PRIMARY KEY (backref_id, domain), - FOREIGN KEY(backref_id) REFERENCES schema_registry (name) -); - -CREATE TABLE schema_registry_topics ( - backref_id TEXT, - topics TEXT, - PRIMARY KEY (backref_id, topics), - FOREIGN KEY(backref_id) REFERENCES schema_registry (name) -); - -CREATE TABLE schema_metadata_domain ( - backref_id TEXT, - domain TEXT, - PRIMARY KEY (backref_id, domain), - FOREIGN KEY(backref_id) REFERENCES schema_metadata (name) -); - -CREATE TABLE schema_metadata_topics ( - backref_id TEXT, - topics TEXT, - PRIMARY KEY (backref_id, topics), - FOREIGN KEY(backref_id) REFERENCES schema_metadata (name) -); - -CREATE TABLE schema_metadata_errors ( - backref_id TEXT, - errors TEXT, - PRIMARY KEY (backref_id, errors), - FOREIGN KEY(backref_id) REFERENCES schema_metadata (name) -); - diff --git a/linkml_registry/utils.py b/linkml_registry/utils.py deleted file mode 100644 index 44d3fe3..0000000 --- a/linkml_registry/utils.py +++ /dev/null @@ -1,43 +0,0 @@ -""" -convenience wrappers around linkml runtime, for doing basic conversion between objects -and serialization formats. - -The top level class is a Registry object - -Some of this will become unnecessary in the future -""" -import yaml -import click -import logging -import os -import csv -from linkml_registry.registry import SchemaMetadata, SchemaRegistry -from typing import List - - -THIS_DIR = os.path.abspath(os.path.dirname(__file__)) - - -def from_csv(filename: str, sep=',', name='default') -> SchemaRegistry: - """ - Will be replaced by runtime csv method - """ - logging.info(f'Converting {filename}') - registry = SchemaRegistry(name=name) - with open(filename, newline='') as tsvfile: - rr = csv.DictReader(tsvfile, delimiter=sep) - for row in rr: - m = SchemaMetadata(**dict(row)) - registry.entries[m.name] = m - return registry - -@click.command() -@click.argument('files', nargs=-1) -def cli(files: List[str]): - for f in files: - registry = from_csv(f) - -if __name__ == "__main__": - cli() - - diff --git a/mkdocs.yml b/mkdocs.yml index 2c74ddb..b20266d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,10 +1,6 @@ site_name: "LinkML Registry" theme: name: readthedocs - analytics: - gtag: G-2SYBSJVZ23 -docs_dir: target/docs -site_dir: docs nav: - Home: home.md - Registry: registry.md @@ -12,4 +8,3 @@ nav: - Credits: credits.md site_url: https://linkml.github.io/linkml-registry/ repo_url: https://github.com/linkml/linkml-registry -edit_uri: blob/main/docs/ diff --git a/models.yaml b/models.yaml index 79f6ae9..67a3ee4 100644 --- a/models.yaml +++ b/models.yaml @@ -4,21 +4,63 @@ entries: LinkML Model: name: LinkML Model title: LinkML Schema Metamodel - description: A metamodel for defining linked open data schemas + description: 'The metamodel for schemas defined using the Linked Data Modeling + Language framework. + + + For more information on LinkML: + + + * [linkml.io](https://linkml.io) main website + + * [specification](https://w3id.org/linkml/docs/specification/) + + + LinkML is self-describing. Every LinkML schema consists of elements + + that instantiate classes in this metamodel. + + + Core metaclasses: + + + * [SchemaDefinition](https://w3id.org/linkml/SchemaDefinition) + + * [ClassDefinition](https://w3id.org/linkml/ClassDefinition) + + * [SlotDefinition](https://w3id.org/linkml/SlotDefinition) + + * [TypeDefinition](https://w3id.org/linkml/TypeDefinition) + + + There are many subsets of *profiles* of the metamodel, for different purposes: + + + * [MinimalSubset](https://w3id.org/linkml/MinimalSubset) + + * [BasicSubset](https://w3id.org/linkml/BasicSubset) + + * [BasicSubset](https://w3id.org/linkml/BasicSubset) + + + For canonical reference documentation on any metamodel construct, + + refer to the official URI for each construct, e.g. + + [https://w3id.org/linkml/is_a](https://w3id.org/linkml/is_a)' homepage: https://linkml.github.io/linkml-model/docs/ schema_url: https://github.com/linkml/linkml-model/blob/main/model/schema/meta.yaml github_repo: linkml/linkml-model - schema_relative_path: model/schema/meta.yaml + schema_relative_path: linkml_model/model/schema/meta.yaml license: https://creativecommons.org/publicdomain/zero/1.0/ topics: - meta - class_count: 19 - slot_count: 116 - enum_count: 1 - type_count: 14 - github_stars: 10 - proportion_elements_with_a_description: 0.9733333333333334 - proportion_elements_mapped: 0.28 + class_count: 41 + slot_count: 220 + enum_count: 4 + type_count: 19 + proportion_elements_with_a_description: 0.9683098591549296 + proportion_elements_mapped: 0.2992957746478873 LinkML Template Configuration Model: name: LinkML Template Configuration Model title: LinkML template configuration @@ -28,28 +70,25 @@ entries: license: CC-0 topics: - meta - github_stars: 1 NMDC: name: NMDC title: NMDC Schema - description: "Schema for National Microbiome Data Collaborative (NMDC). This scheme\ - \ is organized into 3 separate modules:\n \nThis schema is organized into distinct\ - \ modules:\n \n * a set of core types for representing data values\n * the\ - \ mixs schema (auto-translated from mixs excel)\n * annotation schema\n * the\ - \ NMDC schema itself" + description: "Schema for National Microbiome Data Collaborative (NMDC).\nThis\ + \ schema is organized into multiple modules, such as:\n\n * a set of core types\ + \ for representing data values\n * a subset of the mixs schema\n * an annotation\ + \ schema\n * the NMDC schema itself, into which the other modules are imported" homepage: https://microbiomedata.github.io/nmdc-schema/ github_repo: microbiomedata/nmdc-schema schema_relative_path: src/schema/nmdc.yaml license: https://creativecommons.org/publicdomain/zero/1.0/ topics: - environmental microbiology - class_count: 48 - slot_count: 741 - enum_count: 1 - type_count: 18 - github_stars: 5 - proportion_elements_with_a_description: 0.926980198019802 - proportion_elements_mapped: 0.043316831683168314 + class_count: 69 + slot_count: 864 + enum_count: 124 + type_count: 24 + proportion_elements_with_a_description: 0.7446808510638298 + proportion_elements_mapped: 0.5023126734505088 Biolink-Model: name: Biolink-Model title: Biolink Model @@ -69,31 +108,29 @@ entries: - model organism biology - biochemistry - biology - class_count: 257 - slot_count: 425 - enum_count: 9 - type_count: 27 - github_stars: 78 - proportion_elements_with_a_description: 0.6810584958217271 - proportion_elements_mapped: 0.46518105849582175 + class_count: 302 + slot_count: 460 + enum_count: 19 + type_count: 32 + proportion_elements_with_a_description: 0.7220172201722017 + proportion_elements_mapped: 0.38253382533825336 SSSOM: name: SSSOM title: Simple Standard Sharing Object Mappings - description: Datamodel for Simple Standard for Sharing Ontology Mappings (SSSOM) + description: Datamodel for Simple Standard for Sharing Ontological Mappings (SSSOM) homepage: https://mapping-commons.github.io/sssom/ github_repo: mapping-commons/SSSOM - schema_relative_path: model/schema/sssom.yaml + schema_relative_path: src/sssom_schema/schema/sssom_schema.yaml license: CC-0 topics: - information - mappings - class_count: 2 - slot_count: 49 - enum_count: 5 - type_count: 15 - github_stars: 35 - proportion_elements_with_a_description: 0.9295774647887324 - proportion_elements_mapped: 0.4084507042253521 + class_count: 5 + slot_count: 71 + enum_count: 3 + type_count: 20 + proportion_elements_with_a_description: 0.9696969696969697 + proportion_elements_mapped: 0.3939393939393939 KGCL: name: KGCL title: Knowledge Graph Change Language @@ -111,36 +148,39 @@ entries: license: https://creativecommons.org/publicdomain/zero/1.0/ topics: - knowledge graphs - class_count: 66 - slot_count: 39 + class_count: 71 + slot_count: 70 enum_count: 2 - type_count: 15 - github_stars: 12 - proportion_elements_with_a_description: 0.7377049180327869 - proportion_elements_mapped: 0.26229508196721313 + type_count: 21 + proportion_elements_with_a_description: 0.7439024390243902 + proportion_elements_mapped: 0.23780487804878048 KGViz: name: KGViz title: Knowledge Graph Visualization Configuration description: 'A data model for describing configurations / stylesheets for visualzing - graphs, and in particular Knowledge Graphs or Ontologies. These graphs are characterized - by having meaningful edge labels, node categories, IDs or URIs on each element, - as well as additional rich metadata on the nodes or edges. + graphs, and + + in particular Knowledge Graphs or Ontologies. These graphs are characterized + by having meaningful edge labels, + + node categories, IDs or URIs on each element, as well as additional rich metadata + on the nodes or edges. + - An example of a use of this is https://github.com/cmungall/obographviz' + An example of a use of this is https://github.com/INCATools/obographviz' homepage: https://berkeleybop.github.io/kgviz-model/ schema_url: '' github_repo: berkeleybop/kgviz-model - schema_relative_path: model/schema/kgviz.yaml + schema_relative_path: src/kgviz_model/linkml/kgviz.yaml license: https://creativecommons.org/publicdomain/zero/1.0/ topics: - visualization class_count: 16 - slot_count: 30 + slot_count: 31 enum_count: 3 - type_count: 16 - github_stars: 4 - proportion_elements_with_a_description: 0.5384615384615384 - proportion_elements_mapped: 0.27692307692307694 + type_count: 21 + proportion_elements_with_a_description: 0.5774647887323944 + proportion_elements_mapped: 0.323943661971831 Semantic Sql: name: Semantic Sql title: Semantic SQL @@ -158,21 +198,20 @@ entries: as well as a rich searchable documentation system and other tooling.\n\nThis\ \ schema is best browsed online: https://cmungall.github.io/semantic-sql/\n\n\ Note that things are in flux, and there some oddities that need ironed out,\ - \ see\nissues for details\n\nSee the [github repo](https://github.com/cmungall/semantic-sql)\ + \ see\nissues for details.\n\nSee the [github repo](https://github.com/cmungall/semantic-sql)\ \ for code to convert\nfrom the linkml yaml into SQL DDL" homepage: https://cmungall.github.io/semantic-sql/ github_repo: cmungall/semantic-sql - schema_relative_path: src/schema/semsql.yaml + schema_relative_path: src/semsql/linkml/semsql.yaml license: https://creativecommons.org/publicdomain/zero/1.0/ topics: - ontologies - class_count: 98 - slot_count: 23 + class_count: 103 + slot_count: 34 enum_count: 0 - type_count: 16 - github_stars: 10 - proportion_elements_with_a_description: 0.5401459854014599 - proportion_elements_mapped: 0.27007299270072993 + type_count: 21 + proportion_elements_with_a_description: 0.5443037974683544 + proportion_elements_mapped: 0.2721518987341772 Chemical Entities and Mixtures Model: name: Chemical Entities and Mixtures Model title: Chemical Entities Mixtures and Reactions Ontological Framework @@ -196,48 +235,37 @@ entries: license: https://creativecommons.org/publicdomain/zero/1.0/ topics: - chemistry - class_count: 122 - slot_count: 120 - enum_count: 5 - type_count: 22 - github_stars: 7 - proportion_elements_with_a_description: 0.6319702602230484 - proportion_elements_mapped: 0.16356877323420074 + class_count: 126 + slot_count: 217 + enum_count: 9 + type_count: 27 + proportion_elements_with_a_description: 0.5435356200527705 + proportion_elements_mapped: 0.19261213720316622 CCDH: name: CCDH title: CRDC-H Model homepage: https://cancerdhc.github.io/ccdhmodel schema_url: '' github_repo: cancerdhc/ccdhmodel - schema_relative_path: src/schema/ccdhmodel.yaml + schema_relative_path: model/schema/crdch_model.yaml license: https://creativecommons.org/publicdomain/zero/1.0/ topics: - cancer class_count: 41 slot_count: 0 - enum_count: 108 - type_count: 21 - github_stars: 11 - proportion_elements_with_a_description: 0.9882352941176471 - proportion_elements_mapped: 0.12352941176470589 + enum_count: 106 + type_count: 26 + proportion_elements_with_a_description: 0.9884393063583815 + proportion_elements_mapped: 0.15028901734104047 ontology-associations: name: ontology-associations title: common association file formats - description: Various association data models homepage: https://biodatamodels.github.io/ontology-associations/ schema_url: '' github_repo: biodatamodels/ontology-associations - schema_relative_path: src/schema/all.yaml license: CC-0 topics: - genomics - class_count: 33 - slot_count: 108 - enum_count: 18 - type_count: 25 - github_stars: 4 - proportion_elements_with_a_description: 0.32608695652173914 - proportion_elements_mapped: 0.2391304347826087 GFF3: name: GFF3 title: Genome Feature Format LinkML rendering @@ -252,10 +280,9 @@ entries: class_count: 8 slot_count: 26 enum_count: 3 - type_count: 16 - github_stars: 5 - proportion_elements_with_a_description: 0.6415094339622641 - proportion_elements_mapped: 0.37735849056603776 + type_count: 21 + proportion_elements_with_a_description: 0.6724137931034483 + proportion_elements_mapped: 0.43103448275862066 Monochrom: name: Monochrom title: Chromosome ontology and ETL @@ -265,7 +292,6 @@ entries: license: CC-0 topics: - genomics - github_stars: 9 GSC MIxS: name: GSC MIxS title: '' @@ -283,7 +309,6 @@ entries: license: CC-0 topics: - ontologies - github_stars: 2 HOT-TermCI: name: HOT-TermCI title: HOT-TermCI @@ -298,14 +323,13 @@ entries: class_count: 4 slot_count: 15 enum_count: 0 - type_count: 14 - github_stars: 3 + type_count: 19 proportion_elements_with_a_description: 1.0 - proportion_elements_mapped: 0.8484848484848485 + proportion_elements_mapped: 0.868421052631579 Alliance of Genome Resource Persistent Schema: name: Alliance of Genome Resource Persistent Schema title: Alliance of Genome Resources Persistent Schema - description: Alliance Schema Prototype + description: Alliance Persistent Schema homepage: '' schema_url: '' github_repo: alliance-genome/agr_curation_schema @@ -313,13 +337,12 @@ entries: license: https://creativecommons.org/publicdomain/zero/1.0/ topics: - genomics - class_count: 80 - slot_count: 213 - enum_count: 25 - type_count: 15 - github_stars: 3 - proportion_elements_with_a_description: 0.5585585585585585 - proportion_elements_mapped: 0.08108108108108109 + class_count: 285 + slot_count: 600 + enum_count: 21 + type_count: 20 + proportion_elements_with_a_description: 0.712742980561555 + proportion_elements_mapped: 0.04103671706263499 SESAR: name: SESAR title: '' @@ -337,21 +360,20 @@ entries: license: '' topics: - ontologies - github_stars: 4 GHGA Metadata: name: GHGA Metadata title: Metadata schema for the German Human Genome-Phenome Archive (GHGA) - description: The metadata schema for the German Human Genome-Phenome Archive (GHGA). + description: The submission centric metadata schema for the German Human Genome-Phenome + Archive (GHGA). homepage: https://ghga-de.github.io/ghga-metadata-schema/ github_repo: ghga-de/ghga-metadata-schema - schema_relative_path: src/schema/ghga.yaml + schema_relative_path: src/schema/submission.yaml class_count: 26 - slot_count: 45 - enum_count: 0 - type_count: 14 - github_stars: 5 - proportion_elements_with_a_description: 0.9764705882352941 - proportion_elements_mapped: 0.3058823529411765 + slot_count: 112 + enum_count: 30 + type_count: 19 + proportion_elements_with_a_description: 0.9893048128342246 + proportion_elements_mapped: 0.18716577540106952 MIANCT: name: MIANCT title: Minimal Information About a new Cell Type @@ -385,29 +407,19 @@ entries: class_count: 2 slot_count: 11 enum_count: 3 - type_count: 15 - github_stars: 3 - proportion_elements_with_a_description: 0.6451612903225806 - proportion_elements_mapped: 0.7096774193548387 + type_count: 20 + proportion_elements_with_a_description: 0.6944444444444444 + proportion_elements_mapped: 0.75 iSamples: name: iSamples title: iSamples - description: Schema for documenting physical samples homepage: https://github.com/isamplesorg/metadata github_repo: isamplesorg/metadata - schema_relative_path: iSamplesSchemaBasic0.3.yml license: https://creativecommons.org/publicdomain/zero/1.0/ topics: - samples - metadata - earth science - class_count: 6 - slot_count: 27 - enum_count: 3 - type_count: 3 - github_stars: 2 - proportion_elements_with_a_description: 0.9230769230769231 - proportion_elements_mapped: 0.07692307692307693 sparqlfun: name: sparqlfun title: SPARQLFun @@ -419,29 +431,22 @@ entries: topics: - sparql - templates - class_count: 263 - slot_count: 172 + class_count: 92 + slot_count: 61 enum_count: 2 - type_count: 16 - github_stars: 4 - proportion_elements_with_a_description: 0.16777041942604856 - proportion_elements_mapped: 0.7439293598233996 - NEAT_ML_Schema: - name: neat-ml-schema - title: NEAT-ML Schema - description: Schema for NEAT-ML. - homepage: https://github.com/Knowledge-Graph-Hub/neat-ml-schema - github_repo: Knowledge-Graph-Hub/neat-ml-schema - schema_relative_path: neat_ml_schema/schema/neat_ml_schema.yaml - license: https://opensource.org/licenses/MIT + type_count: 21 + proportion_elements_with_a_description: 0.3352272727272727 + proportion_elements_mapped: 0.3409090909090909 + INCLUDE: + name: INCLUDE + title: The INvestigation of Co-occurring conditions across the Lifespan to Understand + Down syndromE (INCLUDE) data model + homepage: https://github.com/include-dcc/include-linkml + schema_url: '' + github_repo: include-dcc/include-linkml + license: CC-0 topics: - - machine learning - - link prediction - class_count: 27 - slot_count: 156 - enum_count: 5 - type_count: 15 - github_stars: 1 - proportion_elements_with_a_description: - proportion_elements_mapped: + - Ontologies + - Down syndrome + - Clinical research title: This is the main LinkML registry diff --git a/owl/README.md b/owl/README.md deleted file mode 100644 index fc2a238..0000000 --- a/owl/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# OWL - -Web Ontology Language [OWL](https://www.w3.org/TR/2012/REC-owl2-overview-20121211/) - -Do not edit the files in here - these are autogenerated from the schema. See the Makefile for details. diff --git a/owl/registry.owl.ttl b/owl/registry.owl.ttl deleted file mode 100644 index 7b2a38a..0000000 --- a/owl/registry.owl.ttl +++ /dev/null @@ -1,332 +0,0 @@ -@prefix IAO: . -@prefix dcterms: . -@prefix doap: . -@prefix foaf: . -@prefix linkml: . -@prefix linkml_registry: . -@prefix owl: . -@prefix rdfs: . -@prefix skos: . -@prefix xsd: . - -doap:bug-database a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "issue tracker" ; - rdfs:range linkml:String . - -linkml:SubsetDefinition a owl:Class ; - rdfs:label "subset_definition" ; - skos:definition "the name and description of a subset" . - -linkml:topValue a owl:DatatypeProperty ; - rdfs:label "value" . - -linkml_registry: a owl:Ontology ; - rdfs:label "linkml_registry" ; - IAO:0000700 linkml_registry:Evaluation, - linkml_registry:SchemaRegistry ; - dcterms:license "https://creativecommons.org/publicdomain/zero/1.0/" ; - dcterms:title "Schema for LinkML Schema Registry" ; - skos:definition "Datamodel for LinkML Registry and evaluation framework" ; - linkml:generation_date "2022-01-14T16:33:26" ; - linkml:metamodel_version "1.7.0" ; - linkml:source_file "registry.yaml" ; - linkml:source_file_date "2022-01-14T16:31:00" ; - linkml:source_file_size 3421 . - -linkml_registry:base_purl a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "base purl" ; - rdfs:range linkml:Uriorcurie . - -linkml_registry:schema_purl a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "schema purl" ; - rdfs:range linkml:Uriorcurie . - -linkml_registry:statistic a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "statistic" ; - rdfs:range linkml:String . - - a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "entries" ; - rdfs:range linkml_registry:SchemaMetadata . - - a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "schema url" ; - rdfs:range linkml_registry:HttpsIdentifier ; - linkml:examples "Example(value='https://w3id.org/biolink/', description=None)" . - -linkml:TypeDefinition a owl:Class ; - rdfs:label "type_definition" ; - skos:definition "A data type definition." . - -linkml_registry:SchemaRegistry a owl:Class, - linkml:ClassDefinition ; - rdfs:label "schema registry" ; - rdfs:subClassOf [ a owl:Restriction ; - owl:onClass linkml:String ; - owl:onProperty ; - owl:qualifiedCardinality 1 ], - [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml_registry:HttpsIdentifier ; - owl:onProperty foaf:homepage ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty skos:definition ], - [ a owl:Restriction ; - owl:allValuesFrom linkml_registry:SchemaMetadata ; - owl:onProperty ], - [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ] . - -linkml_registry:github_repo a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "github repo" ; - rdfs:range linkml:String ; - linkml:examples "Example(value='linkml/linkml-registry', description=None)" . - -linkml_registry:schema_relative_path a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "schema relative path" ; - rdfs:range linkml:String . - - a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "license" ; - rdfs:range linkml:String ; - linkml:examples "Example(value='CC-0', description=None)" . - - a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "title" ; - rdfs:range linkml:String ; - skos:definition "the official title of the schema" . - - a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "name" ; - rdfs:range linkml:String ; - linkml:examples "Example(value='HOT-TermCI', description=None)" . - -skos:definition a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "description" ; - rdfs:range linkml:String ; - linkml:examples "Example(value='Genome Feature Format LinkML rendering', description=None)" . - -foaf:homepage a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "homepage" ; - rdfs:range linkml_registry:HttpsIdentifier ; - linkml:examples "Example(value='https://github.com/HOT-Ecosystem/TermCI-model', description=None)" . - -linkml_registry:Evaluation a owl:Class, - linkml:ClassDefinition ; - rdfs:label "evaluation" ; - rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:Integer ; - owl:onProperty linkml_registry:slot_count ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:Float ; - owl:onProperty linkml_registry:proportion_elements_mapped ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:Integer ; - owl:onProperty linkml_registry:enum_count ], - [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty linkml_registry:errors ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:Integer ; - owl:onProperty linkml_registry:class_count ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:Integer ; - owl:onProperty linkml_registry:github_stars ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:Integer ; - owl:onProperty linkml_registry:type_count ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:Float ; - owl:onProperty linkml_registry:proportion_elements_with_a_description ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty linkml_registry:score ], - linkml:mixin . - -linkml_registry:SchemaMetadata a owl:Class, - linkml:ClassDefinition ; - rdfs:label "schema metadata" ; - rdfs:subClassOf [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty linkml_registry:errors ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:Integer ; - owl:onProperty linkml_registry:type_count ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml_registry:HttpsIdentifier ; - owl:onProperty foaf:homepage ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:Float ; - owl:onProperty linkml_registry:proportion_elements_mapped ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:Integer ; - owl:onProperty linkml_registry:enum_count ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:Float ; - owl:onProperty linkml_registry:proportion_elements_with_a_description ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:Integer ; - owl:onProperty linkml_registry:class_count ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:Integer ; - owl:onProperty linkml_registry:github_stars ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml_registry:HttpsIdentifier ; - owl:onProperty ], - [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty skos:definition ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:Integer ; - owl:onProperty linkml_registry:slot_count ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty linkml_registry:schema_relative_path ], - [ a owl:Restriction ; - owl:allValuesFrom linkml:String ; - owl:onProperty ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty linkml_registry:score ], - [ a owl:Restriction ; - owl:maxQualifiedCardinality 1 ; - owl:onClass linkml:String ; - owl:onProperty linkml_registry:github_repo ], - [ a owl:Restriction ; - owl:onClass linkml:String ; - owl:onProperty ; - owl:qualifiedCardinality 1 ], - linkml_registry:Evaluation . - -linkml_registry:class_count a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "class_count" ; - rdfs:range linkml:Integer ; - rdfs:subPropertyOf linkml_registry:count_statistic . - -linkml_registry:enum_count a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "enum_count" ; - rdfs:range linkml:Integer ; - rdfs:subPropertyOf linkml_registry:count_statistic . - -linkml_registry:errors a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "errors" ; - rdfs:range linkml:String . - -linkml_registry:github_stars a owl:ObjectProperty, - linkml:SlotDefinition . - -linkml_registry:proportion_elements_mapped a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "proportion elements mapped" ; - rdfs:range linkml:Float ; - rdfs:subPropertyOf linkml_registry:proportion_statistic . - -linkml_registry:proportion_elements_with_a_description a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "proportion elements with a description" ; - rdfs:range linkml:Float ; - rdfs:subPropertyOf linkml_registry:proportion_statistic . - -linkml_registry:proportion_statistic a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "proportion statistic" ; - rdfs:range linkml:Float . - -linkml_registry:score a owl:ObjectProperty, - linkml:SlotDefinition . - -linkml_registry:slot_count a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "slot_count" ; - rdfs:range linkml:Integer ; - rdfs:subPropertyOf linkml_registry:count_statistic . - -linkml_registry:type_count a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "type_count" ; - rdfs:range linkml:Integer ; - rdfs:subPropertyOf linkml_registry:count_statistic . - -linkml:ClassDefinition a owl:Class ; - rdfs:label "class_definition" ; - skos:definition "the definition of a class or interface" . - - a owl:ObjectProperty, - linkml:SlotDefinition . - -linkml_registry:count_statistic a owl:ObjectProperty, - linkml:SlotDefinition ; - rdfs:label "count statistic" ; - rdfs:range linkml:Integer . - -linkml_registry:HttpsIdentifier a owl:Class, - linkml:TypeDefinition ; - rdfs:label "https identifier" ; - rdfs:subClassOf linkml:String . - -linkml:SlotDefinition a owl:Class ; - rdfs:label "slot_definition" ; - skos:definition "the definition of a property or a slot" . - - diff --git a/python/README.md b/python/README.md deleted file mode 100644 index 7d21cb2..0000000 --- a/python/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Python - -Do not edit the files in here - these are autogenerated from the schema. See the Makefile for details. diff --git a/python/registry.py b/python/registry.py deleted file mode 100644 index 00ed28d..0000000 --- a/python/registry.py +++ /dev/null @@ -1,124 +0,0 @@ -# Auto generated from registry.yaml by pythongen.py version: 0.9.0 -# Generation date: 2021-04-02 14:17 -# Schema: linkml_registry -# -# id: https://w3id.org/linkml_registry -# description: linkml_registry -# license: https://creativecommons.org/publicdomain/zero/1.0/ - -import dataclasses -import sys -import re -from typing import Optional, List, Union, Dict, ClassVar, Any -from dataclasses import dataclass -from linkml_model.meta import EnumDefinition, PermissibleValue, PvFormulaOptions - -from linkml.utils.slot import Slot -from linkml.utils.metamodelcore import empty_list, empty_dict, bnode -from linkml.utils.yamlutils import YAMLRoot, extended_str, extended_float, extended_int -from linkml.utils.dataclass_extensions_376 import dataclasses_init_fn_with_kwargs -from linkml.utils.formatutils import camelcase, underscore, sfx -from linkml.utils.enumerations import EnumDefinitionImpl -from rdflib import Namespace, URIRef -from linkml.utils.curienamespace import CurieNamespace -from linkml_model.types import String - -metamodel_version = "1.7.0" - -# Overwrite dataclasses _init_fn to add **kwargs in __init__ -dataclasses._init_fn = dataclasses_init_fn_with_kwargs - -# Namespaces -LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/') -LINKML_REGISTRY = CurieNamespace('linkml_registry', 'https://w3id.org/linkml_registry') -XSD = CurieNamespace('xsd', 'http://www.w3.org/2001/XMLSchema#') -DEFAULT_ = LINKML_REGISTRY - - -# Types -class HttpsIdentifier(String): - type_class_uri = XSD.string - type_class_curie = "xsd:string" - type_name = "https identifier" - type_model_uri = LINKML_REGISTRY.HttpsIdentifier - - -# Class references - - - -@dataclass -class SchemaInfo(YAMLRoot): - _inherited_slots: ClassVar[List[str]] = [] - - class_class_uri: ClassVar[URIRef] = LINKML_REGISTRY.SchemaInfo - class_class_curie: ClassVar[str] = "linkml_registry:SchemaInfo" - class_name: ClassVar[str] = "schema info" - class_model_uri: ClassVar[URIRef] = LINKML_REGISTRY.SchemaInfo - - name: Optional[str] = None - homepage: Optional[Union[str, HttpsIdentifier]] = None - schema_url: Optional[Union[str, HttpsIdentifier]] = None - license: Optional[Union[str, "LicenseEnum"]] = None - description: Optional[str] = None - domain: Optional[str] = None - - def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]): - if self.name is not None and not isinstance(self.name, str): - self.name = str(self.name) - - if self.homepage is not None and not isinstance(self.homepage, HttpsIdentifier): - self.homepage = HttpsIdentifier(self.homepage) - - if self.schema_url is not None and not isinstance(self.schema_url, HttpsIdentifier): - self.schema_url = HttpsIdentifier(self.schema_url) - - if self.license is not None and not isinstance(self.license, LicenseEnum): - self.license = LicenseEnum(self.license) - - if self.description is not None and not isinstance(self.description, str): - self.description = str(self.description) - - if self.domain is not None and not isinstance(self.domain, str): - self.domain = str(self.domain) - - super().__post_init__(**kwargs) - - -# Enumerations -class LicenseEnum(EnumDefinitionImpl): - - _defn = EnumDefinition( - name="LicenseEnum", - ) - - @classmethod - def _addvals(cls): - setattr(cls, "CC-BY", - PermissibleValue(text="CC-BY", - description="CC-BY") ) - setattr(cls, "CC-0", - PermissibleValue(text="CC-0", - description="CC-0") ) - -# Slots -class slots: - pass - -slots.name = Slot(uri=LINKML_REGISTRY.name, name="name", curie=LINKML_REGISTRY.curie('name'), - model_uri=LINKML_REGISTRY.name, domain=None, range=Optional[str]) - -slots.homepage = Slot(uri=LINKML_REGISTRY.homepage, name="homepage", curie=LINKML_REGISTRY.curie('homepage'), - model_uri=LINKML_REGISTRY.homepage, domain=None, range=Optional[Union[str, HttpsIdentifier]]) - -slots.schema_url = Slot(uri=LINKML_REGISTRY.schema_url, name="schema url", curie=LINKML_REGISTRY.curie('schema_url'), - model_uri=LINKML_REGISTRY.schema_url, domain=None, range=Optional[Union[str, HttpsIdentifier]]) - -slots.license = Slot(uri=LINKML_REGISTRY.license, name="license", curie=LINKML_REGISTRY.curie('license'), - model_uri=LINKML_REGISTRY.license, domain=None, range=Optional[Union[str, "LicenseEnum"]]) - -slots.description = Slot(uri=LINKML_REGISTRY.description, name="description", curie=LINKML_REGISTRY.curie('description'), - model_uri=LINKML_REGISTRY.description, domain=None, range=Optional[str]) - -slots.domain = Slot(uri=LINKML_REGISTRY.domain, name="domain", curie=LINKML_REGISTRY.curie('domain'), - model_uri=LINKML_REGISTRY.domain, domain=None, range=Optional[str]) diff --git a/rdf/README.md b/rdf/README.md deleted file mode 100644 index 105f756..0000000 --- a/rdf/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# RDF - -Do not edit the files in here - these are autogenerated from the schema. See the Makefile for details. diff --git a/shex/README.md b/shex/README.md deleted file mode 100644 index 8b8b4ea..0000000 --- a/shex/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# ShEx - -Schema rendered as [ShEx](http://shex.io/shex-semantics/index.html) - Shape Expressions Language - -Do not edit the files in here - these are autogenerated from the schema. See the Makefile for details. - - diff --git a/shex/registry.shex b/shex/registry.shex deleted file mode 100644 index a0b25a4..0000000 --- a/shex/registry.shex +++ /dev/null @@ -1,95 +0,0 @@ -BASE -PREFIX rdf: -PREFIX xsd: -PREFIX linkml: -PREFIX skos: -PREFIX foaf: -PREFIX dcterms: - - - xsd:string - -linkml:String xsd:string - -linkml:Integer xsd:integer - -linkml:Boolean xsd:boolean - -linkml:Float xsd:float - -linkml:Double xsd:double - -linkml:Decimal xsd:decimal - -linkml:Time xsd:dateTime - -linkml:Date xsd:date - -linkml:Datetime xsd:dateTime - -linkml:Uriorcurie IRI - -linkml:Uri IRI - -linkml:Ncname xsd:string - -linkml:Objectidentifier IRI - -linkml:Nodeidentifier NONLITERAL - - { - ( $ ( @linkml:String ? ; - @linkml:Integer ? ; - @linkml:Integer ? ; - @linkml:Integer ? ; - @linkml:Integer ? ; - @linkml:Integer ? ; - @linkml:Float ? ; - @linkml:Float ? ; - @linkml:String * - ) ; - rdf:type [ ] ? - ) -} - - CLOSED { - ( $ ( & ; - rdf:type [ ] ? ; - dcterms:title @linkml:String ? ; - skos:definition @linkml:String ? ; - foaf:homepage @ ? ; - dcterms:source @ ? ; - @linkml:String ? ; - @linkml:String ? ; - dcterms:license @linkml:String ? ; - dcterms:subject @linkml:String * ; - dcterms:subject @linkml:String * ; - @linkml:String ? ; - @linkml:Integer ? ; - @linkml:Integer ? ; - @linkml:Integer ? ; - @linkml:Integer ? ; - @linkml:Integer ? ; - @linkml:Float ? ; - @linkml:Float ? ; - @linkml:String * - ) ; - rdf:type [ ] - ) -} - - CLOSED { - ( $ ( foaf:homepage @ ? - ; - dcterms:hasPart @ * ; - dcterms:license @linkml:String ? ; - dcterms:title @linkml:String ? ; - skos:definition @linkml:String ? ; - dcterms:subject @linkml:String * ; - dcterms:subject @linkml:String * - ) ; - rdf:type [ ] - ) -} - - diff --git a/src/data/models.yaml b/src/data/models.yaml deleted file mode 100644 index f0ead88..0000000 --- a/src/data/models.yaml +++ /dev/null @@ -1,216 +0,0 @@ -name: LinkML-Main-Registry -homepage: https://github.com/linkml/linkml-registry -title: |- - This is the main LinkML registry -entries: - LinkML Model: - homepage: https://linkml.github.io/linkml-model/docs/ - schema_url: https://github.com/linkml/linkml-model/blob/main/model/schema/meta.yaml - github_repo: linkml/linkml-model - schema_relative_path: model/schema/meta.yaml - license: CC-0 - title: LinkML metamodel - topics: - - meta - LinkML Template Configuration Model: - homepage: https://linkml.github.io/template-config-model/ - schema_url: https://github.com/linkml/template-config-model/blob/main/model/schema/config_model.yaml - github_repo: linkml/template-config-model - license: CC-0 - title: LinkML template configuration - topics: - - meta - NMDC: - homepage: https://microbiomedata.github.io/nmdc-schema/ - github_repo: microbiomedata/nmdc-schema - schema_relative_path: src/schema/nmdc.yaml - license: CC-0 - title: National Microbiome Data Collaborative - topics: - - environmental microbiology - Biolink-Model: - homepage: https://biolink.github.io/biolink-model/ - github_repo: biolink/biolink-model - schema_relative_path: biolink-model.yaml - license: CC-0 - title: Biolink Model - topics: - - genomics - - disease - - phenotype - - expression - - GO - - GO-CAM - - human biology - - model organism biology - - biochemistry - - biology - SSSOM: - homepage: https://mapping-commons.github.io/sssom/ - github_repo: mapping-commons/SSSOM - schema_relative_path: model/schema/sssom.yaml - license: CC-0 - title: Simple Standard Sharing Object Mappings - topics: - - information - - mappings - KGCL: - homepage: https://cmungall.github.io/knowledge-graph-change-language/ - schema_url: '' - github_repo: cmungall/knowledge-graph-change-language - schema_relative_path: src/schema/kgcl.yaml - license: CC-0 - title: Knowledge Graph Change Language - topics: - - knowledge graphs - KGViz: - homepage: https://berkeleybop.github.io/kgviz-model/ - schema_url: '' - github_repo: berkeleybop/kgviz-model - schema_relative_path: model/schema/kgviz.yaml - license: CC-0 - title: Knowledge Graph Visualization Configuration - topics: - - visualization - Semantic Sql: - homepage: https://cmungall.github.io/semantic-sql/ - github_repo: cmungall/semantic-sql - schema_relative_path: src/schema/semsql.yaml - license: CC-0 - title: Semantic SQL - topics: - - ontologies - Chemical Entities and Mixtures Model: - homepage: https://chemkg.github.io/chemrof/ - license: CC-0 - github_repo: chemkg/chemrof - schema_relative_path: src/schema/chemrof.yaml - title: Chemistry Schema - topics: - - chemistry - CCDH: - homepage: https://cancerdhc.github.io/ccdhmodel - schema_url: '' - license: CC-0 - github_repo: cancerdhc/ccdhmodel - schema_relative_path: src/schema/ccdhmodel.yaml - title: CRDC-H Model - topics: - - cancer - ontology-associations: - homepage: https://biodatamodels.github.io/ontology-associations/ - schema_url: '' - github_repo: biodatamodels/ontology-associations - schema_relative_path: src/schema/all.yaml - license: CC-0 - title: common association file formats - topics: - - genomics - GFF3: - homepage: https://biodatamodels.github.io/gff-schema/ - schema_url: '' - github_repo: biodatamodels/gff-schema - schema_relative_path: src/schema/gff.yaml - license: CC-0 - title: Genome Feature Format LinkML rendering - topics: - - genomics - Monochrom: - homepage: https://monarch-initiative.github.io/monochrom/ - schema_url: https://github.com/monarch-initiative/monochrom/blob/master/model/schema/chromo.yaml - github_repo: monarch-initiative/monochrom - license: CC-0 - title: Chromosome ontology and ETL - topics: - - genomics - GSC MIxS: - homepage: '' - schema_url: '' - license: '' - title: '' - topics: - - genomics - Babelon: - homepage: https://matentzn.github.io/babelon/ - schema_url: '' - github_repo: matentzn/babelon - license: CC-0 - title: A schema for describing translations and language profiles for ontologies - topics: - - ontologies - HOT-TermCI: - homepage: https://github.com/HOT-Ecosystem/TermCI-model - github_repo: HOT-Ecosystem/TermCI-model - schema_url: '' - schema_relative_path: src/schema/tccm_schema.yaml - license: '' - title: '' - topics: - - clinical - Alliance of Genome Resource Persistent Schema: - title: Alliance of Genome Resources Persistent Schema - description: Alliance Persistent Schema - homepage: '' - schema_url: '' - github_repo: alliance-genome/agr_curation_schema - schema_relative_path: model/schema/allianceModel.yaml - license: https://creativecommons.org/publicdomain/zero/1.0/ - topics: - - genomics - SESAR: - homepage: '' - schema_url: '' - license: '' - title: '' - topics: - - earth science - OBOGraphs: - homepage: '' - schema_url: '' - github_repo: biodatamodels/obograph - license: '' - title: '' - topics: - - ontologies - GHGA Metadata: - homepage: https://ghga-de.github.io/ghga-metadata-schema/ - title: Metadata schema for the German Human Genome-Phenome Archive (GHGA) - github_repo: ghga-de/ghga-metadata-schema - schema_relative_path: src/schema/ghga.yaml - MIANCT: - title: Minimal information about a New Cell Type - homepage: https://cmungall.github.io/mianct-schema/ - github_repo: cmungall/mianct-schema - schema_relative_path: model/schema/mianct.yaml - topics: - - samples - - cell types - iSamples: - homepage: https://github.com/isamplesorg/metadata - github_repo: isamplesorg/metadata - schema_relative_path: iSamplesSchemaBasic0.3.yml - license: https://creativecommons.org/publicdomain/zero/1.0/ - topics: - - samples - - metadata - - earth science - sparqlfun: - homepage: https://github.com/linkml/sparqlfun - github_repo: linkml/sparqlfun - schema_relative_path: sparqlfun/schema/sparqlfun.yaml - license: https://creativecommons.org/publicdomain/zero/1.0/ - topics: - - sparql - - templates - - INCLUDE: - homepage: https://github.com/include-dcc/include-linkml - schema_url: '' - github_repo: include-dcc/include-linkml - license: CC-0 - title: The INvestigation of Co-occurring conditions across the Lifespan to Understand Down syndromE (INCLUDE) data model - topics: - - Ontologies - - Down syndrome - - Clinical research - diff --git a/src/docs/registry.md b/src/docs/registry.md index b8e7a79..c2027b4 100644 --- a/src/docs/registry.md +++ b/src/docs/registry.md @@ -2,7 +2,32 @@ ## LinkML Schema Metamodel -A metamodel for defining linked open data schemas +The metamodel for schemas defined using the Linked Data Modeling Language framework. + +For more information on LinkML: + +* [linkml.io](https://linkml.io) main website +* [specification](https://w3id.org/linkml/docs/specification/) + +LinkML is self-describing. Every LinkML schema consists of elements +that instantiate classes in this metamodel. + +Core metaclasses: + +* [SchemaDefinition](https://w3id.org/linkml/SchemaDefinition) +* [ClassDefinition](https://w3id.org/linkml/ClassDefinition) +* [SlotDefinition](https://w3id.org/linkml/SlotDefinition) +* [TypeDefinition](https://w3id.org/linkml/TypeDefinition) + +There are many subsets of *profiles* of the metamodel, for different purposes: + +* [MinimalSubset](https://w3id.org/linkml/MinimalSubset) +* [BasicSubset](https://w3id.org/linkml/BasicSubset) +* [BasicSubset](https://w3id.org/linkml/BasicSubset) + +For canonical reference documentation on any metamodel construct, +refer to the official URI for each construct, e.g. +[https://w3id.org/linkml/is_a](https://w3id.org/linkml/is_a) |key|value| @@ -12,16 +37,15 @@ A metamodel for defining linked open data schemas |homepage|[https://linkml.github.io/linkml-model/docs/](https://linkml.github.io/linkml-model/docs/)| |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)| |github_repo|linkml/linkml-model| -|schema_relative_path|model/schema/meta.yaml| +|schema_relative_path|linkml_model/model/schema/meta.yaml| |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| |topics|meta| -|class_count|19| -|slot_count|116| -|enum_count|1| -|type_count|14| -|github_stars|10| -|proportion_elements_with_a_description|0.97| -|proportion_elements_mapped|0.28| +|class_count|41| +|slot_count|220| +|enum_count|4| +|type_count|19| +|proportion_elements_with_a_description|0.96| +|proportion_elements_mapped|0.29| ## LinkML template configuration @@ -37,18 +61,16 @@ None |github_repo|linkml/template-config-model| |license|CC-0| |topics|meta| -|github_stars|1| ## NMDC Schema -Schema for National Microbiome Data Collaborative (NMDC). This scheme is organized into 3 separate modules: - -This schema is organized into distinct modules: - +Schema for National Microbiome Data Collaborative (NMDC). +This schema is organized into multiple modules, such as: + * a set of core types for representing data values - * the mixs schema (auto-translated from mixs excel) - * annotation schema - * the NMDC schema itself + * a subset of the mixs schema + * an annotation schema + * the NMDC schema itself, into which the other modules are imported |key|value| @@ -60,13 +82,12 @@ This schema is organized into distinct modules: |schema_relative_path|src/schema/nmdc.yaml| |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| |topics|environmental microbiology| -|class_count|48| -|slot_count|741| -|enum_count|1| -|type_count|18| -|github_stars|5| -|proportion_elements_with_a_description|0.92| -|proportion_elements_mapped|0.04| +|class_count|69| +|slot_count|864| +|enum_count|124| +|type_count|24| +|proportion_elements_with_a_description|0.74| +|proportion_elements_mapped|0.5| ## Biolink Model @@ -82,17 +103,16 @@ Entity and association taxonomy and datamodel for life-sciences data |schema_relative_path|biolink-model.yaml| |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| |topics|genomics; disease; phenotype; expression; GO; GO-CAM; human biology; model organism biology; biochemistry; biology| -|class_count|257| -|slot_count|425| -|enum_count|9| -|type_count|27| -|github_stars|78| -|proportion_elements_with_a_description|0.68| -|proportion_elements_mapped|0.46| +|class_count|302| +|slot_count|460| +|enum_count|19| +|type_count|32| +|proportion_elements_with_a_description|0.72| +|proportion_elements_mapped|0.38| ## Simple Standard Sharing Object Mappings -Datamodel for Simple Standard for Sharing Ontology Mappings (SSSOM) +Datamodel for Simple Standard for Sharing Ontological Mappings (SSSOM) |key|value| @@ -101,16 +121,15 @@ Datamodel for Simple Standard for Sharing Ontology Mappings (SSSOM) |title|Simple Standard Sharing Object Mappings| |homepage|[https://mapping-commons.github.io/sssom/](https://mapping-commons.github.io/sssom/)| |github_repo|mapping-commons/SSSOM| -|schema_relative_path|model/schema/sssom.yaml| +|schema_relative_path|src/sssom_schema/schema/sssom_schema.yaml| |license|CC-0| |topics|information; mappings| -|class_count|2| -|slot_count|49| -|enum_count|5| -|type_count|15| -|github_stars|35| -|proportion_elements_with_a_description|0.92| -|proportion_elements_mapped|0.4| +|class_count|5| +|slot_count|71| +|enum_count|3| +|type_count|20| +|proportion_elements_with_a_description|0.96| +|proportion_elements_mapped|0.39| ## Knowledge Graph Change Language @@ -129,18 +148,20 @@ A data model for describing change operations at a high level on an ontology or |schema_relative_path|src/schema/kgcl.yaml| |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| |topics|knowledge graphs| -|class_count|66| -|slot_count|39| +|class_count|71| +|slot_count|70| |enum_count|2| -|type_count|15| -|github_stars|12| -|proportion_elements_with_a_description|0.73| -|proportion_elements_mapped|0.26| +|type_count|21| +|proportion_elements_with_a_description|0.74| +|proportion_elements_mapped|0.23| ## Knowledge Graph Visualization Configuration -A data model for describing configurations / stylesheets for visualzing graphs, and in particular Knowledge Graphs or Ontologies. These graphs are characterized by having meaningful edge labels, node categories, IDs or URIs on each element, as well as additional rich metadata on the nodes or edges. -An example of a use of this is https://github.com/cmungall/obographviz +A data model for describing configurations / stylesheets for visualzing graphs, and +in particular Knowledge Graphs or Ontologies. These graphs are characterized by having meaningful edge labels, +node categories, IDs or URIs on each element, as well as additional rich metadata on the nodes or edges. + +An example of a use of this is https://github.com/INCATools/obographviz |key|value| @@ -149,16 +170,15 @@ An example of a use of this is https://github.com/cmungall/obographviz |title|Knowledge Graph Visualization Configuration| |homepage|[https://berkeleybop.github.io/kgviz-model/](https://berkeleybop.github.io/kgviz-model/)| |github_repo|berkeleybop/kgviz-model| -|schema_relative_path|model/schema/kgviz.yaml| +|schema_relative_path|src/kgviz_model/linkml/kgviz.yaml| |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| |topics|visualization| |class_count|16| -|slot_count|30| +|slot_count|31| |enum_count|3| -|type_count|16| -|github_stars|4| -|proportion_elements_with_a_description|0.53| -|proportion_elements_mapped|0.27| +|type_count|21| +|proportion_elements_with_a_description|0.57| +|proportion_elements_mapped|0.32| ## Semantic SQL @@ -183,7 +203,7 @@ as well as a rich searchable documentation system and other tooling. This schema is best browsed online: https://cmungall.github.io/semantic-sql/ Note that things are in flux, and there some oddities that need ironed out, see -issues for details +issues for details. See the [github repo](https://github.com/cmungall/semantic-sql) for code to convert from the linkml yaml into SQL DDL @@ -195,14 +215,13 @@ from the linkml yaml into SQL DDL |title|Semantic SQL| |homepage|[https://cmungall.github.io/semantic-sql/](https://cmungall.github.io/semantic-sql/)| |github_repo|cmungall/semantic-sql| -|schema_relative_path|src/schema/semsql.yaml| +|schema_relative_path|src/semsql/linkml/semsql.yaml| |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| |topics|ontologies| -|class_count|98| -|slot_count|23| +|class_count|103| +|slot_count|34| |enum_count|0| -|type_count|16| -|github_stars|10| +|type_count|21| |proportion_elements_with_a_description|0.54| |proportion_elements_mapped|0.27| @@ -227,13 +246,12 @@ For full context/motivation see the [GitHub repo](https://github.com/chemkg/chem |schema_relative_path|src/schema/chemrof.yaml| |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| |topics|chemistry| -|class_count|122| -|slot_count|120| -|enum_count|5| -|type_count|22| -|github_stars|7| -|proportion_elements_with_a_description|0.63| -|proportion_elements_mapped|0.16| +|class_count|126| +|slot_count|217| +|enum_count|9| +|type_count|27| +|proportion_elements_with_a_description|0.54| +|proportion_elements_mapped|0.19| ## CRDC-H Model @@ -246,20 +264,19 @@ None |title|CRDC-H Model| |homepage|[https://cancerdhc.github.io/ccdhmodel](https://cancerdhc.github.io/ccdhmodel)| |github_repo|cancerdhc/ccdhmodel| -|schema_relative_path|src/schema/ccdhmodel.yaml| +|schema_relative_path|model/schema/crdch_model.yaml| |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| |topics|cancer| |class_count|41| |slot_count|0| -|enum_count|108| -|type_count|21| -|github_stars|11| +|enum_count|106| +|type_count|26| |proportion_elements_with_a_description|0.98| -|proportion_elements_mapped|0.12| +|proportion_elements_mapped|0.15| ## common association file formats -Various association data models +None |key|value| @@ -268,16 +285,8 @@ Various association data models |title|common association file formats| |homepage|[https://biodatamodels.github.io/ontology-associations/](https://biodatamodels.github.io/ontology-associations/)| |github_repo|biodatamodels/ontology-associations| -|schema_relative_path|src/schema/all.yaml| |license|CC-0| |topics|genomics| -|class_count|33| -|slot_count|108| -|enum_count|18| -|type_count|25| -|github_stars|4| -|proportion_elements_with_a_description|0.32| -|proportion_elements_mapped|0.23| ## Genome Feature Format LinkML rendering @@ -296,10 +305,9 @@ Playing around with GFF spec |class_count|8| |slot_count|26| |enum_count|3| -|type_count|16| -|github_stars|5| -|proportion_elements_with_a_description|0.64| -|proportion_elements_mapped|0.37| +|type_count|21| +|proportion_elements_with_a_description|0.67| +|proportion_elements_mapped|0.43| ## Chromosome ontology and ETL @@ -315,7 +323,6 @@ None |github_repo|monarch-initiative/monochrom| |license|CC-0| |topics|genomics| -|github_stars|9| ## @@ -340,7 +347,6 @@ None |github_repo|matentzn/babelon| |license|CC-0| |topics|ontologies| -|github_stars|2| ## HOT-TermCI @@ -358,14 +364,13 @@ Terminology Core Common Model |class_count|4| |slot_count|15| |enum_count|0| -|type_count|14| -|github_stars|3| +|type_count|19| |proportion_elements_with_a_description|1.0| -|proportion_elements_mapped|0.84| +|proportion_elements_mapped|0.86| ## Alliance of Genome Resources Persistent Schema -Alliance Schema Prototype +Alliance Persistent Schema |key|value| @@ -376,13 +381,12 @@ Alliance Schema Prototype |schema_relative_path|model/schema/allianceModel.yaml| |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| |topics|genomics| -|class_count|80| -|slot_count|213| -|enum_count|25| -|type_count|15| -|github_stars|3| -|proportion_elements_with_a_description|0.55| -|proportion_elements_mapped|0.08| +|class_count|285| +|slot_count|600| +|enum_count|21| +|type_count|20| +|proportion_elements_with_a_description|0.71| +|proportion_elements_mapped|0.04| ## @@ -404,11 +408,10 @@ None |name|OBOGraphs| |github_repo|biodatamodels/obograph| |topics|ontologies| -|github_stars|4| ## Metadata schema for the German Human Genome-Phenome Archive (GHGA) -The metadata schema for the German Human Genome-Phenome Archive (GHGA). +The submission centric metadata schema for the German Human Genome-Phenome Archive (GHGA). |key|value| @@ -417,14 +420,13 @@ The metadata schema for the German Human Genome-Phenome Archive (GHGA). |title|Metadata schema for the German Human Genome-Phenome Archive (GHGA)| |homepage|[https://ghga-de.github.io/ghga-metadata-schema/](https://ghga-de.github.io/ghga-metadata-schema/)| |github_repo|ghga-de/ghga-metadata-schema| -|schema_relative_path|src/schema/ghga.yaml| +|schema_relative_path|src/schema/submission.yaml| |class_count|26| -|slot_count|45| -|enum_count|0| -|type_count|14| -|github_stars|5| -|proportion_elements_with_a_description|0.97| -|proportion_elements_mapped|0.3| +|slot_count|112| +|enum_count|30| +|type_count|19| +|proportion_elements_with_a_description|0.98| +|proportion_elements_mapped|0.18| ## Minimal Information About a new Cell Type @@ -468,14 +470,13 @@ When should one provide an entry for a cell type in a MIANCT sheet? |class_count|2| |slot_count|11| |enum_count|3| -|type_count|15| -|github_stars|3| -|proportion_elements_with_a_description|0.64| -|proportion_elements_mapped|0.7| +|type_count|20| +|proportion_elements_with_a_description|0.69| +|proportion_elements_mapped|0.75| ## iSamples -Schema for documenting physical samples +None |key|value| @@ -484,16 +485,8 @@ Schema for documenting physical samples |title|iSamples| |homepage|[https://github.com/isamplesorg/metadata](https://github.com/isamplesorg/metadata)| |github_repo|isamplesorg/metadata| -|schema_relative_path|iSamplesSchemaBasic0.3.yml| |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| |topics|samples; metadata; earth science| -|class_count|6| -|slot_count|27| -|enum_count|3| -|type_count|3| -|github_stars|2| -|proportion_elements_with_a_description|0.92| -|proportion_elements_mapped|0.07| ## SPARQLFun @@ -509,11 +502,24 @@ SPARQL Templates |schema_relative_path|sparqlfun/schema/sparqlfun.yaml| |license|[https://creativecommons.org/publicdomain/zero/1.0/](https://creativecommons.org/publicdomain/zero/1.0/)| |topics|sparql; templates| -|class_count|263| -|slot_count|172| +|class_count|92| +|slot_count|61| |enum_count|2| -|type_count|16| -|github_stars|4| -|proportion_elements_with_a_description|0.16| -|proportion_elements_mapped|0.74| +|type_count|21| +|proportion_elements_with_a_description|0.33| +|proportion_elements_mapped|0.34| + +## The INvestigation of Co-occurring conditions across the Lifespan to Understand Down syndromE (INCLUDE) data model + +None + + +|key|value| +| :---: | :---: | +|name|INCLUDE| +|title|The INvestigation of Co-occurring conditions across the Lifespan to Understand Down syndromE (INCLUDE) data model| +|homepage|[https://github.com/include-dcc/include-linkml](https://github.com/include-dcc/include-linkml)| +|github_repo|include-dcc/include-linkml| +|license|CC-0| +|topics|Ontologies; Down syndrome; Clinical research| diff --git a/src/schema/registry.yaml b/src/schema/registry.yaml deleted file mode 100644 index 36ea549..0000000 --- a/src/schema/registry.yaml +++ /dev/null @@ -1,152 +0,0 @@ -id: https://w3id.org/linkml_registry -name: linkml_registry -title: Schema for LinkML Schema Registry -description: |- - Datamodel for LinkML Registry and evaluation framework - -imports: -- linkml:types -prefixes: - linkml: https://w3id.org/linkml/ - linkml_registry: https://w3id.org/linkml_registry - skos: http://www.w3.org/2004/02/skos/core# - OIO: http://www.geneontology.org/formats/oboInOwl# - pav: http://purl.org/pav/ - oslc: http://open-services.net/ns/core# - schema: http://schema.org/ - bibo: http://purl.org/ontology/bibo/ - foaf: http://xmlns.com/foaf/0.1/ - dcat: http://www.w3.org/ns/dcat# - doap: http://usefulinc.com/ns/doap# - -default_prefix: linkml_registry -types: - https identifier: - typeof: string -classes: - schema registry: - slots: - - name - - homepage - - entries - - license - - title - - description - - domain - - topics - schema metadata: - mixins: - - evaluation - slots: - - name - - title - - description - - homepage - - schema url - - github repo - - schema relative path - - license - - domain - - topics - slot_usage: {} - evaluation: - mixin: true - attributes: - score: - class_count: - is_a: count statistic - slot_count: - is_a: count statistic - enum_count: - is_a: count statistic - type_count: - is_a: count statistic - github stars: - is_a: count statistic - proportion elements with a description: - is_a: proportion statistic - proportion elements mapped: - is_a: proportion statistic - errors: - multivalued: true -slots: - name: - range: string - examples: - - value: HOT-TermCI - identifier: true - slot_uri: rdfs:label - base purl: - range: uriorcurie - schema purl: - range: uriorcurie - homepage: - range: https identifier - examples: - - value: https://github.com/HOT-Ecosystem/TermCI-model - slot_uri: foaf:homepage - recommended: true - schema url: - range: https identifier - examples: - - value: https://w3id.org/biolink/ - slot_uri: dcterms:source - github repo: - examples: - - value: linkml/linkml-registry - recommended: true - issue tracker: - slot_uri: doap:bug-database - license: - #range: license_enum - recommended: true - slot_uri: dcterms:license - examples: - - value: CC-0 - title: - description: the official title of the schema - slot_uri: dcterms:title - recommended: true - description: - range: string - slot_uri: skos:definition - examples: - - value: Genome Feature Format LinkML rendering - recommended: true - domain: - range: string - examples: - - value: clinical - slot_uri: dcterms:subject - multivalued: true - topics: - range: string - examples: - - value: clinical - slot_uri: dcterms:subject - multivalued: true - entries: - range: schema metadata - inlined: true - multivalued: true - slot_uri: dcterms:hasPart - score: - range: integer - github stars: - range: integer - schema relative path: - statistic: - count statistic: - range: integer - proportion statistic: - range: float -enums: - license_enum: - permissible_values: - CC-BY-v4: - description: CC-BY - meaning: http://creativecommons.org/licenses/by/4.0/ - CC-0-v1: - description: CC-0 - meaning: https://creativecommons.org/publicdomain/zero/1.0/ -