biolink / biolinkml

DEPRECATED: replaced by linkml
https://github.com/linkml/linkml
Creative Commons Zero v1.0 Universal
23 stars 12 forks source link

default_range is not applied for slots defined within slot_usage #213

Closed cmungall closed 3 years ago

cmungall commented 4 years ago

blml allows slots to be defined on the fly in slot usage (todo: document this)

the following creates an odd error:

id: t

license: https://creativecommons.org/publicdomain/zero/1.0/
version: 0.0.1

prefixes:
  t: http://w3id.org/t
  biolinkml: https://w3id.org/biolink/biolinkml/

default_prefix: t
default_range: string

imports:
  - biolinkml:types

classes:
  a:
    slot_usage:
      my slot:
        description: >-
          my slot

error:

  File "/Users/cjm/repos/ontology-change-language/venv/lib/python3.7/site-packages/biolinkml/utils/schemasynopsis.py", line 205, in errors
    rval += [f"\tUndefined type references: {', '.join(undefined_types)}"]
TypeError: sequence item 0: expected str instance, NoneType found

this error is fixed by adding an explicit range declaration