From d4493146b5a2fe54dc28aa8db6c5e2c597417c42 Mon Sep 17 00:00:00 2001 From: sneakers-the-rat Date: Wed, 11 Oct 2023 20:09:22 -0700 Subject: [PATCH] give language elements a schema annotation --- nwb_linkml/src/nwb_linkml/adapters/namespaces.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nwb_linkml/src/nwb_linkml/adapters/namespaces.py b/nwb_linkml/src/nwb_linkml/adapters/namespaces.py index 71fba06..dc3cd65 100644 --- a/nwb_linkml/src/nwb_linkml/adapters/namespaces.py +++ b/nwb_linkml/src/nwb_linkml/adapters/namespaces.py @@ -10,7 +10,7 @@ from typing import List, Optional, Dict from pathlib import Path from pydantic import BaseModel, Field, validator, PrivateAttr 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 time import sleep from copy import copy @@ -97,6 +97,10 @@ class NamespacesAdapter(Adapter): # add in monkeypatch nwb types 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']) nwb_lang.name = lang_schema_name sch_result.schemas.append(nwb_lang)