-
Notifications
You must be signed in to change notification settings - Fork 8
/
schemas.py
53 lines (39 loc) · 897 Bytes
/
schemas.py
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
from typing import List, Union, Optional
from pydantic import BaseModel
class Paper(BaseModel):
UID: int = 0
slug: str = ""
title: str = ""
abstract: str = ""
link: str = ""
authors: Union[str, List[str]] = ""
venue: str = ""
sessions: str = ""
year: int = 0
keywords: Union[str, List[str]] = ""
tags: List[str] = []
citations: List[int] = []
selected: bool = True
class Element(BaseModel):
name: str
expanded: bool = True
parent: Optional[str] = None
level: int
start: int
stop: int
class Taxonomy(BaseModel):
name: str
taxonomy: List[List[Element]]
data: List[Paper]
class Node(Paper):
group: str
class Link(BaseModel):
source: int
target: int
class Network(BaseModel):
nodes: List[Node]
links: List[Link]
class Embedding(BaseModel):
UID: int
x: float
y: float