示例#1
0
 def test_basics(self):
     BFO = CurieNamespace('bfo', "http://purl.obolibrary.org/obo/BFO_")
     self.assertEqual(URIRef("http://purl.obolibrary.org/obo/BFO_test"),
                      BFO.test)
     self.assertEqual("http://purl.obolibrary.org/obo/BFO_", BFO)
     self.assertEqual("bfo:test", BFO.curie('test'))
     self.assertEqual("bfo:", BFO.curie())
示例#2
0
            self.id2 = NodeIdentifier(self.id2)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.id = Slot(uri=M.id,
                name="id",
                curie=M.curie('id'),
                model_uri=M.id,
                domain=None,
                range=URIRef)

slots.hasCurie = Slot(uri=M.hasCurie,
                      name="hasCurie",
                      curie=M.curie('hasCurie'),
                      model_uri=M.hasCurie,
                      domain=None,
                      range=Optional[Union[str, Curie]])

slots.hasURI = Slot(uri=M.hasURI,
                    name="hasURI",
                    curie=M.curie('hasURI'),
                    model_uri=M.hasURI,
示例#3
0
                                     keyed=False)

        super().__post_init__(**kwargs)


# Enumerations


# 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[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, URIorCURIE])

slots.extension_value = Slot(uri=LINKML.value,
                             name="extension_value",
                             curie=LINKML.curie('value'),
示例#4
0
    def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
        if self.annotations is None:
            self.annotations = []
        if not isinstance(self.annotations, list):
            self.annotations = [self.annotations]
        self._normalize_inlined_slot(slot_name="annotations",
                                     slot_type=Annotation,
                                     key_name="tag",
                                     inlined_as_list=True,
                                     keyed=False)

        super().__post_init__(**kwargs)


# Enumerations


# 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[Union[dict, "Annotation"],
                                              List[Union[dict,
                                                         "Annotation"]]]])
示例#5
0
    def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
        if self.id is None:
            raise ValueError("id must be supplied")
        if not isinstance(self.id, OntologyClassId):
            self.id = OntologyClassId(self.id)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.id = Slot(uri=LINKML.id,
                name="id",
                curie=LINKML.curie('id'),
                model_uri=LINKML.id,
                domain=NamedThing,
                range=Union[str, NamedThingId])

slots.name = Slot(uri=LINKML.name,
                  name="name",
                  curie=LINKML.curie('name'),
                  model_uri=LINKML.name,
                  domain=NamedThing,
                  range=Optional[Union[str, LabelType]])
示例#6
0
            self.complete = CompleteDirectory(self.complete)

        super().__post_init__(**kwargs)


# Enumerations
class CompleteDirectory(EnumDefinitionImpl):

    COMPLETE = PermissibleValue(
        text="COMPLETE",
        description="The Directory contains all of the qualifying entries")
    PARTIAL = PermissibleValue(
        text="PARTIAL",
        description=
        "The directory contains only a partial listing of the qualifying entries."
    )

    _defn = EnumDefinition(name="CompleteDirectory", )


# Slots
class slots:
    pass


slots.directory__complete = Slot(uri=TCCM.complete,
                                 name="directory__complete",
                                 curie=TCCM.curie('complete'),
                                 model_uri=TCCM.directory__complete,
                                 domain=None,
                                 range=Union[str, "CompleteDirectory"])
示例#7
0
            self.object = ObjectRange1Id(self.object)

        if self.sex_qualifier is not None and not isinstance(self.sex_qualifier, NamedThingId):
            self.sex_qualifier = NamedThingId(self.sex_qualifier)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass

slots.id = Slot(uri=DEFAULT_.id, name="id", curie=DEFAULT_.curie('id'),
                   model_uri=DEFAULT_.id, domain=NamedThing, range=Union[str, NamedThingId])

slots.name = Slot(uri=DEFAULT_.name, name="name", curie=DEFAULT_.curie('name'),
                   model_uri=DEFAULT_.name, domain=NamedThing, range=str)

slots.subject = Slot(uri=DEFAULT_.subject, name="subject", curie=DEFAULT_.curie('subject'),
                   model_uri=DEFAULT_.subject, domain=None, range=Union[str, NamedThingId])

slots.object = Slot(uri=DEFAULT_.object, name="object", curie=DEFAULT_.curie('object'),
                   model_uri=DEFAULT_.object, domain=None, range=Union[str, NamedThingId])

slots.sex_qualifier = Slot(uri=DEFAULT_.sex_qualifier, name="sex qualifier", curie=DEFAULT_.curie('sex_qualifier'),
                   model_uri=DEFAULT_.sex_qualifier, domain=None, range=Optional[Union[str, NamedThingId]])

slots.mixin_owner_subject = Slot(uri=DEFAULT_.subject, name="mixin_owner_subject", curie=DEFAULT_.curie('subject'),
示例#8
0
            self.id = ManagerId(self.id)
        for k, v in self.has_employees.items():
            if not isinstance(v, Employee):
                self.has_employees[k] = Employee(id=k,
                                                 **({} if v is None else v))
        super().__post_init__(**kwargs)


# Slots
class slots:
    pass


slots.id = Slot(uri=DEFAULT_.id,
                name="id",
                curie=DEFAULT_.curie('id'),
                model_uri=DEFAULT_.id,
                domain=None,
                range=URIRef)

slots.name = Slot(uri=DEFAULT_.name,
                  name="name",
                  curie=DEFAULT_.curie('name'),
                  model_uri=DEFAULT_.name,
                  domain=None,
                  range=Optional[str])

slots.aliases = Slot(uri=DEFAULT_.aliases,
                     name="aliases",
                     curie=DEFAULT_.curie('aliases'),
                     model_uri=DEFAULT_.aliases,
示例#9
0
class NamedThing(YAMLRoot):
    _inherited_slots: ClassVar[List[str]] = []

    class_class_uri: ClassVar[URIRef] = URIRef("https://example.com/test44/NamedThing")
    class_class_curie: ClassVar[str] = None
    class_name: ClassVar[str] = "named thing"
    class_model_uri: ClassVar[URIRef] = URIRef("https://example.com/test44/NamedThing")

    category: Union[Union[str, IriType], List[Union[str, IriType]]] = None

    def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
        if self.category is None:
            raise ValueError("category must be supplied")
        elif not isinstance(self.category, list):
            self.category = [self.category]
        elif len(self.category) == 0:
            raise ValueError(f"category must be a non-empty list")
        self.category = [v if isinstance(v, IriType) else IriType(v) for v in self.category]

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass

slots.category = Slot(uri=RDFS.subClassOf, name="category", curie=RDFS.curie('subClassOf'),
                   model_uri=DEFAULT_.category, domain=NamedThing, range=Union[Union[str, IriType], List[Union[str, IriType]]])
示例#10
0
            self.s2 = str(self.s2)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.id = Slot(uri=DEFAULT_.id,
                name="id",
                curie=DEFAULT_.curie('id'),
                model_uri=DEFAULT_.id,
                domain=None,
                range=URIRef)

slots.s1 = Slot(uri=DEFAULT_.s1,
                name="s1",
                curie=DEFAULT_.curie('s1'),
                model_uri=DEFAULT_.s1,
                domain=C1,
                range=Optional[str])

slots.s2 = Slot(uri=DEFAULT_.s2,
                name="s2",
                curie=DEFAULT_.curie('s2'),
                model_uri=DEFAULT_.s2,
示例#11
0
            self.id = TestClass3Id(self.id)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.id = Slot(uri=DEFAULT_.id,
                name="id",
                curie=DEFAULT_.curie('id'),
                model_uri=DEFAULT_.id,
                domain=None,
                range=URIRef)

slots.optional_mixin_slot = Slot(uri=DEFAULT_.optional_mixin_slot,
                                 name="optional_mixin_slot",
                                 curie=DEFAULT_.curie('optional_mixin_slot'),
                                 model_uri=DEFAULT_.optional_mixin_slot,
                                 domain=None,
                                 range=Optional[str])

slots.required_mixin_slot = Slot(uri=DEFAULT_.required_mixin_slot,
                                 name="required_mixin_slot",
                                 curie=DEFAULT_.curie('required_mixin_slot'),
                                 model_uri=DEFAULT_.required_mixin_slot,
示例#12
0
            self.dfltns = str(self.dfltns)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.s1 = Slot(uri=TEST.s1,
                name="s1",
                curie=TEST.curie('s1'),
                model_uri=TEST.s1,
                domain=None,
                range=Optional[str])

slots.s1p = Slot(uri=TEST.s1p,
                 name="s1p",
                 curie=TEST.curie('s1p'),
                 model_uri=TEST.s1p,
                 domain=None,
                 range=Optional[str])

slots.s2 = Slot(uri=TEST.s2,
                name="s2",
                curie=TEST.curie('s2'),
                model_uri=TEST.s2,
示例#13
0
    class_class_uri: ClassVar[URIRef] = URIRef(
        "https://microbiomedata/schema/SampleClass")
    class_class_curie: ClassVar[str] = None
    class_name: ClassVar[str] = "SampleClass"
    class_model_uri: ClassVar[URIRef] = URIRef(
        "https://microbiomedata/schema/SampleClass")

    slot_1: Optional[Union[str, "SampleEnum"]] = None

    def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
        if self.slot_1 is not None and not isinstance(self.slot_1, SampleEnum):
            self.slot_1 = SampleEnum(self.slot_1)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.slot_1 = Slot(uri=DEFAULT_.slot_1,
                    name="slot_1",
                    curie=DEFAULT_.curie('slot_1'),
                    model_uri=DEFAULT_.slot_1,
                    domain=None,
                    range=Optional[Union[str, "SampleEnum"]])
示例#14
0
            self.k = GeographicLocationAtTimeK(self.k)

        if self.timepoint is not None and not isinstance(
                self.timepoint, TimeType):
            self.timepoint = TimeType(self.timepoint)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.k = Slot(uri=DEFAULT_.k,
               name="k",
               curie=DEFAULT_.curie('k'),
               model_uri=DEFAULT_.k,
               domain=GeographicLocation,
               range=Union[str, GeographicLocationK])

slots.timepoint = Slot(uri=DEFAULT_.timepoint,
                       name="timepoint",
                       curie=DEFAULT_.curie('timepoint'),
                       model_uri=DEFAULT_.timepoint,
                       domain=GeographicLocationAtTime,
                       range=Optional[Union[str, TimeType]])
示例#15
0
            self.id = EId(self.id)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.id = Slot(uri=DEFAULT_.id,
                name="id",
                curie=DEFAULT_.curie('id'),
                model_uri=DEFAULT_.id,
                domain=None,
                range=URIRef)

slots.has_a = Slot(uri=DEFAULT_.has_a,
                   name="has a",
                   curie=DEFAULT_.curie('has_a'),
                   model_uri=DEFAULT_.has_a,
                   domain=None,
                   range=Optional[Union[str, AId]])

slots.has_b = Slot(uri=DEFAULT_.has_b,
                   name="has b",
                   curie=DEFAULT_.curie('has_b'),
                   model_uri=DEFAULT_.has_b,
示例#16
0
            self.value = str(self.value)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.container__entry = Slot(uri=SCT.entry,
                              name="container__entry",
                              curie=SCT.curie('entry'),
                              model_uri=SCT.container__entry,
                              domain=None,
                              range=Optional[Union[Dict[Union[str,
                                                              ContaineeId],
                                                        Union[dict,
                                                              Containee]],
                                                   List[Union[dict,
                                                              Containee]]]])

slots.containee__id = Slot(uri=SCT.id,
                           name="containee__id",
                           curie=SCT.curie('id'),
                           model_uri=SCT.containee__id,
                           domain=None,
                           range=URIRef)
示例#17
0
    class_class_uri: ClassVar[URIRef] = URIRef(
        "http://example.org/tests/issue_260a/C260a")
    class_class_curie: ClassVar[str] = None
    class_name: ClassVar[str] = "C260a"
    class_model_uri: ClassVar[URIRef] = URIRef(
        "http://example.org/tests/issue_260a/C260a")

    id: Optional[str] = None

    def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
        if self.id is not None and not isinstance(self.id, str):
            self.id = str(self.id)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.id = Slot(uri=DEFAULT_.id,
                name="id",
                curie=DEFAULT_.curie('id'),
                model_uri=DEFAULT_.id,
                domain=None,
                range=Optional[str])
示例#18
0
                                     keyed=True)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.code = Slot(uri=SKOS.notation,
                  name="code",
                  curie=SKOS.curie('notation'),
                  model_uri=TERMCI.code,
                  domain=None,
                  range=str)

slots.designation = Slot(uri=SKOS.prefLabel,
                         name="designation",
                         curie=SKOS.curie('prefLabel'),
                         model_uri=TERMCI.designation,
                         domain=None,
                         range=Optional[str])

slots.definition = Slot(uri=SKOS.definition,
                        name="definition",
                        curie=SKOS.curie('definition'),
                        model_uri=TERMCI.definition,
示例#19
0
            self.text = str(self.text)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.identifier__value = Slot(uri=TYPES.value,
                               name="identifier__value",
                               curie=TYPES.curie('value'),
                               model_uri=TYPES.identifier__value,
                               domain=None,
                               range=Optional[str])

slots.identifier__system = Slot(uri=TYPES.system,
                                name="identifier__system",
                                curie=TYPES.curie('system'),
                                model_uri=TYPES.identifier__system,
                                domain=None,
                                range=Optional[str])

slots.identifier__type = Slot(uri=TYPES.type,
                              name="identifier__type",
                              curie=TYPES.curie('type'),
                              model_uri=TYPES.identifier__type,
示例#20
0
    class_class_uri: ClassVar[URIRef] = URIRef(
        "http://example.org/tests/namespace/C1")
    class_class_curie: ClassVar[str] = None
    class_name: ClassVar[str] = "c1"
    class_model_uri: ClassVar[URIRef] = URIRef(
        "http://example.org/tests/namespace/C1")

    s1: Optional[str] = None

    def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
        if self.s1 is not None and not isinstance(self.s1, str):
            self.s1 = str(self.s1)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.s1 = Slot(uri=DEFAULT_.s1,
                name="s1",
                curie=DEFAULT_.curie('s1'),
                model_uri=DEFAULT_.s1,
                domain=None,
                range=Optional[str])
示例#21
0
# Types

# Class references




# Enumerations


# Slots
class slots:
    pass

slots.mappings = Slot(uri=SKOS.mappingRelation, name="mappings", curie=SKOS.curie('mappingRelation'),
                   model_uri=LINKML.mappings, domain=None, range=Optional[Union[Union[str, URIorCURIE], List[Union[str, URIorCURIE]]]])

slots.exact_mappings = Slot(uri=SKOS.exactMatch, name="exact mappings", curie=SKOS.curie('exactMatch'),
                   model_uri=LINKML.exact_mappings, domain=None, range=Optional[Union[Union[str, URIorCURIE], List[Union[str, URIorCURIE]]]])

slots.close_mappings = Slot(uri=SKOS.closeMatch, name="close mappings", curie=SKOS.curie('closeMatch'),
                   model_uri=LINKML.close_mappings, domain=None, range=Optional[Union[Union[str, URIorCURIE], List[Union[str, URIorCURIE]]]])

slots.related_mappings = Slot(uri=SKOS.relatedMatch, name="related mappings", curie=SKOS.curie('relatedMatch'),
                   model_uri=LINKML.related_mappings, domain=None, range=Optional[Union[Union[str, URIorCURIE], List[Union[str, URIorCURIE]]]])

slots.narrow_mappings = Slot(uri=SKOS.narrowMatch, name="narrow mappings", curie=SKOS.curie('narrowMatch'),
                   model_uri=LINKML.narrow_mappings, domain=None, range=Optional[Union[Union[str, URIorCURIE], List[Union[str, URIorCURIE]]]])

slots.broad_mappings = Slot(uri=SKOS.broadMatch, name="broad mappings", curie=SKOS.curie('broadMatch'),
示例#22
0
    id: Union[str, C3Id] = None
    s2: Optional[str] = None

    def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
        if self.id is None:
            raise ValueError("id must be supplied")
        if not isinstance(self.id, C3Id):
            self.id = C3Id(self.id)

        if self.s2 is not None and not isinstance(self.s2, str):
            self.s2 = str(self.s2)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass

slots.id = Slot(uri=DEFAULT_.id, name="id", curie=DEFAULT_.curie('id'),
                   model_uri=DEFAULT_.id, domain=None, range=URIRef)

slots.s1 = Slot(uri=DEFAULT_.s1, name="s1", curie=DEFAULT_.curie('s1'),
                   model_uri=DEFAULT_.s1, domain=C1, range=Optional[str])

slots.s2 = Slot(uri=DEFAULT_.s2, name="s2", curie=DEFAULT_.curie('s2'),
                   model_uri=DEFAULT_.s2, domain=C1, range=Optional[str])
示例#23
0
            self.test_attribute_2 = str(self.test_attribute_2)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.attribute = Slot(uri=DEFAULT_.attribute,
                       name="attribute",
                       curie=DEFAULT_.curie('attribute'),
                       model_uri=DEFAULT_.attribute,
                       domain=NamedThing,
                       range=Optional[str])

slots.test_attribute_1 = Slot(uri=DEFAULT_.test_attribute_1,
                              name="test attribute 1",
                              curie=DEFAULT_.curie('test_attribute_1'),
                              model_uri=DEFAULT_.test_attribute_1,
                              domain=NamedThing,
                              range=Optional[str])

slots.test_attribute_2 = Slot(uri=DEFAULT_.test_attribute_2,
                              name="test attribute 2",
                              curie=DEFAULT_.curie('test_attribute_2'),
                              model_uri=DEFAULT_.test_attribute_2,
示例#24
0
print(str(x))
x.as_str = "s:James t:17"
print(str(x))
x = C(as_str="s:ess t:tee")
print(str(x))
x.as_str = "a b c "


# Slots
class slots:
    pass


slots.s = Slot(uri=DEFAULT_.s,
               name="s",
               curie=DEFAULT_.curie('s'),
               model_uri=DEFAULT_.s,
               domain=None,
               range=Optional[str])

slots.t = Slot(uri=DEFAULT_.t,
               name="t",
               curie=DEFAULT_.curie('t'),
               model_uri=DEFAULT_.t,
               domain=None,
               range=Optional[str])

slots.as_str = Slot(uri=DEFAULT_.as_str,
                    name="as_str",
                    curie=DEFAULT_.curie('as_str'),
                    model_uri=DEFAULT_.as_str,
示例#25
0
    code: str

    def __post_init__(self) -> None:
        self.code = str(self.code)
        if self.code not in MappedEvidence.defn.permissible_values:
            raise ValueError(f"Unknown MappedEvidence value: {self.code}")


# Slots
class slots:
    pass


slots.allEnums__entry_name = Slot(uri=EVIDENCE.entry_name,
                                  name="allEnums__entry_name",
                                  curie=EVIDENCE.curie('entry_name'),
                                  model_uri=EVIDENCE.allEnums__entry_name,
                                  domain=None,
                                  range=URIRef)

slots.allEnums__code_1 = Slot(uri=EVIDENCE.code_1,
                              name="allEnums__code_1",
                              curie=EVIDENCE.curie('code_1'),
                              model_uri=EVIDENCE.allEnums__code_1,
                              domain=None,
                              range=Union[Union[str, "OpenEnum"],
                                          List[Union[str, "OpenEnum"]]])

slots.allEnums__code_2 = Slot(uri=EVIDENCE.code_2,
                              name="allEnums__code_2",
                              curie=EVIDENCE.curie('code_2'),
示例#26
0
            self.id = OntologyClassId(self.id)

        if self.name is not None and not isinstance(self.name, str):
            self.name = str(self.name)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass

slots.id = Slot(uri=NMDC.id, name="id", curie=NMDC.curie('id'),
                   model_uri=NMDC.id, domain=None, range=URIRef)

slots.name = Slot(uri=NMDC.name, name="name", curie=NMDC.curie('name'),
                   model_uri=NMDC.name, domain=None, range=Optional[str])

slots.description = Slot(uri=DCTERMS.description, name="description", curie=DCTERMS.curie('description'),
                   model_uri=NMDC.description, domain=None, range=Optional[str])

slots.has_characteristic = Slot(uri=NMDC.has_characteristic, name="has characteristic", curie=NMDC.curie('has_characteristic'),
                   model_uri=NMDC.has_characteristic, domain=Annotation, range=Optional[Union[ElementIdentifier, CharacteristicId]])

slots.instance_of = Slot(uri=NMDC.instance_of, name="instance of", curie=NMDC.curie('instance_of'),
                   model_uri=NMDC.instance_of, domain=None, range=Optional[Union[ElementIdentifier, OntologyClassId]])

slots.has_raw_value = Slot(uri=NMDC.has_raw_value, name="has raw value", curie=NMDC.curie('has_raw_value'),
示例#27
0
            self.id = BaseId(self.id)

        if self.value is None:
            raise ValueError("value must be supplied")
        if not isinstance(self.value, str):
            self.value = str(self.value)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass


slots.id = Slot(uri=EX.id,
                name="id",
                curie=EX.curie('id'),
                model_uri=EX.id,
                domain=None,
                range=URIRef)

slots.value = Slot(uri=EX.value,
                   name="value",
                   curie=EX.curie('value'),
                   model_uri=EX.value,
                   domain=None,
                   range=str)
示例#28
0
    _inherited_slots: ClassVar[List[str]] = []

    class_class_uri: ClassVar[URIRef] = URIRef(
        "https://microbiomedata/schema/mixs/ImportedClass")
    class_class_curie: ClassVar[str] = None
    class_name: ClassVar[str] = "imported class"
    class_model_uri: ClassVar[URIRef] = URIRef(
        "https://microbiomedata/schema/ImportedClass")


# Enumerations


# Slots
class slots:
    pass


slots.depth = Slot(uri=DEFAULT_['mixs/depth'],
                   name="depth",
                   curie=DEFAULT_.curie('mixs/depth'),
                   model_uri=DEFAULT_.depth,
                   domain=None,
                   range=Optional[str])

slots.biosample_depth = Slot(uri=DEFAULT_.depth,
                             name="biosample_depth",
                             curie=DEFAULT_.curie('depth'),
                             model_uri=DEFAULT_.biosample_depth,
                             domain=Biosample,
                             range=Optional[str])
示例#29
0
        if self.id is None:
            raise ValueError("id must be supplied")
        if not isinstance(self.id, PersonId):
            self.id = PersonId(self.id)

        if self.name is None:
            raise ValueError("name must be supplied")
        if not isinstance(self.name, str):
            self.name = str(self.name)

        if self.age is not None and not isinstance(self.age, int):
            self.age = int(self.age)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass

slots.id = Slot(uri=BIOLINK.id, name="id", curie=BIOLINK.curie('id'),
                   model_uri=BIOLINK.id, domain=None, range=URIRef)

slots.name = Slot(uri=BIOLINK.name, name="name", curie=BIOLINK.curie('name'),
                   model_uri=BIOLINK.name, domain=None, range=str)

slots.age = Slot(uri=BIOLINK.age, name="age", curie=BIOLINK.curie('age'),
                   model_uri=BIOLINK.age, domain=None, range=Optional[int])
示例#30
0
@dataclass
class Course(YAMLRoot):
    _inherited_slots: ClassVar[List[str]] = []

    class_class_uri: ClassVar[URIRef] = SAMP.Course
    class_class_curie: ClassVar[str] = "samp:Course"
    class_name: ClassVar[str] = "course"
    class_model_uri: ClassVar[URIRef] = SAMP.Course

    name: Optional[str] = None

    def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
        if self.name is not None and not isinstance(self.name, str):
            self.name = str(self.name)

        super().__post_init__(**kwargs)


# Enumerations


# Slots
class slots:
    pass

slots.name = Slot(uri=SAMP.name, name="name", curie=SAMP.curie('name'),
                   model_uri=SAMP.name, domain=None, range=Optional[str])

slots.courses = Slot(uri=SAMP.courses, name="courses", curie=SAMP.curie('courses'),
                   model_uri=SAMP.courses, domain=None, range=Optional[Union[dict, Course]])