@semiont/graph 0.5.4 → 0.5.5

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 CHANGED
@@ -1,17 +1,359 @@
1
- /**
2
- * @semiont/graph
3
- *
4
- * Graph database abstraction with multiple implementations
5
- *
6
- * Provides:
7
- * - GraphDatabase interface with 28 methods
8
- * - Singleton factory pattern for runtime selection
9
- * - 4 implementations: Neo4j, Neptune, JanusGraph, MemoryGraph
10
- */
11
- export type { GraphDatabase } from './interface';
12
- export { getGraphDatabase, createGraphDatabase, closeGraphDatabase } from './factory';
13
- export { Neo4jGraphDatabase } from './implementations/neo4j';
14
- export { NeptuneGraphDatabase } from './implementations/neptune';
15
- export { JanusGraphDatabase } from './implementations/janusgraph';
16
- export { MemoryGraphDatabase } from './implementations/memorygraph';
17
- //# sourceMappingURL=index.d.ts.map
1
+ import { ResourceDescriptor, ResourceId, UpdateResourceInput, ResourceFilter, CreateAnnotationInternal, Annotation, AnnotationId, AnnotationCategory, GraphConnection, GraphPath, EntityTypeStats, GraphServiceConfig, Logger } from '@semiont/core';
2
+
3
+ interface GraphDatabase {
4
+ connect(): Promise<void>;
5
+ disconnect(): Promise<void>;
6
+ isConnected(): boolean;
7
+ createResource(resource: ResourceDescriptor): Promise<ResourceDescriptor>;
8
+ getResource(id: ResourceId): Promise<ResourceDescriptor | null>;
9
+ updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor>;
10
+ deleteResource(id: ResourceId): Promise<void>;
11
+ listResources(filter: ResourceFilter): Promise<{
12
+ resources: ResourceDescriptor[];
13
+ total: number;
14
+ }>;
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>;
19
+ deleteAnnotation(id: AnnotationId): Promise<void>;
20
+ listAnnotations(filter: {
21
+ resourceId?: ResourceId;
22
+ type?: AnnotationCategory;
23
+ }): Promise<{
24
+ annotations: Annotation[];
25
+ total: number;
26
+ }>;
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[]>;
33
+ getResourceConnections(resourceId: ResourceId): Promise<GraphConnection[]>;
34
+ findPath(fromResourceId: ResourceId, toResourceId: ResourceId, maxDepth?: number): Promise<GraphPath[]>;
35
+ getEntityTypeStats(): Promise<EntityTypeStats[]>;
36
+ getStats(): Promise<{
37
+ resourceCount: number;
38
+ annotationCount: number;
39
+ highlightCount: number;
40
+ referenceCount: number;
41
+ entityReferenceCount: number;
42
+ entityTypes: Record<string, number>;
43
+ contentTypes: Record<string, number>;
44
+ }>;
45
+ batchCreateResources(resources: ResourceDescriptor[]): Promise<ResourceDescriptor[]>;
46
+ createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation[]>;
47
+ resolveReferences(inputs: {
48
+ annotationId: AnnotationId;
49
+ source: ResourceId;
50
+ }[]): Promise<Annotation[]>;
51
+ detectAnnotations(resourceId: ResourceId): Promise<Annotation[]>;
52
+ getEntityTypes(): Promise<string[]>;
53
+ addEntityType(tag: string): Promise<void>;
54
+ addEntityTypes(tags: string[]): Promise<void>;
55
+ generateId(): string;
56
+ clearDatabase(): Promise<void>;
57
+ }
58
+
59
+ type GraphDatabaseType = 'neptune' | 'neo4j' | 'janusgraph' | 'memory';
60
+ interface GraphDatabaseConfig {
61
+ type: GraphDatabaseType;
62
+ neptuneEndpoint?: string;
63
+ neptunePort?: number;
64
+ neptuneRegion?: string;
65
+ neo4jUri?: string;
66
+ neo4jUsername?: string;
67
+ neo4jPassword?: string;
68
+ neo4jDatabase?: string;
69
+ janusHost?: string;
70
+ janusPort?: number;
71
+ janusStorageBackend?: 'cassandra' | 'hbase' | 'berkeleydb';
72
+ janusIndexBackend?: 'elasticsearch' | 'solr' | 'lucene';
73
+ }
74
+ declare function createGraphDatabase(config: GraphDatabaseConfig): GraphDatabase;
75
+ declare function getGraphDatabase(graphConfig: GraphServiceConfig): Promise<GraphDatabase>;
76
+ declare function closeGraphDatabase(): Promise<void>;
77
+
78
+ declare class Neo4jGraphDatabase implements GraphDatabase {
79
+ private driver;
80
+ private neo4j;
81
+ private connected;
82
+ private logger?;
83
+ private config;
84
+ private entityTypesCollection;
85
+ constructor(config?: {
86
+ uri?: string;
87
+ username?: string;
88
+ password?: string;
89
+ database?: string;
90
+ logger?: Logger;
91
+ });
92
+ connect(): Promise<void>;
93
+ disconnect(): Promise<void>;
94
+ isConnected(): boolean;
95
+ private getSession;
96
+ private ensureSchemaExists;
97
+ createResource(resource: ResourceDescriptor): Promise<ResourceDescriptor>;
98
+ getResource(id: ResourceId): Promise<ResourceDescriptor | null>;
99
+ updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor>;
100
+ deleteResource(id: ResourceId): Promise<void>;
101
+ listResources(filter: ResourceFilter): Promise<{
102
+ resources: ResourceDescriptor[];
103
+ total: number;
104
+ }>;
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>;
109
+ deleteAnnotation(id: AnnotationId): Promise<void>;
110
+ listAnnotations(filter: {
111
+ resourceId?: ResourceId;
112
+ type?: AnnotationCategory;
113
+ }): Promise<{
114
+ annotations: Annotation[];
115
+ total: number;
116
+ }>;
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[]>;
123
+ getResourceConnections(resourceId: ResourceId): Promise<GraphConnection[]>;
124
+ findPath(fromResourceId: string, toResourceId: string, maxDepth?: number): Promise<GraphPath[]>;
125
+ getEntityTypeStats(): Promise<EntityTypeStats[]>;
126
+ getStats(): Promise<{
127
+ resourceCount: number;
128
+ annotationCount: number;
129
+ highlightCount: number;
130
+ referenceCount: number;
131
+ entityReferenceCount: number;
132
+ entityTypes: Record<string, number>;
133
+ contentTypes: Record<string, number>;
134
+ }>;
135
+ batchCreateResources(resources: ResourceDescriptor[]): Promise<ResourceDescriptor[]>;
136
+ createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation[]>;
137
+ resolveReferences(inputs: {
138
+ annotationId: AnnotationId;
139
+ source: ResourceId;
140
+ }[]): Promise<Annotation[]>;
141
+ detectAnnotations(_resourceId: ResourceId): Promise<Annotation[]>;
142
+ getEntityTypes(): Promise<string[]>;
143
+ addEntityType(tag: string): Promise<void>;
144
+ addEntityTypes(tags: string[]): Promise<void>;
145
+ private initializeTagCollections;
146
+ private persistTagCollection;
147
+ generateId(): string;
148
+ clearDatabase(): Promise<void>;
149
+ private parseResourceNode;
150
+ private parseAnnotationNode;
151
+ }
152
+
153
+ declare class NeptuneGraphDatabase implements GraphDatabase {
154
+ private connected;
155
+ private neptuneEndpoint?;
156
+ private neptunePort;
157
+ private region?;
158
+ private logger?;
159
+ private g;
160
+ private connection;
161
+ private fetchAnnotationsWithEntityTypes;
162
+ constructor(config?: {
163
+ endpoint?: string;
164
+ port?: number;
165
+ region?: string;
166
+ logger?: Logger;
167
+ });
168
+ private discoverNeptuneEndpoint;
169
+ connect(): Promise<void>;
170
+ disconnect(): Promise<void>;
171
+ isConnected(): boolean;
172
+ createResource(resource: ResourceDescriptor): Promise<ResourceDescriptor>;
173
+ getResource(id: ResourceId): Promise<ResourceDescriptor | null>;
174
+ updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor>;
175
+ deleteResource(id: ResourceId): Promise<void>;
176
+ listResources(filter: ResourceFilter): Promise<{
177
+ resources: ResourceDescriptor[];
178
+ total: number;
179
+ }>;
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>;
184
+ deleteAnnotation(id: AnnotationId): Promise<void>;
185
+ listAnnotations(filter: {
186
+ resourceId?: ResourceId;
187
+ type?: AnnotationCategory;
188
+ }): Promise<{
189
+ annotations: Annotation[];
190
+ total: number;
191
+ }>;
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[]>;
198
+ getResourceConnections(resourceId: ResourceId): Promise<GraphConnection[]>;
199
+ findPath(fromResourceId: string, toResourceId: string, maxDepth?: number): Promise<GraphPath[]>;
200
+ getEntityTypeStats(): Promise<EntityTypeStats[]>;
201
+ getStats(): Promise<{
202
+ resourceCount: number;
203
+ annotationCount: number;
204
+ highlightCount: number;
205
+ referenceCount: number;
206
+ entityReferenceCount: number;
207
+ entityTypes: Record<string, number>;
208
+ contentTypes: Record<string, number>;
209
+ }>;
210
+ batchCreateResources(resources: ResourceDescriptor[]): Promise<ResourceDescriptor[]>;
211
+ createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation[]>;
212
+ resolveReferences(inputs: {
213
+ annotationId: AnnotationId;
214
+ source: ResourceId;
215
+ }[]): Promise<Annotation[]>;
216
+ detectAnnotations(_resourceId: ResourceId): Promise<Annotation[]>;
217
+ private entityTypesCollection;
218
+ getEntityTypes(): Promise<string[]>;
219
+ addEntityType(tag: string): Promise<void>;
220
+ addEntityTypes(tags: string[]): Promise<void>;
221
+ private initializeTagCollections;
222
+ generateId(): string;
223
+ clearDatabase(): Promise<void>;
224
+ }
225
+
226
+ declare class JanusGraphDatabase implements GraphDatabase {
227
+ private graphConfig;
228
+ private connected;
229
+ private connection;
230
+ private g;
231
+ private logger?;
232
+ private entityTypesCollection;
233
+ constructor(graphConfig: {
234
+ host?: string;
235
+ port?: number;
236
+ storageBackend?: 'cassandra' | 'hbase' | 'berkeleydb';
237
+ indexBackend?: 'elasticsearch' | 'solr' | 'lucene';
238
+ logger?: Logger;
239
+ });
240
+ connect(): Promise<void>;
241
+ disconnect(): Promise<void>;
242
+ isConnected(): boolean;
243
+ private initializeSchema;
244
+ private vertexToResource;
245
+ private getPropertyValue;
246
+ private fetchAnnotationsWithEntityTypes;
247
+ private vertexToAnnotation;
248
+ createResource(resource: ResourceDescriptor): Promise<ResourceDescriptor>;
249
+ getResource(id: ResourceId): Promise<ResourceDescriptor | null>;
250
+ updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor>;
251
+ deleteResource(id: ResourceId): Promise<void>;
252
+ listResources(filter: ResourceFilter): Promise<{
253
+ resources: ResourceDescriptor[];
254
+ total: number;
255
+ }>;
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>;
260
+ deleteAnnotation(id: AnnotationId): Promise<void>;
261
+ listAnnotations(filter: {
262
+ resourceId?: ResourceId;
263
+ type?: AnnotationCategory;
264
+ }): Promise<{
265
+ annotations: Annotation[];
266
+ total: number;
267
+ }>;
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[]>;
274
+ getResourceConnections(resourceId: ResourceId): Promise<GraphConnection[]>;
275
+ findPath(_fromResourceId: string, _toResourceId: string, _maxDepth?: number): Promise<GraphPath[]>;
276
+ getEntityTypeStats(): Promise<EntityTypeStats[]>;
277
+ getStats(): Promise<any>;
278
+ batchCreateResources(resources: ResourceDescriptor[]): Promise<ResourceDescriptor[]>;
279
+ createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation[]>;
280
+ resolveReferences(inputs: Array<{
281
+ annotationId: AnnotationId;
282
+ source: ResourceId;
283
+ }>): Promise<Annotation[]>;
284
+ detectAnnotations(_resourceId: ResourceId): Promise<Annotation[]>;
285
+ getEntityTypes(): Promise<string[]>;
286
+ addEntityType(tag: string): Promise<void>;
287
+ addEntityTypes(tags: string[]): Promise<void>;
288
+ private initializeTagCollections;
289
+ generateId(): string;
290
+ clearDatabase(): Promise<void>;
291
+ }
292
+
293
+ declare class MemoryGraphDatabase implements GraphDatabase {
294
+ private connected;
295
+ private logger?;
296
+ private resources;
297
+ private annotations;
298
+ constructor(config?: {
299
+ logger?: Logger;
300
+ });
301
+ connect(): Promise<void>;
302
+ disconnect(): Promise<void>;
303
+ isConnected(): boolean;
304
+ createResource(resource: ResourceDescriptor): Promise<ResourceDescriptor>;
305
+ getResource(id: ResourceId): Promise<ResourceDescriptor | null>;
306
+ updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor>;
307
+ deleteResource(id: ResourceId): Promise<void>;
308
+ listResources(filter: ResourceFilter): Promise<{
309
+ resources: ResourceDescriptor[];
310
+ total: number;
311
+ }>;
312
+ searchResources(query: string, limit?: number): Promise<ResourceDescriptor[]>;
313
+ createAnnotation(input: CreateAnnotationInternal): Promise<Annotation>;
314
+ getAnnotation(id: AnnotationId): Promise<Annotation | null>;
315
+ updateAnnotation(id: AnnotationId, updates: Partial<Annotation>): Promise<Annotation>;
316
+ deleteAnnotation(id: AnnotationId): Promise<void>;
317
+ listAnnotations(filter: {
318
+ resourceId?: ResourceId;
319
+ type?: AnnotationCategory;
320
+ }): Promise<{
321
+ annotations: Annotation[];
322
+ total: number;
323
+ }>;
324
+ getHighlights(resourceId: ResourceId): Promise<Annotation[]>;
325
+ resolveReference(annotationId: AnnotationId, source: ResourceId): Promise<Annotation>;
326
+ getReferences(resourceId: ResourceId): Promise<Annotation[]>;
327
+ getEntityReferences(resourceId: ResourceId, entityTypes?: string[]): Promise<Annotation[]>;
328
+ getResourceAnnotations(resourceId: ResourceId): Promise<Annotation[]>;
329
+ getResourceReferencedBy(resourceId: ResourceId, _motivation?: string): Promise<Annotation[]>;
330
+ getResourceConnections(resourceId: ResourceId): Promise<GraphConnection[]>;
331
+ findPath(fromResourceId: string, toResourceId: string, maxDepth?: number): Promise<GraphPath[]>;
332
+ getEntityTypeStats(): Promise<EntityTypeStats[]>;
333
+ getStats(): Promise<{
334
+ resourceCount: number;
335
+ annotationCount: number;
336
+ highlightCount: number;
337
+ referenceCount: number;
338
+ entityReferenceCount: number;
339
+ entityTypes: Record<string, number>;
340
+ contentTypes: Record<string, number>;
341
+ }>;
342
+ batchCreateResources(resources: ResourceDescriptor[]): Promise<ResourceDescriptor[]>;
343
+ createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation[]>;
344
+ resolveReferences(inputs: {
345
+ annotationId: AnnotationId;
346
+ source: ResourceId;
347
+ }[]): Promise<Annotation[]>;
348
+ detectAnnotations(_resourceId: ResourceId): Promise<Annotation[]>;
349
+ private entityTypesCollection;
350
+ getEntityTypes(): Promise<string[]>;
351
+ addEntityType(tag: string): Promise<void>;
352
+ addEntityTypes(tags: string[]): Promise<void>;
353
+ private initializeTagCollections;
354
+ generateId(): string;
355
+ clearDatabase(): Promise<void>;
356
+ }
357
+
358
+ export { JanusGraphDatabase, MemoryGraphDatabase, Neo4jGraphDatabase, NeptuneGraphDatabase, closeGraphDatabase, createGraphDatabase, getGraphDatabase };
359
+ export type { GraphDatabase };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@semiont/graph",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "type": "module",
5
5
  "description": "Graph database abstraction with Neo4j, Neptune, JanusGraph, and in-memory implementations",
6
6
  "main": "./dist/index.js",
@@ -16,9 +16,9 @@
16
16
  "README.md"
17
17
  ],
18
18
  "scripts": {
19
- "build": "npm run typecheck && tsup && tsc -p tsconfig.build.json",
19
+ "build": "npm run typecheck && tsup && tsc -p tsconfig.build.json && rollup -c rollup.dts.config.mjs && rm -rf dist-types",
20
20
  "typecheck": "tsc --noEmit",
21
- "clean": "rm -rf dist",
21
+ "clean": "rm -rf dist dist-types",
22
22
  "test": "vitest run",
23
23
  "test:watch": "vitest",
24
24
  "test:coverage": "vitest run --coverage"
@@ -49,6 +49,8 @@
49
49
  "@types/gremlin": "^3.6.7",
50
50
  "@types/uuid": "^10.0.0",
51
51
  "@vitest/coverage-v8": "^4.1.0",
52
+ "rollup": "^4.60.3",
53
+ "rollup-plugin-dts": "^6.4.1",
52
54
  "tsup": "^8.0.1",
53
55
  "typescript": "^6.0.2"
54
56
  },
package/dist/factory.d.ts DELETED
@@ -1,21 +0,0 @@
1
- import { GraphDatabase } from './interface';
2
- import type { GraphServiceConfig } from '@semiont/core';
3
- export type GraphDatabaseType = 'neptune' | 'neo4j' | 'janusgraph' | 'memory';
4
- export interface GraphDatabaseConfig {
5
- type: GraphDatabaseType;
6
- neptuneEndpoint?: string;
7
- neptunePort?: number;
8
- neptuneRegion?: string;
9
- neo4jUri?: string;
10
- neo4jUsername?: string;
11
- neo4jPassword?: string;
12
- neo4jDatabase?: string;
13
- janusHost?: string;
14
- janusPort?: number;
15
- janusStorageBackend?: 'cassandra' | 'hbase' | 'berkeleydb';
16
- janusIndexBackend?: 'elasticsearch' | 'solr' | 'lucene';
17
- }
18
- export declare function createGraphDatabase(config: GraphDatabaseConfig): GraphDatabase;
19
- export declare function getGraphDatabase(graphConfig: GraphServiceConfig): Promise<GraphDatabase>;
20
- export declare function closeGraphDatabase(): Promise<void>;
21
- //# sourceMappingURL=factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAK5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC;AAE9E,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,iBAAiB,CAAC;IAGxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IAGvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IAGvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,YAAY,CAAC;IAC3D,iBAAiB,CAAC,EAAE,eAAe,GAAG,MAAM,GAAG,QAAQ,CAAC;CACzD;AAKD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa,CAkC9E;AAgBD,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC,CAsD9F;AAED,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAKxD"}
@@ -1,72 +0,0 @@
1
- import { GraphDatabase } from '../interface';
2
- import type { Logger } from '@semiont/core';
3
- import type { AnnotationCategory, GraphConnection, GraphPath, EntityTypeStats, ResourceFilter, UpdateResourceInput, CreateAnnotationInternal, ResourceId, AnnotationId } from '@semiont/core';
4
- import type { ResourceDescriptor } from '@semiont/core';
5
- import type { Annotation } from '@semiont/core';
6
- export declare class JanusGraphDatabase implements GraphDatabase {
7
- private graphConfig;
8
- private connected;
9
- private connection;
10
- private g;
11
- private logger?;
12
- private entityTypesCollection;
13
- constructor(graphConfig: {
14
- host?: string;
15
- port?: number;
16
- storageBackend?: 'cassandra' | 'hbase' | 'berkeleydb';
17
- indexBackend?: 'elasticsearch' | 'solr' | 'lucene';
18
- logger?: Logger;
19
- });
20
- connect(): Promise<void>;
21
- disconnect(): Promise<void>;
22
- isConnected(): boolean;
23
- private initializeSchema;
24
- private vertexToResource;
25
- private getPropertyValue;
26
- private fetchAnnotationsWithEntityTypes;
27
- private vertexToAnnotation;
28
- createResource(resource: ResourceDescriptor): Promise<ResourceDescriptor>;
29
- getResource(id: ResourceId): Promise<ResourceDescriptor | null>;
30
- updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor>;
31
- deleteResource(id: ResourceId): Promise<void>;
32
- listResources(filter: ResourceFilter): Promise<{
33
- resources: ResourceDescriptor[];
34
- total: number;
35
- }>;
36
- searchResources(query: string, limit?: number): Promise<ResourceDescriptor[]>;
37
- createAnnotation(input: CreateAnnotationInternal): Promise<Annotation>;
38
- getAnnotation(id: AnnotationId): Promise<Annotation | null>;
39
- updateAnnotation(id: AnnotationId, updates: Partial<Annotation>): Promise<Annotation>;
40
- deleteAnnotation(id: AnnotationId): Promise<void>;
41
- listAnnotations(filter: {
42
- resourceId?: ResourceId;
43
- type?: AnnotationCategory;
44
- }): Promise<{
45
- annotations: Annotation[];
46
- total: number;
47
- }>;
48
- getHighlights(resourceId: ResourceId): Promise<Annotation[]>;
49
- resolveReference(annotationId: AnnotationId, source: ResourceId): Promise<Annotation>;
50
- getReferences(resourceId: ResourceId): Promise<Annotation[]>;
51
- getEntityReferences(resourceId: ResourceId, entityTypes?: string[]): Promise<Annotation[]>;
52
- getResourceAnnotations(resourceId: ResourceId): Promise<Annotation[]>;
53
- getResourceReferencedBy(resourceId: ResourceId, _motivation?: string): Promise<Annotation[]>;
54
- getResourceConnections(resourceId: ResourceId): Promise<GraphConnection[]>;
55
- findPath(_fromResourceId: string, _toResourceId: string, _maxDepth?: number): Promise<GraphPath[]>;
56
- getEntityTypeStats(): Promise<EntityTypeStats[]>;
57
- getStats(): Promise<any>;
58
- batchCreateResources(resources: ResourceDescriptor[]): Promise<ResourceDescriptor[]>;
59
- createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation[]>;
60
- resolveReferences(inputs: Array<{
61
- annotationId: AnnotationId;
62
- source: ResourceId;
63
- }>): Promise<Annotation[]>;
64
- detectAnnotations(_resourceId: ResourceId): Promise<Annotation[]>;
65
- getEntityTypes(): Promise<string[]>;
66
- addEntityType(tag: string): Promise<void>;
67
- addEntityTypes(tags: string[]): Promise<void>;
68
- private initializeTagCollections;
69
- generateId(): string;
70
- clearDatabase(): Promise<void>;
71
- }
72
- //# sourceMappingURL=janusgraph.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"janusgraph.d.ts","sourceRoot":"","sources":["../../src/implementations/janusgraph.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CA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raphDatabase } from '../interface';
2
- import type { Logger } from '@semiont/core';
3
- import type { AnnotationCategory, GraphConnection, GraphPath, EntityTypeStats, ResourceFilter, UpdateResourceInput, CreateAnnotationInternal, ResourceId, AnnotationId } from '@semiont/core';
4
- import type { ResourceDescriptor } from '@semiont/core';
5
- import type { Annotation } from '@semiont/core';
6
- export declare class MemoryGraphDatabase implements GraphDatabase {
7
- private connected;
8
- private logger?;
9
- private resources;
10
- private annotations;
11
- constructor(config?: {
12
- logger?: Logger;
13
- });
14
- connect(): Promise<void>;
15
- disconnect(): Promise<void>;
16
- isConnected(): boolean;
17
- createResource(resource: ResourceDescriptor): Promise<ResourceDescriptor>;
18
- getResource(id: ResourceId): Promise<ResourceDescriptor | null>;
19
- updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor>;
20
- deleteResource(id: ResourceId): Promise<void>;
21
- listResources(filter: ResourceFilter): Promise<{
22
- resources: ResourceDescriptor[];
23
- total: number;
24
- }>;
25
- searchResources(query: string, limit?: number): Promise<ResourceDescriptor[]>;
26
- createAnnotation(input: CreateAnnotationInternal): Promise<Annotation>;
27
- getAnnotation(id: AnnotationId): Promise<Annotation | null>;
28
- updateAnnotation(id: AnnotationId, updates: Partial<Annotation>): Promise<Annotation>;
29
- deleteAnnotation(id: AnnotationId): Promise<void>;
30
- listAnnotations(filter: {
31
- resourceId?: ResourceId;
32
- type?: AnnotationCategory;
33
- }): Promise<{
34
- annotations: Annotation[];
35
- total: number;
36
- }>;
37
- getHighlights(resourceId: ResourceId): Promise<Annotation[]>;
38
- resolveReference(annotationId: AnnotationId, source: ResourceId): Promise<Annotation>;
39
- getReferences(resourceId: ResourceId): Promise<Annotation[]>;
40
- getEntityReferences(resourceId: ResourceId, entityTypes?: string[]): Promise<Annotation[]>;
41
- getResourceAnnotations(resourceId: ResourceId): Promise<Annotation[]>;
42
- getResourceReferencedBy(resourceId: ResourceId, _motivation?: string): Promise<Annotation[]>;
43
- getResourceConnections(resourceId: ResourceId): Promise<GraphConnection[]>;
44
- findPath(fromResourceId: string, toResourceId: string, maxDepth?: number): Promise<GraphPath[]>;
45
- getEntityTypeStats(): Promise<EntityTypeStats[]>;
46
- getStats(): Promise<{
47
- resourceCount: number;
48
- annotationCount: number;
49
- highlightCount: number;
50
- referenceCount: number;
51
- entityReferenceCount: number;
52
- entityTypes: Record<string, number>;
53
- contentTypes: Record<string, number>;
54
- }>;
55
- batchCreateResources(resources: ResourceDescriptor[]): Promise<ResourceDescriptor[]>;
56
- createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation[]>;
57
- resolveReferences(inputs: {
58
- annotationId: AnnotationId;
59
- source: ResourceId;
60
- }[]): Promise<Annotation[]>;
61
- detectAnnotations(_resourceId: ResourceId): Promise<Annotation[]>;
62
- private entityTypesCollection;
63
- getEntityTypes(): Promise<string[]>;
64
- addEntityType(tag: string): Promise<void>;
65
- addEntityTypes(tags: string[]): Promise<void>;
66
- private initializeTagCollections;
67
- generateId(): string;
68
- clearDatabase(): Promise<void>;
69
- }
70
- //# sourceMappingURL=memorygraph.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"memorygraph.d.ts","sourceRoot":"","sources":["../../src/implementations/memorygraph.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,UAAU,EACV,YAAY,EACb,MAAM,eAAe,CAAC;AAIvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAKhD,qBAAa,mBAAoB,YAAW,aAAa;IACvD,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,MAAM,CAAC,CAA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oB,CAAC,SAAS,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAQpF,iBAAiB,CAAC,MAAM,EAAE,wBAAwB,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAS5E,iBAAiB,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,UAAU,CAAA;KAAE,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAQtG,iBAAiB,CAAC,WAAW,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAOvE,OAAO,CAAC,qBAAqB,CAA4B;IAEnD,cAAc,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAQnC,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUzC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;YAQrC,wBAAwB;IActC,UAAU,IAAI,MAAM;IAId,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;CAOrC"}
@@ -1,80 +0,0 @@
1
- import { GraphDatabase } from '../interface';
2
- import type { Logger } from '@semiont/core';
3
- import type { AnnotationCategory, GraphConnection, GraphPath, EntityTypeStats, ResourceFilter, UpdateResourceInput, CreateAnnotationInternal, ResourceId, AnnotationId } from '@semiont/core';
4
- import type { ResourceDescriptor } from '@semiont/core';
5
- import type { Annotation } from '@semiont/core';
6
- export declare class Neo4jGraphDatabase implements GraphDatabase {
7
- private driver;
8
- private neo4j;
9
- private connected;
10
- private logger?;
11
- private config;
12
- private entityTypesCollection;
13
- constructor(config?: {
14
- uri?: string;
15
- username?: string;
16
- password?: string;
17
- database?: string;
18
- logger?: Logger;
19
- });
20
- connect(): Promise<void>;
21
- disconnect(): Promise<void>;
22
- isConnected(): boolean;
23
- private getSession;
24
- private ensureSchemaExists;
25
- createResource(resource: ResourceDescriptor): Promise<ResourceDescriptor>;
26
- getResource(id: ResourceId): Promise<ResourceDescriptor | null>;
27
- updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor>;
28
- deleteResource(id: ResourceId): Promise<void>;
29
- listResources(filter: ResourceFilter): Promise<{
30
- resources: ResourceDescriptor[];
31
- total: number;
32
- }>;
33
- searchResources(query: string, limit?: number): Promise<ResourceDescriptor[]>;
34
- createAnnotation(input: CreateAnnotationInternal): Promise<Annotation>;
35
- getAnnotation(id: AnnotationId): Promise<Annotation | null>;
36
- updateAnnotation(id: AnnotationId, updates: Partial<Annotation>): Promise<Annotation>;
37
- deleteAnnotation(id: AnnotationId): Promise<void>;
38
- listAnnotations(filter: {
39
- resourceId?: ResourceId;
40
- type?: AnnotationCategory;
41
- }): Promise<{
42
- annotations: Annotation[];
43
- total: number;
44
- }>;
45
- getHighlights(resourceId: ResourceId): Promise<Annotation[]>;
46
- resolveReference(annotationId: AnnotationId, source: ResourceId): Promise<Annotation>;
47
- getReferences(resourceId: ResourceId): Promise<Annotation[]>;
48
- getEntityReferences(resourceId: ResourceId, entityTypes?: string[]): Promise<Annotation[]>;
49
- getResourceAnnotations(resourceId: ResourceId): Promise<Annotation[]>;
50
- getResourceReferencedBy(resourceId: ResourceId, motivation?: string): Promise<Annotation[]>;
51
- getResourceConnections(resourceId: ResourceId): Promise<GraphConnection[]>;
52
- findPath(fromResourceId: string, toResourceId: string, maxDepth?: number): Promise<GraphPath[]>;
53
- getEntityTypeStats(): Promise<EntityTypeStats[]>;
54
- getStats(): Promise<{
55
- resourceCount: number;
56
- annotationCount: number;
57
- highlightCount: number;
58
- referenceCount: number;
59
- entityReferenceCount: number;
60
- entityTypes: Record<string, number>;
61
- contentTypes: Record<string, number>;
62
- }>;
63
- batchCreateResources(resources: ResourceDescriptor[]): Promise<ResourceDescriptor[]>;
64
- createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation[]>;
65
- resolveReferences(inputs: {
66
- annotationId: AnnotationId;
67
- source: ResourceId;
68
- }[]): Promise<Annotation[]>;
69
- detectAnnotations(_resourceId: ResourceId): Promise<Annotation[]>;
70
- getEntityTypes(): Promise<string[]>;
71
- addEntityType(tag: string): Promise<void>;
72
- addEntityTypes(tags: string[]): Promise<void>;
73
- private initializeTagCollections;
74
- private persistTagCollection;
75
- generateId(): string;
76
- clearDatabase(): Promise<void>;
77
- private parseResourceNode;
78
- private parseAnnotationNode;
79
- }
80
- //# sourceMappingURL=neo4j.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"neo4j.d.ts","sourceRoot":"","sources":["../../src/implementations/neo4j.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,UAAU,EACV,YAAY,EACb,MAAM,eAAe,CAAC;AAKvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAqBhD,qBAAa,kBAAmB,YAAW,aAAa;IACtD,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,KAAK,CAAiC;IAC9C,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,MAAM,CAKZ;IAGF,OAAO,CAAC,qBAAqB,CAA4B;gBAE7C,MAAM,GAAE;QAClB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ;IAKA,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IA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,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAQ5E,iBAAiB,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,UAAU,CAAA;KAAE,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAQtG,iBAAiB,CAAC,WAAW,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAOjE,cAAc,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAOnC,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;YAQrC,wBAAwB;YA+BxB,oBAAoB;IAYlC,UAAU,IAAI,MAAM;IAId,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAYpC,OAAO,CAAC,iBAAiB;IAkCzB,OAAO,CAAC,mBAAmB;CAiE5B"}
@@ -1,78 +0,0 @@
1
- import { GraphDatabase } from '../interface';
2
- import type { Logger } from '@semiont/core';
3
- import type { AnnotationCategory, GraphConnection, GraphPath, EntityTypeStats, ResourceFilter, UpdateResourceInput, CreateAnnotationInternal, ResourceId, AnnotationId } from '@semiont/core';
4
- import type { ResourceDescriptor } from '@semiont/core';
5
- import type { Annotation } from '@semiont/core';
6
- export declare class NeptuneGraphDatabase implements GraphDatabase {
7
- private connected;
8
- private neptuneEndpoint?;
9
- private neptunePort;
10
- private region?;
11
- private logger?;
12
- private g;
13
- private connection;
14
- private fetchAnnotationsWithEntityTypes;
15
- constructor(config?: {
16
- endpoint?: string;
17
- port?: number;
18
- region?: string;
19
- logger?: Logger;
20
- });
21
- private discoverNeptuneEndpoint;
22
- connect(): Promise<void>;
23
- disconnect(): Promise<void>;
24
- isConnected(): boolean;
25
- createResource(resource: ResourceDescriptor): Promise<ResourceDescriptor>;
26
- getResource(id: ResourceId): Promise<ResourceDescriptor | null>;
27
- updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor>;
28
- deleteResource(id: ResourceId): Promise<void>;
29
- listResources(filter: ResourceFilter): Promise<{
30
- resources: ResourceDescriptor[];
31
- total: number;
32
- }>;
33
- searchResources(query: string, limit?: number): Promise<ResourceDescriptor[]>;
34
- createAnnotation(input: CreateAnnotationInternal): Promise<Annotation>;
35
- getAnnotation(id: AnnotationId): Promise<Annotation | null>;
36
- updateAnnotation(id: AnnotationId, updates: Partial<Annotation>): Promise<Annotation>;
37
- deleteAnnotation(id: AnnotationId): Promise<void>;
38
- listAnnotations(filter: {
39
- resourceId?: ResourceId;
40
- type?: AnnotationCategory;
41
- }): Promise<{
42
- annotations: Annotation[];
43
- total: number;
44
- }>;
45
- getHighlights(resourceId: ResourceId): Promise<Annotation[]>;
46
- resolveReference(annotationId: AnnotationId, source: ResourceId): Promise<Annotation>;
47
- getReferences(resourceId: ResourceId): Promise<Annotation[]>;
48
- getEntityReferences(resourceId: ResourceId, entityTypes?: string[]): Promise<Annotation[]>;
49
- getResourceAnnotations(resourceId: ResourceId): Promise<Annotation[]>;
50
- getResourceReferencedBy(resourceId: ResourceId, _motivation?: string): Promise<Annotation[]>;
51
- getResourceConnections(resourceId: ResourceId): Promise<GraphConnection[]>;
52
- findPath(fromResourceId: string, toResourceId: string, maxDepth?: number): Promise<GraphPath[]>;
53
- getEntityTypeStats(): Promise<EntityTypeStats[]>;
54
- getStats(): Promise<{
55
- resourceCount: number;
56
- annotationCount: number;
57
- highlightCount: number;
58
- referenceCount: number;
59
- entityReferenceCount: number;
60
- entityTypes: Record<string, number>;
61
- contentTypes: Record<string, number>;
62
- }>;
63
- batchCreateResources(resources: ResourceDescriptor[]): Promise<ResourceDescriptor[]>;
64
- createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation[]>;
65
- resolveReferences(inputs: {
66
- annotationId: AnnotationId;
67
- source: ResourceId;
68
- }[]): Promise<Annotation[]>;
69
- detectAnnotations(_resourceId: ResourceId): Promise<Annotation[]>;
70
- private entityTypesCollection;
71
- getEntityTypes(): Promise<string[]>;
72
- addEntityType(tag: string): Promise<void>;
73
- addEntityTypes(tags: string[]): Promise<void>;
74
- private initializeTagCollections;
75
- generateId(): string;
76
- clearDatabase(): Promise<void>;
77
- }
78
- //# sourceMappingURL=neptune.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"neptune.d.ts","sourceRoot":"","sources":["../../src/implementations/neptune.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,UAAU,EACV,YAAY,EACb,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA0KhD,qBAAa,oBAAqB,YAAW,aAAa;IACxD,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,eAAe,CAAC,CAAS;IACjC,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,CAAC,CAAM;IACf,OAAO,CAAC,UAAU,CAAM;YAGV,+BAA+B;gBAsBjC,MAAM,GAAE;QAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ;YAOQ,uBAAuB;IA6D/B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAqCxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAcjC,WAAW,IA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AAC,MAAM,EAAE,UAAU,CAAA;KAAE,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAgBtG,iBAAiB,CAAC,WAAW,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAOvE,OAAO,CAAC,qBAAqB,CAA4B;IAEnD,cAAc,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAQnC,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBzC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;YAuBrC,wBAAwB;IAwCtC,UAAU,IAAI,MAAM;IAId,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;CAYrC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAGtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -1,57 +0,0 @@
1
- import type { Annotation, AnnotationCategory, AnnotationId, CreateAnnotationInternal, EntityTypeStats, GraphConnection, GraphPath, ResourceDescriptor, ResourceFilter, ResourceId, UpdateResourceInput } from '@semiont/core';
2
- export interface GraphDatabase {
3
- connect(): Promise<void>;
4
- disconnect(): Promise<void>;
5
- isConnected(): boolean;
6
- createResource(resource: ResourceDescriptor): Promise<ResourceDescriptor>;
7
- getResource(id: ResourceId): Promise<ResourceDescriptor | null>;
8
- updateResource(id: ResourceId, input: UpdateResourceInput): Promise<ResourceDescriptor>;
9
- deleteResource(id: ResourceId): Promise<void>;
10
- listResources(filter: ResourceFilter): Promise<{
11
- resources: ResourceDescriptor[];
12
- total: number;
13
- }>;
14
- searchResources(query: string, limit?: number): Promise<ResourceDescriptor[]>;
15
- createAnnotation(input: CreateAnnotationInternal): Promise<Annotation>;
16
- getAnnotation(id: AnnotationId): Promise<Annotation | null>;
17
- updateAnnotation(id: AnnotationId, updates: Partial<Annotation>): Promise<Annotation>;
18
- deleteAnnotation(id: AnnotationId): Promise<void>;
19
- listAnnotations(filter: {
20
- resourceId?: ResourceId;
21
- type?: AnnotationCategory;
22
- }): Promise<{
23
- annotations: Annotation[];
24
- total: number;
25
- }>;
26
- getHighlights(resourceId: ResourceId): Promise<Annotation[]>;
27
- resolveReference(annotationId: AnnotationId, source: ResourceId): Promise<Annotation>;
28
- getReferences(resourceId: ResourceId): Promise<Annotation[]>;
29
- getEntityReferences(resourceId: ResourceId, entityTypes?: string[]): Promise<Annotation[]>;
30
- getResourceAnnotations(resourceId: ResourceId): Promise<Annotation[]>;
31
- getResourceReferencedBy(resourceId: ResourceId, motivation?: string): Promise<Annotation[]>;
32
- getResourceConnections(resourceId: ResourceId): Promise<GraphConnection[]>;
33
- findPath(fromResourceId: ResourceId, toResourceId: ResourceId, maxDepth?: number): Promise<GraphPath[]>;
34
- getEntityTypeStats(): Promise<EntityTypeStats[]>;
35
- getStats(): Promise<{
36
- resourceCount: number;
37
- annotationCount: number;
38
- highlightCount: number;
39
- referenceCount: number;
40
- entityReferenceCount: number;
41
- entityTypes: Record<string, number>;
42
- contentTypes: Record<string, number>;
43
- }>;
44
- batchCreateResources(resources: ResourceDescriptor[]): Promise<ResourceDescriptor[]>;
45
- createAnnotations(inputs: CreateAnnotationInternal[]): Promise<Annotation[]>;
46
- resolveReferences(inputs: {
47
- annotationId: AnnotationId;
48
- source: ResourceId;
49
- }[]): Promise<Annotation[]>;
50
- detectAnnotations(resourceId: ResourceId): Promise<Annotation[]>;
51
- getEntityTypes(): Promise<string[]>;
52
- addEntityType(tag: string): Promise<void>;
53
- addEntityTypes(tags: string[]): Promise<void>;
54
- generateId(): string;
55
- clearDatabase(): Promise<void>;
56
- }
57
- //# sourceMappingURL=interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../src/interface.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,aAAa;IAE5B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,WAAW,IAAI,OAAO,CAAC;IAIvB,cAAc,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC1E,WAAW,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAChE,cAAc,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACxF,cAAc,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnG,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAG9E,gBAAgB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OA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