Skip to content
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

gen_project doesn't like the name of my schema file generated by schema sheets. #122

Open
amc-corey-cox opened this issue Aug 29, 2024 · 3 comments

Comments

@amc-corey-cox
Copy link
Contributor

Running make setup fails when I get to gen-project at this line:

poetry run gen-project --config-file config.yaml -d project src/sepio_linkml/schema/sepio_linkml.yaml && mv project/*.py src/"sepio_linkml"/datamodel

It appears that it doesn't like the filename generated by schemasheets which is based on the name of the tab in my google sheet.

@amc-corey-cox
Copy link
Contributor Author

Here is the full traceback.

poetry run gen-project --config-file config.yaml -d project src/sepio_linkml/schema/sepio_linkml.yaml && mv project/*.py src/"sepio_linkml"/datamodel
Traceback (most recent call last):
  File "/home/corey/Code/sepio-linkml/.venv/bin/gen-project", line 8, in <module>
    sys.exit(cli())
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/linkml/generators/projectgen.py", line 257, in cli
    gen.generate(yamlfile, project_config)
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/linkml/generators/projectgen.py", line 138, in generate
    gen = gen_cls(local_path, **all_gen_args)
  File "<string>", line 24, in __init__
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/linkml/utils/generator.py", line 204, in __post_init__
    self._initialize_using_schemaloader(schema)
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/linkml/utils/generator.py", line 251, in _initialize_using_schemaloader
    loader.resolve()
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/linkml/utils/schemaloader.py", line 120, in resolve
    import_schemadefinition = load_raw_schema(
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/linkml/utils/rawloader.py", line 73, in load_raw_schema
    schema = yaml_loader.load(
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/linkml_runtime/loaders/loader_root.py", line 76, in load
    results = self.load_any(*args, **kwargs)
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/linkml_runtime/loaders/yaml_loader.py", line 42, in load_any
    return self._construct_target_class(data_as_dict, target_class)
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/linkml_runtime/loaders/loader_root.py", line 137, in _construct_target_class
    return target_class(**data_as_dict)
  File "<string>", line 68, in __init__
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/linkml_runtime/linkml_model/meta.py", line 561, in __post_init__
    self.name = SchemaDefinitionName(self.name)
  File "/home/corey/Code/sepio-linkml/.venv/lib/python3.10/site-packages/linkml_runtime/utils/metamodelcore.py", line 63, in __init__
    raise ValueError(f"{TypedNode.yaml_loc(v)}{v}: Not a valid NCName")
ValueError: File "release_subset_v1.yaml", line 1, col 7: SEPIO Model: Not a valid NCName
make: *** [Makefile:125: gen-project] Error 1

@amc-corey-cox
Copy link
Contributor Author

This may be related to #57

@amc-corey-cox
Copy link
Contributor Author

I was wrong about where the problem was... It is actually my Schema being named SEPIO Model in part of the configuration. It seems like if this is an issue we should warn about the problem in Schema-sheets or handle this better here.

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