Skip to content

Commit

Permalink
Update linkml-model to 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pkalita-lbl committed Sep 1, 2023
1 parent 8a8ee69 commit 5cff4fc
Show file tree
Hide file tree
Showing 41 changed files with 3,388 additions and 1,874 deletions.
13 changes: 8 additions & 5 deletions linkml_runtime/linkml_model/annotations.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Auto generated from annotations.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-07-14T00:57:14
# Generation date: 2023-09-01T13:21:10
# Schema: annotations
#
# id: https://w3id.org/linkml/annotations
# description: Annotations mixin
# license: https://creativecommons.org/publicdomain/zero/1.0/

import dataclasses
import sys
import re
from jsonasobj2 import JsonObj, as_dict
from typing import Optional, List, Union, Dict, ClassVar, Any
Expand All @@ -21,8 +20,8 @@
from linkml_runtime.utils.enumerations import EnumDefinitionImpl
from rdflib import Namespace, URIRef
from linkml_runtime.utils.curienamespace import CurieNamespace
from .extensions import Extension, ExtensionTag
from .types import String, Uriorcurie
from .extensions import AnyValue, Extension, ExtensionTag
from .types import Uriorcurie
from linkml_runtime.utils.metamodelcore import URIorCURIE

metamodel_version = "1.7.0"
Expand Down Expand Up @@ -76,7 +75,7 @@ class Annotation(Extension):
class_model_uri: ClassVar[URIRef] = LINKML.Annotation

tag: Union[str, AnnotationTag] = None
value: str = None
value: Union[dict, AnyValue] = None
annotations: Optional[Union[Dict[Union[str, AnnotationTag], Union[dict, "Annotation"]], List[Union[dict, "Annotation"]]]] = empty_dict()

def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
Expand All @@ -94,4 +93,8 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):


# Slots
class slots:
pass

slots.annotations = Slot(uri=LINKML.annotations, name="annotations", curie=LINKML.curie('annotations'),
model_uri=LINKML.annotations, domain=None, range=Optional[Union[Dict[Union[str, AnnotationTag], Union[dict, "Annotation"]], List[Union[dict, "Annotation"]]]])
24 changes: 15 additions & 9 deletions linkml_runtime/linkml_model/extensions.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Auto generated from extensions.yaml by pythongen.py version: 0.9.0
# Generation date: 2022-07-14T00:57:16
# Generation date: 2023-09-01T13:21:14
# Schema: extensions
#
# id: https://w3id.org/linkml/extensions
# description: Extension mixin
# license: https://creativecommons.org/publicdomain/zero/1.0/

import dataclasses
import sys
import re
from jsonasobj2 import JsonObj, as_dict
from typing import Optional, List, Union, Dict, ClassVar, Any
Expand All @@ -21,7 +20,7 @@
from linkml_runtime.utils.enumerations import EnumDefinitionImpl
from rdflib import Namespace, URIRef
from linkml_runtime.utils.curienamespace import CurieNamespace
from .types import String, Uriorcurie
from .types import Uriorcurie
from linkml_runtime.utils.metamodelcore import URIorCURIE

metamodel_version = "1.7.0"
Expand All @@ -42,6 +41,8 @@ class ExtensionTag(URIorCURIE):
pass


AnyValue = Any

@dataclass
class Extension(YAMLRoot):
"""
Expand All @@ -55,7 +56,7 @@ class Extension(YAMLRoot):
class_model_uri: ClassVar[URIRef] = LINKML.Extension

tag: Union[str, ExtensionTag] = None
value: str = None
value: Union[dict, AnyValue] = None
extensions: Optional[Union[Dict[Union[str, ExtensionTag], Union[dict, "Extension"]], List[Union[dict, "Extension"]]]] = empty_dict()

def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
Expand All @@ -64,11 +65,6 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if not isinstance(self.tag, ExtensionTag):
self.tag = ExtensionTag(self.tag)

if self._is_empty(self.value):
self.MissingRequiredField("value")
if not isinstance(self.value, str):
self.value = str(self.value)

self._normalize_inlined_as_dict(slot_name="extensions", slot_type=Extension, key_name="tag", keyed=True)

super().__post_init__(**kwargs)
Expand Down Expand Up @@ -98,4 +94,14 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):


# Slots
class slots:
pass

slots.extensions = Slot(uri=LINKML.extensions, name="extensions", curie=LINKML.curie('extensions'),
model_uri=LINKML.extensions, domain=None, range=Optional[Union[Dict[Union[str, ExtensionTag], Union[dict, Extension]], List[Union[dict, Extension]]]])

slots.extension_tag = Slot(uri=LINKML.tag, name="extension_tag", curie=LINKML.curie('tag'),
model_uri=LINKML.extension_tag, domain=Extension, range=Union[str, ExtensionTag])

slots.extension_value = Slot(uri=LINKML.value, name="extension_value", curie=LINKML.curie('value'),
model_uri=LINKML.extension_value, domain=Extension, range=Union[dict, AnyValue])
Loading

0 comments on commit 5cff4fc

Please sign in to comment.