-
Notifications
You must be signed in to change notification settings - Fork 245
Expand file tree
/
Copy pathinterface.py
More file actions
127 lines (109 loc) · 3.59 KB
/
Copy pathinterface.py
File metadata and controls
127 lines (109 loc) · 3.59 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
from abc import ABC, abstractclassmethod, abstractmethod
from typing import Union, List, Dict
from uuid import UUID
from registry.database import DbConnection
from registry.models import *
class Registry(ABC):
@abstractmethod
def get_projects(self) -> List[str]:
"""
Returns the names of all projects
"""
pass
@abstractmethod
def get_projects_ids(self) -> Dict:
"""
Returns the ids to names mapping of all projects
"""
pass
@abstractmethod
def get_entity(self, id_or_name: Union[str, UUID]) -> Entity:
"""
Get one entity by its id or qualified name
"""
pass
@abstractmethod
def get_entities(self, ids: List[UUID]) -> List[Entity]:
"""
Get list of entities by their ids
"""
pass
@abstractmethod
def get_entity_id(self, id_or_name: Union[str, UUID]) -> UUID:
"""
Get entity id by its name
"""
pass
@abstractmethod
def get_neighbors(self, id_or_name: Union[str, UUID], relationship: RelationshipType) -> List[Edge]:
"""
Get list of edges with specified type that connect to this entity.
The edge contains fromId and toId so we can follow to the entity it connects to
"""
pass
@abstractmethod
def get_lineage(self, id_or_name: Union[str, UUID]) -> EntitiesAndRelations:
"""
Get all the upstream and downstream entities of an entity, along with all edges connect them.
Only meaningful to features and data sources.
"""
pass
@abstractmethod
def get_project(self, id_or_name: Union[str, UUID]) -> EntitiesAndRelations:
"""
Get a project and everything inside of it, both entities and edges
"""
pass
@abstractmethod
def search_entity(self,
keyword: str,
type: List[EntityType],
project: Optional[Union[str, UUID]] = None,
start: Optional[int] = None,
size: Optional[int] = None) -> List[EntityRef]:
"""
Search entities with specified type that also match the keyword in a project
"""
pass
@abstractmethod
def create_project(self, definition: ProjectDef) -> UUID:
"""
Create a new project
"""
pass
@abstractmethod
def create_project_datasource(self, project_id: UUID, definition: SourceDef) -> UUID:
"""
Create a new datasource under the project
"""
pass
@abstractmethod
def create_project_anchor(self, project_id: UUID, definition: AnchorDef) -> UUID:
"""
Create a new anchor under the project
"""
pass
@abstractmethod
def create_project_anchor_feature(self, project_id: UUID, anchor_id: UUID, definition: AnchorFeatureDef) -> UUID:
"""
Create a new anchor feature under the anchor in the project
"""
pass
@abstractmethod
def create_project_derived_feature(self, project_id: UUID, definition: DerivedFeatureDef) -> UUID:
"""
Create a new derived feature under the project
"""
pass
@abstractmethod
def get_dependent_entities(self, entity_id: Union[str, UUID]) -> List[Entity]:
"""
Given entity id, returns list of all entities that are downstream/dependant on the given entity
"""
pass
@abstractmethod
def delete_entity(self, entity_id: Union[str, UUID]):
"""
Deletes given entity
"""
pass