linkml / linkml

Linked Open Data Modeling Language
https://linkml.io/linkml
Other
298 stars 90 forks source link

linkml-sqldb dump doesn't work when using --module argument #813

Closed turbomam closed 1 year ago

turbomam commented 2 years ago

I can't seem to get linkml-sqldb dump to work with the --module argument. It says

UnboundLocalError: local variable 'sv' referenced before assignment

It does work with the --schema argument

See the problematic_sqlite rule in https://github.com/turbomam/linkml-abuse/blob/main/Makefile

I think that's coming from linkml.utils.sqlutils.dump

See also https://monarchinitiative.slack.com/archives/C01LDTVURH9/p1652987387692819

cmungall commented 2 years ago

We should definitely improve the reporting, but I think this works if you specify schema and module or module and target class

just specifying module alone gives insufficient information to know what the top level class to instantiate is

turbomam commented 2 years ago

Thanks. Under what circumstances would it be beneficial to specify the schema and the module (since you can do it with the schema alone)?

I'll try module and target class.

cmungall commented 2 years ago

You may wish to avoid the compilation step, perhaps you have dataclasses or pydantic generated some other way. Rare though