generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SchemaService.ts
45 lines (40 loc) · 1.59 KB
/
SchemaService.ts
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
/* istanbul ignore file */
import { injectable } from 'inversify';
import 'reflect-metadata';
import { Observable } from 'rxjs';
import {
EdgeType,
NodeType,
NodeTypeConnectionInfo,
} from '../../shared/schema';
import { QueryResult } from '../../shared/queries';
/**
* A service that can be used to request information about the data schema.
*/
@injectable()
export default abstract class SchemaService {
/**
* Retrieves the types of edges that the schema of the dataset contains.
* @returns Observable that represents the asynchronous operations. When evaluated, an array of edge types is emitted and the observable completes.
*/
public abstract getEdgeTypes(): Observable<EdgeType[]>;
/**
* Retrieves the types of nodes that the schema of the dataset contains.
* @returns Observable that represents the asynchronous operations. When evaluated, an array of node types is emitted and the observable completes.
*/
public abstract getNodeTypes(): Observable<NodeType[]>;
/**
* Retrieves the connections between node types together with their count.
* @returns Observable that represents the asynchronous operations. When evaluated, an array of node connections is emitted and the observable completes.
*/
public abstract getNodeTypeConnectionInfo(): Observable<
NodeTypeConnectionInfo[]
>;
/**
* Returns a {@link QueryResult} containing the meta information about the
* graph, i.e. which node types are connected to which other node types.
*
* The nodes.types always have the length 1.
*/
public abstract getMetaGraph(): Observable<QueryResult>;
}