mirror of
https://github.com/p2p-ld/nwb-linkml.git
synced 2024-11-10 00:34:29 +00:00
fix JsonObj bug https://github.com/linkml/linkml/issues/1665
This commit is contained in:
parent
d4493146b5
commit
38d83f3279
3 changed files with 5 additions and 4 deletions
|
@ -97,10 +97,10 @@ class NamespacesAdapter(Adapter):
|
||||||
|
|
||||||
# add in monkeypatch nwb types
|
# add in monkeypatch nwb types
|
||||||
nwb_lang = copy(NwbLangSchema)
|
nwb_lang = copy(NwbLangSchema)
|
||||||
nwb_lang.annotations = {
|
nwb_lang.annotations.update({
|
||||||
'is_namespace': Annotation(tag='is_namespace', value= 'False'),
|
'is_namespace': Annotation(tag='is_namespace', value= 'False'),
|
||||||
'namespace': Annotation(tag='namespace', value= ns.name)
|
'namespace': Annotation(tag='namespace', value= ns.name)
|
||||||
}
|
})
|
||||||
lang_schema_name = '.'.join([ns.name, 'nwb.language'])
|
lang_schema_name = '.'.join([ns.name, 'nwb.language'])
|
||||||
nwb_lang.name = lang_schema_name
|
nwb_lang.name = lang_schema_name
|
||||||
sch_result.schemas.append(nwb_lang)
|
sch_result.schemas.append(nwb_lang)
|
||||||
|
|
|
@ -67,6 +67,7 @@ NwbLangSchema = SchemaDefinition(
|
||||||
classes=[Arraylike, AnyType],
|
classes=[Arraylike, AnyType],
|
||||||
types=DTypeTypes,
|
types=DTypeTypes,
|
||||||
imports=['linkml:types'],
|
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': ''}]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -384,7 +384,7 @@ class LinkMLProvider(Provider):
|
||||||
# write schemas to yaml files
|
# write schemas to yaml files
|
||||||
build_result = {}
|
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:
|
for ns_linkml in namespace_sch:
|
||||||
version = ns_adapter.versions[ns_linkml.name]
|
version = ns_adapter.versions[ns_linkml.name]
|
||||||
version_path = self.namespace_path(ns_linkml.name, version, allow_repo=False)
|
version_path = self.namespace_path(ns_linkml.name, version, allow_repo=False)
|
||||||
|
|
Loading…
Reference in a new issue