@semiont/graph 0.5.3 → 0.5.4
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/factory.d.ts +21 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/implementations/janusgraph.d.ts +72 -0
- package/dist/implementations/janusgraph.d.ts.map +1 -0
- package/dist/implementations/memorygraph.d.ts +70 -0
- package/dist/implementations/memorygraph.d.ts.map +1 -0
- package/dist/implementations/neo4j.d.ts +80 -0
- package/dist/implementations/neo4j.d.ts.map +1 -0
- package/dist/implementations/neptune.d.ts +78 -0
- package/dist/implementations/neptune.d.ts.map +1 -0
- package/dist/index.d.ts +17 -358
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -15
- package/dist/index.js.map +1 -1
- package/dist/interface.d.ts +57 -0
- package/dist/interface.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,57 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,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CAAC;IACrB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAChC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semiont/graph",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
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,7 +16,7 @@
|
|
|
16
16
|
"README.md"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "npm run typecheck && tsup",
|
|
19
|
+
"build": "npm run typecheck && tsup && tsc -p tsconfig.build.json",
|
|
20
20
|
"typecheck": "tsc --noEmit",
|
|
21
21
|
"clean": "rm -rf dist",
|
|
22
22
|
"test": "vitest run",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@types/uuid": "^10.0.0",
|
|
51
51
|
"@vitest/coverage-v8": "^4.1.0",
|
|
52
52
|
"tsup": "^8.0.1",
|
|
53
|
-
"typescript": "^
|
|
53
|
+
"typescript": "^6.0.2"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|