-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathinput.py
More file actions
96 lines (74 loc) · 2.38 KB
/
input.py
File metadata and controls
96 lines (74 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
"""
API Input Models not described in reasoner-pydantic
"""
from pydantic import BaseModel, Field
from typing import List, Dict
class CurieList(BaseModel):
"""Curie list input model"""
curies: List[str] = Field(
..., # Ellipsis means field is required
title='List of CURIEs to normalize',
min_items=1
)
conflate:bool = Field(
True,
title="Whether to apply gene/protein conflation"
)
description: bool = Field(
False,
title="Whether to return CURIE descriptions when possible"
)
drug_chemical_conflate: bool = Field(
False,
title="Whether to apply drug/chemical conflation"
)
individual_types: bool = Field(
False,
title="Whether to return individual types for equivalent identifiers"
)
include_taxa: bool = Field(
True,
title="Whether to return taxa for equivalent identifiers"
)
include_clique_leaders: bool = Field(
default=False,
title="Whether to return clique leaders for conflated identifiers"
)
class Config:
schema_extra = {
"example": {
"curies": ['MESH:D014867', 'NCIT:C34373'],
"conflate": True,
"description": False,
"drug_chemical_conflate": False,
}
}
class SemanticTypesInput(BaseModel):
"""Semantic type input model"""
semantic_types: List[str] = Field(
..., # required field
title='list of semantic types',
)
class Config:
schema_extra = {
"example": {
"semantic_types": ['biolink:ChemicalEntity', 'biolink:AnatomicalEntity']
}
}
class SetIDQuery(BaseModel):
""" Query for a single SetID. Includes a set of CURIEs as well as a set of conflations to apply. """
curies: List[str] = Field(
..., # Ellipsis means field is required
description="Set of curies to normalize",
example=["MESH:D014867", "NCIT:C34373"],
)
conflations: List[str] = Field(
[],
description="Set of conflations to apply",
example=["GeneProtein", "DrugChemical"],
)
class SetIDs(BaseModel):
""" Query for Set IDs. You can provide a set of named CURIE sets, and we return a response for each one. """
sets: Dict[str, SetIDQuery] = Field(
description="A list of ",
)