give language elements a schema annotation

This commit is contained in:
sneakers-the-rat 2023-10-11 20:09:22 -07:00
parent d9d62618bc
commit d4493146b5

View file

@ -10,7 +10,7 @@ from typing import List, Optional, Dict
from pathlib import Path from pathlib import Path
from pydantic import BaseModel, Field, validator, PrivateAttr from pydantic import BaseModel, Field, validator, PrivateAttr
from pprint import pformat from pprint import pformat
from linkml_runtime.linkml_model import SchemaDefinition from linkml_runtime.linkml_model import SchemaDefinition, Annotation
from linkml_runtime.dumpers import yaml_dumper from linkml_runtime.dumpers import yaml_dumper
from time import sleep from time import sleep
from copy import copy from copy import copy
@ -97,6 +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 = {
'is_namespace': Annotation(tag='is_namespace', value= 'False'),
'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)