-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Describe the bug
I use the following LinkML snippet, which imports hctl
and wot_security
as local LinkML yaml files.
imports:
- linkml:types
- hctl
- wot_security
classes:
Thing:
tree_root: true
class_uri: td:Thing
attributes:
securityDefinitions:
description: >-
A security scheme applied to a (set of) affordance(s).
from_schema: td:hasSecurityConfiguration
required: true
multivalued: true
any_of:
- range: string
- range: wot_security:SecuritySchemeType
links:
from_schema: td:hasLink
description: >-
Provides Web links to arbitrary resources that relate to the specified Thing Description.
multivalued: true
range: hctl:Link
I noticed LinkML does not like the prefixing to the imports for specifying the Range
. However, the error messages produced are inconsistent. For range: hctl:Link
I get the following error:
ValueError: File "thing_description.yaml", line 363, col 16 slot: thing__links - unrecognized range (hctl:Link)
However, for range: wot_security:SecuritySchemeType
, the error message is completely vague:
AttributeError: 'NoneType' object has no attribute 'from_schema'
To Reproduce
My environment is as follows:
python = 3.11
linkml-runtime = 1.8.0rc2
linkml = 1.8.0rc2
Expected behavior
I expect the error messages for the same problem to be consistent and meaningful, because digging the issue becomes cumbersome.
Code snippets
I generate the documents using the python class as follows:
doc_generator = DocGenerator('resources/schemas/thing_description.yaml', mergeimports=False)
doc_generator.serialize(directory=str(DOCDIR))