This commit is contained in:
sneakers-the-rat 2023-10-11 20:42:27 -07:00
parent d4493146b5
commit 38d83f3279
3 changed files with 5 additions and 4 deletions

View file

@ -97,10 +97,10 @@ class NamespacesAdapter(Adapter):
# add in monkeypatch nwb types
nwb_lang = copy(NwbLangSchema)
nwb_lang.annotations = {
nwb_lang.annotations.update({
'is_namespace': Annotation(tag='is_namespace', value= 'False'),
'namespace': Annotation(tag='namespace', value= ns.name)
}
})
lang_schema_name = '.'.join([ns.name, 'nwb.language'])
nwb_lang.name = lang_schema_name
sch_result.schemas.append(nwb_lang)

View file

@ -67,6 +67,7 @@ NwbLangSchema = SchemaDefinition(
classes=[Arraylike, AnyType],
types=DTypeTypes,
imports=['linkml:types'],
prefixes={'linkml': Prefix('linkml','https://w3id.org/linkml')}
prefixes={'linkml': Prefix('linkml','https://w3id.org/linkml')},
annotations=[{'tag': 'is_namespace', 'value': False}, {'tag': 'namespace', 'value': ''}]
)

View file

@ -384,7 +384,7 @@ class LinkMLProvider(Provider):
# write schemas to yaml files
build_result = {}
namespace_sch = [sch for sch in built.schemas if sch.annotations.get('is_namespace', False) and sch.annotations['is_namespace'].value == 'True']
namespace_sch = [sch for sch in built.schemas if 'is_namespace' in sch.annotations and sch.annotations['is_namespace'].value == 'True']
for ns_linkml in namespace_sch:
version = ns_adapter.versions[ns_linkml.name]
version_path = self.namespace_path(ns_linkml.name, version, allow_repo=False)