@semiont/graph 0.4.21 → 0.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +77 -87
- package/dist/index.js +13 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,37 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResourceDescriptor, ResourceId, UpdateResourceInput, ResourceFilter, CreateAnnotationInternal, Annotation, AnnotationId, AnnotationCategory, GraphConnection, GraphPath, EntityTypeStats, GraphServiceConfig, Logger } from '@semiont/core';
|
|
2
2
|
|
|
3
|
-
type ResourceDescriptor$4 = components['schemas']['ResourceDescriptor'];
|
|
4
|
-
type Annotation$4 = components['schemas']['Annotation'];
|
|
5
3
|
interface GraphDatabase {
|
|
6
4
|
connect(): Promise<void>;
|
|
7
5
|
disconnect(): Promise<void>;
|
|
8
6
|
isConnected(): boolean;
|
|
9
|
-
createResource(resource: ResourceDescriptor
|
|
10
|
-
getResource(id: ResourceId): Promise<ResourceDescriptor
|
|
11
|
-
updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor
|
|
7
|
+
createResource(resource: ResourceDescriptor): Promise<ResourceDescriptor>;
|
|
8
|
+
getResource(id: ResourceId): Promise<ResourceDescriptor | null>;
|
|
9
|
+
updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor>;
|
|
12
10
|
deleteResource(id: ResourceId): Promise<void>;
|
|
13
11
|
listResources(filter: ResourceFilter): Promise<{
|
|
14
|
-
resources: ResourceDescriptor
|
|
12
|
+
resources: ResourceDescriptor[];
|
|
15
13
|
total: number;
|
|
16
14
|
}>;
|
|
17
|
-
searchResources(query: string, limit?: number): Promise<ResourceDescriptor
|
|
18
|
-
createAnnotation(input: CreateAnnotationInternal): Promise<Annotation
|
|
19
|
-
getAnnotation(id: AnnotationId): Promise<Annotation
|
|
20
|
-
updateAnnotation(id: AnnotationId, updates: Partial<Annotation
|
|
15
|
+
searchResources(query: string, limit?: number): Promise<ResourceDescriptor[]>;
|
|
16
|
+
createAnnotation(input: CreateAnnotationInternal): Promise<Annotation>;
|
|
17
|
+
getAnnotation(id: AnnotationId): Promise<Annotation | null>;
|
|
18
|
+
updateAnnotation(id: AnnotationId, updates: Partial<Annotation>): Promise<Annotation>;
|
|
21
19
|
deleteAnnotation(id: AnnotationId): Promise<void>;
|
|
22
20
|
listAnnotations(filter: {
|
|
23
21
|
resourceId?: ResourceId;
|
|
24
22
|
type?: AnnotationCategory;
|
|
25
23
|
}): Promise<{
|
|
26
|
-
annotations: Annotation
|
|
24
|
+
annotations: Annotation[];
|
|
27
25
|
total: number;
|
|
28
26
|
}>;
|
|
29
|
-
getHighlights(resourceId: ResourceId): Promise<Annotation
|
|
30
|
-
resolveReference(annotationId: AnnotationId, source: ResourceId): Promise<Annotation
|
|
31
|
-
getReferences(resourceId: ResourceId): Promise<Annotation
|
|
32
|
-
getEntityReferences(resourceId: ResourceId, entityTypes?: string[]): Promise<Annotation
|
|
33
|
-
getResourceAnnotations(resourceId: ResourceId): Promise<Annotation
|
|
34
|
-
getResourceReferencedBy(resourceId: ResourceId, motivation?: string): Promise<Annotation
|
|
27
|
+
getHighlights(resourceId: ResourceId): Promise<Annotation[]>;
|
|
28
|
+
resolveReference(annotationId: AnnotationId, source: ResourceId): Promise<Annotation>;
|
|
29
|
+
getReferences(resourceId: ResourceId): Promise<Annotation[]>;
|
|
30
|
+
getEntityReferences(resourceId: ResourceId, entityTypes?: string[]): Promise<Annotation[]>;
|
|
31
|
+
getResourceAnnotations(resourceId: ResourceId): Promise<Annotation[]>;
|
|
32
|
+
getResourceReferencedBy(resourceId: ResourceId, motivation?: string): Promise<Annotation[]>;
|
|
35
33
|
getResourceConnections(resourceId: ResourceId): Promise<GraphConnection[]>;
|
|
36
34
|
findPath(fromResourceId: ResourceId, toResourceId: ResourceId, maxDepth?: number): Promise<GraphPath[]>;
|
|
37
35
|
getEntityTypeStats(): Promise<EntityTypeStats[]>;
|
|
@@ -44,13 +42,13 @@ interface GraphDatabase {
|
|
|
44
42
|
entityTypes: Record<string, number>;
|
|
45
43
|
contentTypes: Record<string, number>;
|
|
46
44
|
}>;
|
|
47
|
-
batchCreateResources(resources: ResourceDescriptor
|
|
48
|
-
createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation
|
|
45
|
+
batchCreateResources(resources: ResourceDescriptor[]): Promise<ResourceDescriptor[]>;
|
|
46
|
+
createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation[]>;
|
|
49
47
|
resolveReferences(inputs: {
|
|
50
48
|
annotationId: AnnotationId;
|
|
51
49
|
source: ResourceId;
|
|
52
|
-
}[]): Promise<Annotation
|
|
53
|
-
detectAnnotations(resourceId: ResourceId): Promise<Annotation
|
|
50
|
+
}[]): Promise<Annotation[]>;
|
|
51
|
+
detectAnnotations(resourceId: ResourceId): Promise<Annotation[]>;
|
|
54
52
|
getEntityTypes(): Promise<string[]>;
|
|
55
53
|
addEntityType(tag: string): Promise<void>;
|
|
56
54
|
addEntityTypes(tags: string[]): Promise<void>;
|
|
@@ -77,8 +75,6 @@ declare function createGraphDatabase(config: GraphDatabaseConfig): GraphDatabase
|
|
|
77
75
|
declare function getGraphDatabase(graphConfig: GraphServiceConfig): Promise<GraphDatabase>;
|
|
78
76
|
declare function closeGraphDatabase(): Promise<void>;
|
|
79
77
|
|
|
80
|
-
type ResourceDescriptor$3 = components['schemas']['ResourceDescriptor'];
|
|
81
|
-
type Annotation$3 = components['schemas']['Annotation'];
|
|
82
78
|
declare class Neo4jGraphDatabase implements GraphDatabase {
|
|
83
79
|
private driver;
|
|
84
80
|
private neo4j;
|
|
@@ -98,32 +94,32 @@ declare class Neo4jGraphDatabase implements GraphDatabase {
|
|
|
98
94
|
isConnected(): boolean;
|
|
99
95
|
private getSession;
|
|
100
96
|
private ensureSchemaExists;
|
|
101
|
-
createResource(resource: ResourceDescriptor
|
|
102
|
-
getResource(id: ResourceId): Promise<ResourceDescriptor
|
|
103
|
-
updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor
|
|
97
|
+
createResource(resource: ResourceDescriptor): Promise<ResourceDescriptor>;
|
|
98
|
+
getResource(id: ResourceId): Promise<ResourceDescriptor | null>;
|
|
99
|
+
updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor>;
|
|
104
100
|
deleteResource(id: ResourceId): Promise<void>;
|
|
105
101
|
listResources(filter: ResourceFilter): Promise<{
|
|
106
|
-
resources: ResourceDescriptor
|
|
102
|
+
resources: ResourceDescriptor[];
|
|
107
103
|
total: number;
|
|
108
104
|
}>;
|
|
109
|
-
searchResources(query: string, limit?: number): Promise<ResourceDescriptor
|
|
110
|
-
createAnnotation(input: CreateAnnotationInternal): Promise<Annotation
|
|
111
|
-
getAnnotation(id: AnnotationId): Promise<Annotation
|
|
112
|
-
updateAnnotation(id: AnnotationId, updates: Partial<Annotation
|
|
105
|
+
searchResources(query: string, limit?: number): Promise<ResourceDescriptor[]>;
|
|
106
|
+
createAnnotation(input: CreateAnnotationInternal): Promise<Annotation>;
|
|
107
|
+
getAnnotation(id: AnnotationId): Promise<Annotation | null>;
|
|
108
|
+
updateAnnotation(id: AnnotationId, updates: Partial<Annotation>): Promise<Annotation>;
|
|
113
109
|
deleteAnnotation(id: AnnotationId): Promise<void>;
|
|
114
110
|
listAnnotations(filter: {
|
|
115
111
|
resourceId?: ResourceId;
|
|
116
112
|
type?: AnnotationCategory;
|
|
117
113
|
}): Promise<{
|
|
118
|
-
annotations: Annotation
|
|
114
|
+
annotations: Annotation[];
|
|
119
115
|
total: number;
|
|
120
116
|
}>;
|
|
121
|
-
getHighlights(resourceId: ResourceId): Promise<Annotation
|
|
122
|
-
resolveReference(annotationId: AnnotationId, source: ResourceId): Promise<Annotation
|
|
123
|
-
getReferences(resourceId: ResourceId): Promise<Annotation
|
|
124
|
-
getEntityReferences(resourceId: ResourceId, entityTypes?: string[]): Promise<Annotation
|
|
125
|
-
getResourceAnnotations(resourceId: ResourceId): Promise<Annotation
|
|
126
|
-
getResourceReferencedBy(resourceId: ResourceId, motivation?: string): Promise<Annotation
|
|
117
|
+
getHighlights(resourceId: ResourceId): Promise<Annotation[]>;
|
|
118
|
+
resolveReference(annotationId: AnnotationId, source: ResourceId): Promise<Annotation>;
|
|
119
|
+
getReferences(resourceId: ResourceId): Promise<Annotation[]>;
|
|
120
|
+
getEntityReferences(resourceId: ResourceId, entityTypes?: string[]): Promise<Annotation[]>;
|
|
121
|
+
getResourceAnnotations(resourceId: ResourceId): Promise<Annotation[]>;
|
|
122
|
+
getResourceReferencedBy(resourceId: ResourceId, motivation?: string): Promise<Annotation[]>;
|
|
127
123
|
getResourceConnections(resourceId: ResourceId): Promise<GraphConnection[]>;
|
|
128
124
|
findPath(fromResourceId: string, toResourceId: string, maxDepth?: number): Promise<GraphPath[]>;
|
|
129
125
|
getEntityTypeStats(): Promise<EntityTypeStats[]>;
|
|
@@ -136,13 +132,13 @@ declare class Neo4jGraphDatabase implements GraphDatabase {
|
|
|
136
132
|
entityTypes: Record<string, number>;
|
|
137
133
|
contentTypes: Record<string, number>;
|
|
138
134
|
}>;
|
|
139
|
-
batchCreateResources(resources: ResourceDescriptor
|
|
140
|
-
createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation
|
|
135
|
+
batchCreateResources(resources: ResourceDescriptor[]): Promise<ResourceDescriptor[]>;
|
|
136
|
+
createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation[]>;
|
|
141
137
|
resolveReferences(inputs: {
|
|
142
138
|
annotationId: AnnotationId;
|
|
143
139
|
source: ResourceId;
|
|
144
|
-
}[]): Promise<Annotation
|
|
145
|
-
detectAnnotations(_resourceId: ResourceId): Promise<Annotation
|
|
140
|
+
}[]): Promise<Annotation[]>;
|
|
141
|
+
detectAnnotations(_resourceId: ResourceId): Promise<Annotation[]>;
|
|
146
142
|
getEntityTypes(): Promise<string[]>;
|
|
147
143
|
addEntityType(tag: string): Promise<void>;
|
|
148
144
|
addEntityTypes(tags: string[]): Promise<void>;
|
|
@@ -154,8 +150,6 @@ declare class Neo4jGraphDatabase implements GraphDatabase {
|
|
|
154
150
|
private parseAnnotationNode;
|
|
155
151
|
}
|
|
156
152
|
|
|
157
|
-
type ResourceDescriptor$2 = components['schemas']['ResourceDescriptor'];
|
|
158
|
-
type Annotation$2 = components['schemas']['Annotation'];
|
|
159
153
|
declare class NeptuneGraphDatabase implements GraphDatabase {
|
|
160
154
|
private connected;
|
|
161
155
|
private neptuneEndpoint?;
|
|
@@ -175,32 +169,32 @@ declare class NeptuneGraphDatabase implements GraphDatabase {
|
|
|
175
169
|
connect(): Promise<void>;
|
|
176
170
|
disconnect(): Promise<void>;
|
|
177
171
|
isConnected(): boolean;
|
|
178
|
-
createResource(resource: ResourceDescriptor
|
|
179
|
-
getResource(id: ResourceId): Promise<ResourceDescriptor
|
|
180
|
-
updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor
|
|
172
|
+
createResource(resource: ResourceDescriptor): Promise<ResourceDescriptor>;
|
|
173
|
+
getResource(id: ResourceId): Promise<ResourceDescriptor | null>;
|
|
174
|
+
updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor>;
|
|
181
175
|
deleteResource(id: ResourceId): Promise<void>;
|
|
182
176
|
listResources(filter: ResourceFilter): Promise<{
|
|
183
|
-
resources: ResourceDescriptor
|
|
177
|
+
resources: ResourceDescriptor[];
|
|
184
178
|
total: number;
|
|
185
179
|
}>;
|
|
186
|
-
searchResources(query: string, limit?: number): Promise<ResourceDescriptor
|
|
187
|
-
createAnnotation(input: CreateAnnotationInternal): Promise<Annotation
|
|
188
|
-
getAnnotation(id: AnnotationId): Promise<Annotation
|
|
189
|
-
updateAnnotation(id: AnnotationId, updates: Partial<Annotation
|
|
180
|
+
searchResources(query: string, limit?: number): Promise<ResourceDescriptor[]>;
|
|
181
|
+
createAnnotation(input: CreateAnnotationInternal): Promise<Annotation>;
|
|
182
|
+
getAnnotation(id: AnnotationId): Promise<Annotation | null>;
|
|
183
|
+
updateAnnotation(id: AnnotationId, updates: Partial<Annotation>): Promise<Annotation>;
|
|
190
184
|
deleteAnnotation(id: AnnotationId): Promise<void>;
|
|
191
185
|
listAnnotations(filter: {
|
|
192
186
|
resourceId?: ResourceId;
|
|
193
187
|
type?: AnnotationCategory;
|
|
194
188
|
}): Promise<{
|
|
195
|
-
annotations: Annotation
|
|
189
|
+
annotations: Annotation[];
|
|
196
190
|
total: number;
|
|
197
191
|
}>;
|
|
198
|
-
getHighlights(resourceId: ResourceId): Promise<Annotation
|
|
199
|
-
resolveReference(annotationId: AnnotationId, source: ResourceId): Promise<Annotation
|
|
200
|
-
getReferences(resourceId: ResourceId): Promise<Annotation
|
|
201
|
-
getEntityReferences(resourceId: ResourceId, entityTypes?: string[]): Promise<Annotation
|
|
202
|
-
getResourceAnnotations(resourceId: ResourceId): Promise<Annotation
|
|
203
|
-
getResourceReferencedBy(resourceId: ResourceId, _motivation?: string): Promise<Annotation
|
|
192
|
+
getHighlights(resourceId: ResourceId): Promise<Annotation[]>;
|
|
193
|
+
resolveReference(annotationId: AnnotationId, source: ResourceId): Promise<Annotation>;
|
|
194
|
+
getReferences(resourceId: ResourceId): Promise<Annotation[]>;
|
|
195
|
+
getEntityReferences(resourceId: ResourceId, entityTypes?: string[]): Promise<Annotation[]>;
|
|
196
|
+
getResourceAnnotations(resourceId: ResourceId): Promise<Annotation[]>;
|
|
197
|
+
getResourceReferencedBy(resourceId: ResourceId, _motivation?: string): Promise<Annotation[]>;
|
|
204
198
|
getResourceConnections(resourceId: ResourceId): Promise<GraphConnection[]>;
|
|
205
199
|
findPath(fromResourceId: string, toResourceId: string, maxDepth?: number): Promise<GraphPath[]>;
|
|
206
200
|
getEntityTypeStats(): Promise<EntityTypeStats[]>;
|
|
@@ -213,13 +207,13 @@ declare class NeptuneGraphDatabase implements GraphDatabase {
|
|
|
213
207
|
entityTypes: Record<string, number>;
|
|
214
208
|
contentTypes: Record<string, number>;
|
|
215
209
|
}>;
|
|
216
|
-
batchCreateResources(resources: ResourceDescriptor
|
|
217
|
-
createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation
|
|
210
|
+
batchCreateResources(resources: ResourceDescriptor[]): Promise<ResourceDescriptor[]>;
|
|
211
|
+
createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation[]>;
|
|
218
212
|
resolveReferences(inputs: {
|
|
219
213
|
annotationId: AnnotationId;
|
|
220
214
|
source: ResourceId;
|
|
221
|
-
}[]): Promise<Annotation
|
|
222
|
-
detectAnnotations(_resourceId: ResourceId): Promise<Annotation
|
|
215
|
+
}[]): Promise<Annotation[]>;
|
|
216
|
+
detectAnnotations(_resourceId: ResourceId): Promise<Annotation[]>;
|
|
223
217
|
private entityTypesCollection;
|
|
224
218
|
getEntityTypes(): Promise<string[]>;
|
|
225
219
|
addEntityType(tag: string): Promise<void>;
|
|
@@ -229,8 +223,6 @@ declare class NeptuneGraphDatabase implements GraphDatabase {
|
|
|
229
223
|
clearDatabase(): Promise<void>;
|
|
230
224
|
}
|
|
231
225
|
|
|
232
|
-
type ResourceDescriptor$1 = components['schemas']['ResourceDescriptor'];
|
|
233
|
-
type Annotation$1 = components['schemas']['Annotation'];
|
|
234
226
|
declare class JanusGraphDatabase implements GraphDatabase {
|
|
235
227
|
private graphConfig;
|
|
236
228
|
private connected;
|
|
@@ -253,43 +245,43 @@ declare class JanusGraphDatabase implements GraphDatabase {
|
|
|
253
245
|
private getPropertyValue;
|
|
254
246
|
private fetchAnnotationsWithEntityTypes;
|
|
255
247
|
private vertexToAnnotation;
|
|
256
|
-
createResource(resource: ResourceDescriptor
|
|
257
|
-
getResource(id: ResourceId): Promise<ResourceDescriptor
|
|
258
|
-
updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor
|
|
248
|
+
createResource(resource: ResourceDescriptor): Promise<ResourceDescriptor>;
|
|
249
|
+
getResource(id: ResourceId): Promise<ResourceDescriptor | null>;
|
|
250
|
+
updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor>;
|
|
259
251
|
deleteResource(id: ResourceId): Promise<void>;
|
|
260
252
|
listResources(filter: ResourceFilter): Promise<{
|
|
261
|
-
resources: ResourceDescriptor
|
|
253
|
+
resources: ResourceDescriptor[];
|
|
262
254
|
total: number;
|
|
263
255
|
}>;
|
|
264
|
-
searchResources(query: string, limit?: number): Promise<ResourceDescriptor
|
|
265
|
-
createAnnotation(input: CreateAnnotationInternal): Promise<Annotation
|
|
266
|
-
getAnnotation(id: AnnotationId): Promise<Annotation
|
|
267
|
-
updateAnnotation(id: AnnotationId, updates: Partial<Annotation
|
|
256
|
+
searchResources(query: string, limit?: number): Promise<ResourceDescriptor[]>;
|
|
257
|
+
createAnnotation(input: CreateAnnotationInternal): Promise<Annotation>;
|
|
258
|
+
getAnnotation(id: AnnotationId): Promise<Annotation | null>;
|
|
259
|
+
updateAnnotation(id: AnnotationId, updates: Partial<Annotation>): Promise<Annotation>;
|
|
268
260
|
deleteAnnotation(id: AnnotationId): Promise<void>;
|
|
269
261
|
listAnnotations(filter: {
|
|
270
262
|
resourceId?: ResourceId;
|
|
271
263
|
type?: AnnotationCategory;
|
|
272
264
|
}): Promise<{
|
|
273
|
-
annotations: Annotation
|
|
265
|
+
annotations: Annotation[];
|
|
274
266
|
total: number;
|
|
275
267
|
}>;
|
|
276
|
-
getHighlights(resourceId: ResourceId): Promise<Annotation
|
|
277
|
-
resolveReference(annotationId: AnnotationId, source: ResourceId): Promise<Annotation
|
|
278
|
-
getReferences(resourceId: ResourceId): Promise<Annotation
|
|
279
|
-
getEntityReferences(resourceId: ResourceId, entityTypes?: string[]): Promise<Annotation
|
|
280
|
-
getResourceAnnotations(resourceId: ResourceId): Promise<Annotation
|
|
281
|
-
getResourceReferencedBy(resourceId: ResourceId, _motivation?: string): Promise<Annotation
|
|
268
|
+
getHighlights(resourceId: ResourceId): Promise<Annotation[]>;
|
|
269
|
+
resolveReference(annotationId: AnnotationId, source: ResourceId): Promise<Annotation>;
|
|
270
|
+
getReferences(resourceId: ResourceId): Promise<Annotation[]>;
|
|
271
|
+
getEntityReferences(resourceId: ResourceId, entityTypes?: string[]): Promise<Annotation[]>;
|
|
272
|
+
getResourceAnnotations(resourceId: ResourceId): Promise<Annotation[]>;
|
|
273
|
+
getResourceReferencedBy(resourceId: ResourceId, _motivation?: string): Promise<Annotation[]>;
|
|
282
274
|
getResourceConnections(resourceId: ResourceId): Promise<GraphConnection[]>;
|
|
283
275
|
findPath(_fromResourceId: string, _toResourceId: string, _maxDepth?: number): Promise<GraphPath[]>;
|
|
284
276
|
getEntityTypeStats(): Promise<EntityTypeStats[]>;
|
|
285
277
|
getStats(): Promise<any>;
|
|
286
|
-
batchCreateResources(resources: ResourceDescriptor
|
|
287
|
-
createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation
|
|
278
|
+
batchCreateResources(resources: ResourceDescriptor[]): Promise<ResourceDescriptor[]>;
|
|
279
|
+
createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation[]>;
|
|
288
280
|
resolveReferences(inputs: Array<{
|
|
289
281
|
annotationId: AnnotationId;
|
|
290
282
|
source: ResourceId;
|
|
291
|
-
}>): Promise<Annotation
|
|
292
|
-
detectAnnotations(_resourceId: ResourceId): Promise<Annotation
|
|
283
|
+
}>): Promise<Annotation[]>;
|
|
284
|
+
detectAnnotations(_resourceId: ResourceId): Promise<Annotation[]>;
|
|
293
285
|
getEntityTypes(): Promise<string[]>;
|
|
294
286
|
addEntityType(tag: string): Promise<void>;
|
|
295
287
|
addEntityTypes(tags: string[]): Promise<void>;
|
|
@@ -298,8 +290,6 @@ declare class JanusGraphDatabase implements GraphDatabase {
|
|
|
298
290
|
clearDatabase(): Promise<void>;
|
|
299
291
|
}
|
|
300
292
|
|
|
301
|
-
type ResourceDescriptor = components['schemas']['ResourceDescriptor'];
|
|
302
|
-
type Annotation = components['schemas']['Annotation'];
|
|
303
293
|
declare class MemoryGraphDatabase implements GraphDatabase {
|
|
304
294
|
private connected;
|
|
305
295
|
private logger?;
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
// src/implementations/neptune.ts
|
|
2
2
|
import { getEntityTypes } from "@semiont/ontology";
|
|
3
|
+
import { annotationId as makeAnnotationId } from "@semiont/core";
|
|
3
4
|
import { v4 as uuidv4 } from "uuid";
|
|
4
|
-
import {
|
|
5
|
-
getBodySource,
|
|
6
|
-
getExactText,
|
|
7
|
-
getTargetSource,
|
|
8
|
-
getTargetSelector,
|
|
9
|
-
getPrimaryRepresentation,
|
|
10
|
-
getResourceId
|
|
11
|
-
} from "@semiont/api-client";
|
|
5
|
+
import { getBodySource, getExactText, getTargetSource, getTargetSelector, getPrimaryRepresentation, getResourceId } from "@semiont/core";
|
|
12
6
|
var NeptuneClient;
|
|
13
7
|
var DescribeDBClustersCommand;
|
|
14
8
|
var gremlin;
|
|
@@ -355,7 +349,7 @@ var NeptuneGraphDatabase = class {
|
|
|
355
349
|
const annotation = {
|
|
356
350
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
357
351
|
"type": "Annotation",
|
|
358
|
-
id,
|
|
352
|
+
id: makeAnnotationId(id),
|
|
359
353
|
motivation: input.motivation,
|
|
360
354
|
target: input.target,
|
|
361
355
|
body: input.body,
|
|
@@ -786,14 +780,9 @@ var NeptuneGraphDatabase = class {
|
|
|
786
780
|
};
|
|
787
781
|
|
|
788
782
|
// src/implementations/neo4j.ts
|
|
783
|
+
import { annotationId as makeAnnotationId2 } from "@semiont/core";
|
|
789
784
|
import { v4 as uuidv42 } from "uuid";
|
|
790
|
-
import {
|
|
791
|
-
getExactText as getExactText2,
|
|
792
|
-
getBodySource as getBodySource2,
|
|
793
|
-
getTargetSource as getTargetSource2,
|
|
794
|
-
getTargetSelector as getTargetSelector2,
|
|
795
|
-
getPrimaryRepresentation as getPrimaryRepresentation2
|
|
796
|
-
} from "@semiont/api-client";
|
|
785
|
+
import { getExactText as getExactText2, getBodySource as getBodySource2, getTargetSource as getTargetSource2, getTargetSelector as getTargetSelector2, getPrimaryRepresentation as getPrimaryRepresentation2 } from "@semiont/core";
|
|
797
786
|
import { getEntityTypes as getEntityTypes2 } from "@semiont/ontology";
|
|
798
787
|
function motivationToLabel(motivation) {
|
|
799
788
|
return motivation.charAt(0).toUpperCase() + motivation.slice(1);
|
|
@@ -1057,7 +1046,7 @@ var Neo4jGraphDatabase = class {
|
|
|
1057
1046
|
const annotation = {
|
|
1058
1047
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
1059
1048
|
"type": "Annotation",
|
|
1060
|
-
id,
|
|
1049
|
+
id: makeAnnotationId2(id),
|
|
1061
1050
|
motivation: input.motivation,
|
|
1062
1051
|
target: input.target,
|
|
1063
1052
|
body: input.body,
|
|
@@ -1797,13 +1786,8 @@ var Neo4jGraphDatabase = class {
|
|
|
1797
1786
|
};
|
|
1798
1787
|
|
|
1799
1788
|
// src/implementations/janusgraph.ts
|
|
1800
|
-
import { resourceId as makeResourceId } from "@semiont/core";
|
|
1801
|
-
import {
|
|
1802
|
-
getBodySource as getBodySource3,
|
|
1803
|
-
getPrimaryRepresentation as getPrimaryRepresentation3,
|
|
1804
|
-
getResourceId as getResourceId2,
|
|
1805
|
-
getExactText as getExactText3
|
|
1806
|
-
} from "@semiont/api-client";
|
|
1789
|
+
import { resourceId as makeResourceId, annotationId as makeAnnotationId3 } from "@semiont/core";
|
|
1790
|
+
import { getBodySource as getBodySource3, getPrimaryRepresentation as getPrimaryRepresentation3, getResourceId as getResourceId2, getExactText as getExactText3 } from "@semiont/core";
|
|
1807
1791
|
import { getEntityTypes as getEntityTypes3 } from "@semiont/ontology";
|
|
1808
1792
|
import { v4 as uuidv43 } from "uuid";
|
|
1809
1793
|
var JanusGraphDatabase = class {
|
|
@@ -2032,7 +2016,7 @@ var JanusGraphDatabase = class {
|
|
|
2032
2016
|
const annotation = {
|
|
2033
2017
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
2034
2018
|
"type": "Annotation",
|
|
2035
|
-
id,
|
|
2019
|
+
id: makeAnnotationId3(id),
|
|
2036
2020
|
motivation,
|
|
2037
2021
|
target: input.target,
|
|
2038
2022
|
body: input.body,
|
|
@@ -2192,7 +2176,7 @@ var JanusGraphDatabase = class {
|
|
|
2192
2176
|
}
|
|
2193
2177
|
async getResourceReferencedBy(resourceId, _motivation) {
|
|
2194
2178
|
const vertices = await this.g.V().hasLabel("Annotation").has("source", resourceId).toList();
|
|
2195
|
-
return
|
|
2179
|
+
return this.fetchAnnotationsWithEntityTypes(vertices);
|
|
2196
2180
|
}
|
|
2197
2181
|
async getResourceConnections(resourceId) {
|
|
2198
2182
|
const paths = await this.g.V().has("Resource", "id", resourceId).inE("BELONGS_TO").outV().outE("REFERENCES").inV().path().toList();
|
|
@@ -2354,15 +2338,9 @@ var JanusGraphDatabase = class {
|
|
|
2354
2338
|
};
|
|
2355
2339
|
|
|
2356
2340
|
// src/implementations/memorygraph.ts
|
|
2357
|
-
import { resourceId as makeResourceId2 } from "@semiont/core";
|
|
2341
|
+
import { resourceId as makeResourceId2, annotationId as makeAnnotationId4 } from "@semiont/core";
|
|
2358
2342
|
import { v4 as uuidv44 } from "uuid";
|
|
2359
|
-
import {
|
|
2360
|
-
getBodySource as getBodySource4,
|
|
2361
|
-
getTargetSource as getTargetSource3,
|
|
2362
|
-
getResourceId as getResourceId3,
|
|
2363
|
-
getPrimaryRepresentation as getPrimaryRepresentation4,
|
|
2364
|
-
getResourceEntityTypes
|
|
2365
|
-
} from "@semiont/api-client";
|
|
2343
|
+
import { getBodySource as getBodySource4, getTargetSource as getTargetSource3, getResourceId as getResourceId3, getPrimaryRepresentation as getPrimaryRepresentation4, getResourceEntityTypes } from "@semiont/core";
|
|
2366
2344
|
var MemoryGraphDatabase = class {
|
|
2367
2345
|
connected = false;
|
|
2368
2346
|
logger;
|
|
@@ -2442,7 +2420,7 @@ var MemoryGraphDatabase = class {
|
|
|
2442
2420
|
const annotation = {
|
|
2443
2421
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
2444
2422
|
"type": "Annotation",
|
|
2445
|
-
id,
|
|
2423
|
+
id: makeAnnotationId4(id),
|
|
2446
2424
|
motivation: input.motivation,
|
|
2447
2425
|
target: input.target,
|
|
2448
2426
|
body: input.body,
|