Skip to content

document how the nmdc-schema behaves with the different linkml generators #2362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
turbomam opened this issue Mar 7, 2025 · 4 comments
Open
Assignees

Comments

@turbomam
Copy link
Member

turbomam commented Mar 7, 2025

@turbomam turbomam self-assigned this Mar 7, 2025
@turbomam
Copy link
Member Author

turbomam commented Mar 7, 2025

Under linkml 1.8.7

These complete without errors

The suitability of the outputs hasn't been thoroughly tested

  • poetry run linkml generate csv src/schema/nmdc.yaml > nmdc.csv
  • poetry run linkml generate doc --directory nmdc_doc src/schema/nmdc.yaml
  • poetry run linkml generate golr-views --dir nmdc_golr_views src/schema/nmdc.yaml
  • poetry run linkml generate java --output-directory nmdc_java src/schema/nmdc.yaml
  • poetry run linkml generate json-schema src/schema/nmdc.yaml > nmdc.schema.json
  • poetry run linkml generate linkml src/schema/nmdc.yaml > nmdc.json
  • poetry run linkml generate markdown --dir nmdc_markdown src/schema/nmdc.yaml
  • poetry run linkml generate proto src/schema/nmdc.yaml > nmdc.proto
  • poetry run linkml generate pydantic src/schema/nmdc.yaml > nmdc.pydantic.py
  • poetry run linkml generate shacl src/schema/nmdc.yaml > nmdc.shacl.ttl
  • poetry run linkml generate sparql --dir nmdc_sparql src/schema/nmdc.yaml
  • poetry run linkml generate sssom --output nmdc.sssom.tsv src/schema/nmdc.yaml
  • poetry run linkml generate summary src/schema/nmdc.yaml > nmdc.summary.tsv
  • poetry run linkml generate shex src/schema/nmdc.yaml > nmdc.shexc

@turbomam
Copy link
Member Author

turbomam commented Mar 7, 2025

These complete and generate output but emit warnings

Not all errors are shown

poetry run linkml generate jsonld-context src/schema/nmdc.yaml > nmdc.context.json

WARNING:linkml.utils.generator:Unrecognized prefix: GENEPIO
WARNING:linkml.utils.generator:Unrecognized prefix: OMIT

poetry run linkml generate namespaces src/schema/nmdc.yaml > nmdc.namespaces.py

WARNING:linkml.utils.generator:Unrecognized prefix: GENEPIO
WARNING:linkml.utils.generator:Unrecognized prefix: OMIT

poetry run linkml generate prefix-map src/schema/nmdc.yaml

WARNING:linkml.utils.generator:Unrecognized prefix: GENEPIO
WARNING:linkml.utils.generator:Unrecognized prefix: OMIT

poetry run linkml generate python src/schema/nmdc.yaml > nmdc.dataclasses.py

WARNING:linkml.utils.generator:Unrecognized prefix: GENEPIO
WARNING:linkml.utils.generator:Unrecognized prefix: OMIT

poetry run linkml generate golang src/schema/nmdc.yaml

WARNING:linkml.generators.golanggen:Unknown type.base: uriorcurie

poetry run linkml generate typescript src/schema/nmdc.yaml

WARNING:linkml.generators.typescriptgen:Unknown type.base: uriorcurie

poetry run linkml generate sqla src/schema/nmdc.yaml

ERROR:linkml.generators.sqltablegen:UNKNOWN range base: None for gold_sequencing_project_identifiers = external_identifier

poetry run linkml generate sqltables src/schema/nmdc.yaml

ERROR:linkml.generators.sqltablegen:UNKNOWN range base: None for gold_sequencing_project_identifiers = external_identifier

poetry run linkml generate excel --output nmdc.xlsx src/schema/nmdc.yaml

WARNING:linkml.generators.excelgen:'FileTypeEnum' has permissible values with total length > 255 characters. Dropdowns may not work properly in /home/mark/gitrepos/nmdc-schema/nmdc.xlsx
/home/mark/gitrepos/nmdc-schema/.venv/lib/python3.11/site-packages/openpyxl/workbook/child.py:99: UserWarning: Title is more than 31 characters. Some applications may not be able to read the file warnings.warn("Title is more than 31 characters. Some applications may not be able to read the file")

poetry run linkml generate graphql src/schema/nmdc.yaml > nmdc.graphql
409 lines about

  • "contains a character illegal in GraphQL, the resulting encoded name is"
  • "starts with digit (illegal GraphQL), it has been prefixed with '__', resulting in "

@turbomam
Copy link
Member Author

turbomam commented Mar 7, 2025

diagramming tools

The output from some of these may fail to render if an element has whitespace in its name

poetry run linkml generate graphviz --directory nmdc_graphviz src/schema/nmdc.yaml

dot: graph is too large for cairo-renderer bitmaps. Scaling by 0.260961 to fit

Many resulting PNGs are so wide as to be illegible even at 100% (when that exceeds one screen's width)

poetry run linkml generate owl src/schema/nmdc.yaml > nmdc.owl.ttl

WARNING:linkml.generators.owlgen:ignoring equals_string=award_doi as unable to tell if literal
WARNING:linkml.generators.owlgen:Null expr in: [None, None] for http://www.w3.org/2002/07/owl#unionOf None

poetry run linkml generate erdiagram --classes Study src/schema/nmdc.yaml > nmdc.study.erdiagram.md

  • probably not realisitic to generate a diagram with the whole nmdc-schema
  • Study renders at https://mermaid.live/
  • --format [markdown|mermaid]
poetry run linkml generate plantuml \
    --classes Study --directory nmdc_pantuml src/schema/nmdc.yaml > nmdc.study.puml
  • probably not realisitic to generate a digarm with the whole nmdc-schema
  • Study renders at https://www.plantuml.com/plantuml/uml/
  • --format [puml|plantuml|png|pdf|jpg|json|svg]
  • --directory mode with no --class constraint: ERROR:linkml.utils.generator:Request-URI Too Large accessing
  • the name of the generated file is based on the last specified class when multiple classes are specified
poetry run linkml generate yuml \
    --classes Study --classes Doi --format pdf --directory nmdc_yuml src/schema/nmdc.yaml
  • the default output is a https://yuml.me/ URL
  • --format [yuml|png|pdf|jpg|json|svg]
  • uses https://yuml.me/ ? or kroki ? to render other formats
  • generates svg when --format yuml and a directory are specified
  • the name of the generated file is based on the last specified class when multiple classes are specified

@turbomam
Copy link
Member Author

turbomam commented Mar 7, 2025

these error out

poetry run linkml generate dbml --schema src/schema/nmdc.yaml

FileNotFoundError: [Errno 2] No such file or directory: '/home/mark/gitrepos/nmdc-schema/mixs.yaml'

poetry run linkml generate terminusdb src/schema/nmdc.yaml

  /home/mark/gitrepos/nmdc-schema/.venv/lib/python3.11/site-packages/linkml/generators/terminusdbgen.py:71: UserWarning: terminusdb_client is not a requirement of this package, please install it separately
  warnings.warn("terminusdb_client is not a requirement of this package, please install it separately")
  AttributeError: 'str' object has no attribute 'subsets'

poetry run linkml generate yaml src/schema/nmdc.yaml

	yaml.representer.RepresenterError: ('cannot represent an object', JsonObj(workflow_execution_id=StructuredAlias({
	  'literal_form': 'workflow_execution_id',
	  'predicate': AliasPredicateEnum(text='NARROW_SYNONYM', meaning='http://www.w3.org/2004/02/skos/core#narrowerMatch'),
	  'contexts': ['https://bitbucket.org/berkeleylab/jgi-jat/macros/nmdc_metadata.yaml']
	}), data_object_id=StructuredAlias({
	  'literal_form': 'data_object_id',
	  'predicate': AliasPredicateEnum(text='NARROW_SYNONYM', meaning='http://www.w3.org/2004/02/skos/core#narrowerMatch'),
	  'contexts': ['https://bitbucket.org/berkeleylab/jgi-jat/macros/nmdc_metadata.yaml']
	})))

poetry run linkml generate jsonld src/schema/nmdc.yaml

ValueError: File "core.yaml", line 1676, col 9: Unknown CURIE prefix: GENEPIO

poetry run linkml generate rdf src/schema/nmdc.yaml

ValueError: File "core.yaml", line 1676, col 9: Unknown CURIE prefix: GENEPIO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant