Skip to content

Strongly typed graphlike storage for arbitrary data.

License

Notifications You must be signed in to change notification settings

autogram-is/autograph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autograph

TLDR: Strongly typed but schema-light JSON documents in a directed multigraph with distinct edge identities.

It's a very specific niche, but you might try Autograph if you need to:

  1. Store lots of evolving data about a medium number of nodes (1K-100K of JSON per 500-50K nodes)
  2. Store many metadata-rich relationships (1-5k of JSON per 5K-5M edges)
  3. Switch up storage as your needs evolve (use serialized JSON files, then SQLite, then Couch or Redis, etc.)

Adding data

import { Node, Edge, JsonGraph as Graph } from '@autogram/autograph';

const n1 = new Node();
n1.someData = Api.getData(value1);

const n2 = new Node();
n2.random = Math.random();
n2.otherData = AnotherApi.getData(value1);

const e = new Edge(n1, 'links_to', n2);

const g = new Graph()
  .add([n1, n2, e])
  .save('my_graph.json');

Manual traversal

const g = new Graph().load('extended_family.json');
const livingSiblings = g
  .nodes(['type', 'equals', 'person'])
  .outgoing(['predicate', 'equals', 'is_child_of'])
  .sources(['deathDate', 'undefined'])
  .map((n: Node) => console.log(n.firstName));

const g2 = new Graph()
  .add(livingSiblings)
  .save('siblings.json');

About

Strongly typed graphlike storage for arbitrary data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published