cidgoh / DataHarmonizer

A standardized browser-based spreadsheet editor and validator that can be run offline and locally, and which includes templates for SARS-CoV-2 and Monkeypox sampling data. This project, created by the Centre for Infectious Disease Genomics and One Health (CIDGOH), at Simon Fraser University, is now an open-source collaboration with contributions from the National Microbiome Data Collaborative (NMDC), the LinkML development team, and others.
MIT License
91 stars 25 forks source link

Template undefined not found! (latest NMDC DH LinkML file vs linkml datastructure branch) #280

Closed turbomam closed 2 years ago

turbomam commented 2 years ago

I just

When I opened linkml.html, the following appeared in the Template status box:

Template undefined not found!

And when I clicked on the Template status box, I got an empty Change Template pull down menu

ddooley commented 2 years ago

Yes, the very latest commit leaves some broken things. I'll get the menu system back in order shortly. If you walk it back to previous commit you will see menu working, but none of the global variables have been eliminated, or any API work which is what the latest WIP commit has in it.

turbomam commented 2 years ago

OK. I can wait. Thanks.

turbomam commented 2 years ago

I just fetched and pulled and am trying to run make all.

It's been on cd template/MIxS ; python ../../script/linkml.py --input ../../template/MIxS/source/mixs.yaml for 8 minutes now

ddooley commented 2 years ago

Hmm, I'm just trying it too. I see from a run I started last night that it has an error of some kind on the /nmdc_dh.yaml file. It seems to get through the MIxS mixs.yaml spec no problem. Something to do with adding "rank"?

Key error is: ValueError: Unknown argument: rank = 1

cd template/nmdc_dh ; python ../../script/linkml.py --input ../../template/nmdc_dh/source/nmdc_dh.yaml
Loading LinkML specification for ../../template/nmdc_dh/source/nmdc_dh.yaml
Traceback (most recent call last):
  File "../../script/linkml.py", line 75, in <module>
    mixs_sv = SchemaView(options.linkml_file)
  File "/Users/damion/anaconda3/lib/python3.7/site-packages/linkml_runtime/utils/schemaview.py", line 99, in __init__
    schema = load_schema_wrap(schema)
  File "/Users/damion/anaconda3/lib/python3.7/site-packages/linkml_runtime/utils/schemaview.py", line 54, in load_schema_wrap
    schema = yaml_loader.load(path, target_class=SchemaDefinition, **kwargs)
  File "/Users/damion/anaconda3/lib/python3.7/site-packages/linkml_runtime/loaders/yaml_loader.py", line 23, in load
    metadata=metadata)
  File "/Users/damion/anaconda3/lib/python3.7/site-packages/linkml_runtime/loaders/loader_root.py", line 62, in load_source
    target_class(**as_dict(data_as_dict)) if data_as_dict is not None else None
  File "<string>", line 48, in __init__
  File "/Users/damion/anaconda3/lib/python3.7/site-packages/linkml_runtime/linkml_model/meta.py", line 390, in __post_init__
    self._normalize_inlined_as_dict(slot_name="slots", slot_type=SlotDefinition, key_name="name", keyed=True)
  File "/Users/damion/anaconda3/lib/python3.7/site-packages/linkml_runtime/utils/yamlutils.py", line 100, in _normalize_inlined_as_dict
    self._normalize_inlined(slot_name, slot_type, key_name, keyed, False)
  File "/Users/damion/anaconda3/lib/python3.7/site-packages/linkml_runtime/utils/yamlutils.py", line 200, in _normalize_inlined
    form_1({k: v})
  File "/Users/damion/anaconda3/lib/python3.7/site-packages/linkml_runtime/utils/yamlutils.py", line 153, in form_1
    order_up(key, slot_type(**as_dict(raw_obj)))
  File "<string>", line 69, in __init__
  File "/Users/damion/anaconda3/lib/python3.7/site-packages/linkml_runtime/linkml_model/meta.py", line 736, in __post_init__
    super().__post_init__(**kwargs)
  File "/Users/damion/anaconda3/lib/python3.7/site-packages/linkml_runtime/linkml_model/meta.py", line 544, in __post_init__
    super().__post_init__(**kwargs)
  File "/Users/damion/anaconda3/lib/python3.7/site-packages/linkml_runtime/linkml_model/meta.py", line 309, in __post_init__
    super().__post_init__(**kwargs)
  File "/Users/damion/anaconda3/lib/python3.7/site-packages/linkml_runtime/utils/yamlutils.py", line 48, in __post_init__
    raise ValueError('\n'.join(messages))
ValueError:  Unknown argument: rank = 1
make: *** [template/nmdc_dh/schema.js] Error 1
ddooley commented 2 years ago

Its pretty quick to get to this error though for me, just seconds. Do you folks have an updated nmdc_dh.yaml file? BTW I haven't touched Makefile or linkml.py . I'll take a peek at this in a few hours.

turbomam commented 2 years ago

Key error is: ValueError: Unknown argument: rank = 1

Thanks. That is a newsish term in the meta-modelling language. You shouldn't get any more errors like that if you update linkml in your environment.

turbomam commented 2 years ago

running script/linkml.py against our nmdc_dh.yaml file works now. Thanks.