Skip to content

schemaview.py: namespaces function gives different results if imports have not been processed #2938

@ialarmedalien

Description

@ialarmedalien

name: Bug report
about: schemaview.py's namespaces function
title: 'schemaview.py: namespaces function gives different results if imports have not been processed'
labels: bug
assignees: 'ialarmedalien'


Describe the bug

The namespaces function in schemaview.py gives different results, depending on whether or not a function has been executed that processes the imports closure. If namespaces is run directly after initialising a SchemaView instance, the prefixes from any imported schemas will not show up in the schema namespaces. Unfortunately, the results of this function are cached, so subsequent calls to namespaces will not be updated with the imported prefixes.

PR to add tests for the namespaces function:

https://github.com/linkml/linkml-runtime/pull/472/files

Assuming that this is a bug and not a feature, a fix is simple to implement.

Metadata

Metadata

Assignees

Labels

bugSomething that should work but isn't, with an example and a test case.schemaview

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions