rust-kgdb 0.6.20 → 0.6.21
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/CHANGELOG.md +29 -0
- package/README.md +35 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the rust-kgdb TypeScript SDK will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.6.21] - 2025-12-16
|
|
6
|
+
|
|
7
|
+
### Factually Correct Feature Documentation
|
|
8
|
+
|
|
9
|
+
Complete feature tables based on actual implementation.
|
|
10
|
+
|
|
11
|
+
#### Features Section - Now Tables
|
|
12
|
+
- **SPARQL 1.1**: SELECT/CONSTRUCT/ASK, INSERT/DELETE/UPDATE, 64 builtins
|
|
13
|
+
- **Datalog**: Facts & Rules, Semi-naive Evaluation, Recursive Queries
|
|
14
|
+
- **GraphFrames**: PageRank, Connected Components, Shortest Paths, Triangle Count, **Motif Finding**
|
|
15
|
+
- **Embeddings**: HNSW Index, Multi-provider, Composite Search
|
|
16
|
+
- **HyperMind**: Schema-Aware, Typed Tools, Audit Trail, Memory
|
|
17
|
+
|
|
18
|
+
#### Available Tools Table
|
|
19
|
+
All 7 tools documented with Input → Output signatures:
|
|
20
|
+
- `kg.sparql.query`, `kg.sparql.update`
|
|
21
|
+
- `kg.datalog.apply`
|
|
22
|
+
- `kg.motif.find`
|
|
23
|
+
- `kg.embeddings.search`
|
|
24
|
+
- `kg.graphframes.pagerank`, `kg.graphframes.components`
|
|
25
|
+
|
|
26
|
+
#### New: Motif Finding Example
|
|
27
|
+
```javascript
|
|
28
|
+
// Find circular patterns (fraud detection!)
|
|
29
|
+
const circles = graph.find('(a)-[]->(b); (b)-[]->(c); (c)-[]->(a)')
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
5
34
|
## [0.6.19] - 2025-12-16
|
|
6
35
|
|
|
7
36
|
### Documentation: The Power of the Concept
|
package/README.md
CHANGED
|
@@ -424,11 +424,46 @@ const graph = new GraphFrame(
|
|
|
424
424
|
])
|
|
425
425
|
)
|
|
426
426
|
|
|
427
|
+
// Built-in algorithms
|
|
427
428
|
console.log('Triangles:', graph.triangleCount()) // 1
|
|
428
429
|
console.log('PageRank:', JSON.parse(graph.pageRank(0.15, 20)))
|
|
429
430
|
console.log('Components:', JSON.parse(graph.connectedComponents()))
|
|
430
431
|
```
|
|
431
432
|
|
|
433
|
+
### Motif Finding (Pattern Matching)
|
|
434
|
+
|
|
435
|
+
```javascript
|
|
436
|
+
const { GraphFrame } = require('rust-kgdb')
|
|
437
|
+
|
|
438
|
+
// Create a graph with payment relationships
|
|
439
|
+
const graph = new GraphFrame(
|
|
440
|
+
JSON.stringify([
|
|
441
|
+
{id:'company_a'}, {id:'company_b'}, {id:'company_c'}, {id:'company_d'}
|
|
442
|
+
]),
|
|
443
|
+
JSON.stringify([
|
|
444
|
+
{src:'company_a', dst:'company_b'}, // A pays B
|
|
445
|
+
{src:'company_b', dst:'company_c'}, // B pays C
|
|
446
|
+
{src:'company_c', dst:'company_a'}, // C pays A (circular!)
|
|
447
|
+
{src:'company_c', dst:'company_d'} // C also pays D
|
|
448
|
+
])
|
|
449
|
+
)
|
|
450
|
+
|
|
451
|
+
// Find simple edge pattern: (a)-[]->(b)
|
|
452
|
+
const edges = JSON.parse(graph.find('(a)-[]->(b)'))
|
|
453
|
+
console.log('All edges:', edges.length) // 4
|
|
454
|
+
|
|
455
|
+
// Find two-hop path: (x)-[]->(y)-[]->(z)
|
|
456
|
+
const twoHops = JSON.parse(graph.find('(x)-[]->(y); (y)-[]->(z)'))
|
|
457
|
+
console.log('Two-hop paths:', twoHops.length) // 3
|
|
458
|
+
|
|
459
|
+
// Find circular pattern (fraud detection!): A->B->C->A
|
|
460
|
+
const circles = JSON.parse(graph.find('(a)-[]->(b); (b)-[]->(c); (c)-[]->(a)'))
|
|
461
|
+
console.log('Circular patterns:', circles.length) // 1 (the fraud ring!)
|
|
462
|
+
|
|
463
|
+
// Each match includes the bound variables
|
|
464
|
+
// circles[0] = { a: 'company_a', b: 'company_b', c: 'company_c' }
|
|
465
|
+
```
|
|
466
|
+
|
|
432
467
|
### Rule-Based Reasoning
|
|
433
468
|
|
|
434
469
|
```javascript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rust-kgdb",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.21",
|
|
4
4
|
"description": "Production-grade Neuro-Symbolic AI Framework with Schema-Aware GraphDB, Context Theory, and Memory Hypergraph: +86.4% accuracy over vanilla LLMs. Features Schema-Aware GraphDB (auto schema extraction), BYOO (Bring Your Own Ontology) for enterprise, cross-agent schema caching, LLM Planner for natural language to typed SPARQL, ProofDAG with Curry-Howard witnesses. High-performance (2.78µs lookups, 35x faster than RDFox). W3C SPARQL 1.1 compliant.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|