Components, Interfaces, and Applications
GestaltDB combines an embedded graph database, fast bulk ingestion, and a high-performance graph-sampling engine with ontology and reasoning components. Applications can store and explore connected data, prepare training batches, classify entities, or maintain conclusions from changing evidence. Explicit adapters connect these workflows without requiring every graph operation to perform inference.
This is a map of application-facing responsibilities, not a claim that each box
is an independently deployed service. GraphDB is the database integration
hub; sampling and standalone reasoning expose their own execution interfaces.
Selected API calls and data handoffs. Applications choose when to build snapshots, run reasoning, advance saved state, and publish results.
Follow the database/query branch with Choose How to Load and Query Data, Load Arrow and Polars Data and Query and Mutate with Cypher. The diagram is a component map, not a promise that writes, inference, snapshot construction or publication happen automatically together.
Component responsibilities
Database, ingestion, and queries
gestaltdb.graphdb.GraphDB manages nodes, directed edges, labels, indexes,
and mutations. put_node / put_edges_bulk accept graph objects;
ingest_arrow / ingest_polars accept columns with explicit payload and
index-maintenance policies. The nontransactional PyRex backend offers a native
columnar writer for bulk-loading workloads. This is useful for importing
customer/product networks, scientific interaction data, and dependency graphs.
See Compatibility, Migration, and Recovery, Property-Graph Filtering and Indexes, and Performance and Benchmarks.
gestaltdb.kvstores.KVStore separates persistence from the graph API through
LMDB, LevelDB, and PyRex/RocksDB implementations. The independently selected
Serializer encodes graph payloads using Pickle, JSON, MessagePack, or
Protobuf. Transaction and read-snapshot capabilities vary by backend; see
Storage Backends and Serializers when choosing deployment behavior.
GraphDB.query calls the Cypher parser, planner, and runtime and returns a
QueryResult. It supports relationship exploration, cohort selection, and
graph mutations. Visualization builders consume graph/query/sample results
through a bounded graph representation for HTML or SVG output. Follow
Cypher Queries and Explore graphs and reasoning offline for application examples.
Sampling engine
SamplerSnapshot is the bridge from graph records to compact integer IDs,
NumPy arrays, and compressed sparse row (CSR) adjacency. Build a filtered
snapshot once, then reuse SamplerEngine for fast repeated batches without
per-batch database reads and graph-object deserialization. The database can be
closed after construction. A snapshot is immutable; applications explicitly
build another when they want to include source changes.
Inputs are seed IDs and sampling policies; outputs are array-backed neighbor, layer, walk, subgraph, and positive/negative batches. External-ID mappings and framework conversion helpers form the boundary to external ML training code. Neighborhood, heterogeneous, weighted, temporal, and negative sampling support GNN training, link prediction, recommendation, and embeddings. See Graph sampling API and policy reference, Snapshot consistency: staleness, appends and compaction, and Property-Graph Filtering and Indexes. Measure snapshot build/load costs separately from repeated sampling; RAM and memory-mapped loading have different costs (Performance and Benchmarks).
Temporal history and epistemic claims
Temporal storage lives alongside mutable graph records in GraphDB.
put_node_version, put_edge_version, and commit_versions record
history; assert_claim, correction, and retraction APIs record sourced
propositions. The interfaces exchange immutable version records rather than
silently converting every ordinary mutation into history.
Valid time describes when an assertion applies. System time describes when it was recorded in the database history. For example, a supplier status valid last month may be corrected today: an application can inspect both the revised account of last month and the account available before the correction. Start with Temporal and bitemporal data for a two-horizon example and Read one historical account consistently for historical traversal and Cypher. Exact version-write, validity and publication contracts remain in Temporal history and service reference.
read_view selects a valid-time point and visible commit prefix;
current_read_view pins mutable graph state where the backend supports it.
They are different interfaces, suited respectively to historical evidence and
coherent current-graph analysis. Their source identities stay distinct.
Claims carry agent/source attribution, a world, polarity, and optional confidence/provenance. Positive and negative evidence may coexist; claim status distinguishes supported, refuted, both, and unknown. The bounded modal API evaluates belief/knowledge formulas over explicit accessibility links. For multi-source scientific knowledge or agent belief models, see Bounded Modal and Epistemic Evaluation. Model-output provenance can be included in historical explanations through Unified inference audit.
Ontology model and compiler
Ontology holds semantic axioms; compile_ontology produces a
CompiledOntology containing a binary reasoning Program and exact axiom
origins. Supported constructs include class/property hierarchies, domain/range,
inverse, symmetric and transitive properties, and selected chains and class
expressions. This separation lets an application compile a shared semantic
model and evaluate it against explicitly selected facts.
For entity classification and relationship enrichment, start with Ontology reasoning. The offline RDF adapter provides an optional import boundary. Separate validation and snapshot-local equality mechanisms have their own contracts (Explicit negatives and validation reports, Snapshot-local equality and functional identity). Consult Gated profile expansion and conformance matrix for the supported construct matrix rather than assuming a complete OWL profile.
Standalone reasoning, maintenance, and temporal reasoning
The storage-independent reasoning package consumes programs and facts.
The binary engine uses Program / Fact and can collect bounded witnesses;
the typed engine uses GenericProgram / TypedFact for n-ary relations,
strict literals, filters, scoped negation, and selected aggregation. Prepared
plans and optional execution paths have explicit compatibility contracts.
See Relational execution contracts, Typed Datalog: literals, filters, aggregates,
Scoped closed-world negation, and Executor selection and resource limits.
Goal-directed APIs answer selective questions rather than requiring applications to request every consequence (Goal-directed queries and demand specialization, Pinned frontier-demand queries). Support/dependency indexes and DRed-style deletion maintain conclusions when supporting facts change (Bounded maintenance provenance and insertion propagation). Validation reports conflicts without rewriting the fact set; explanation APIs expose bounded derivations with different witness/support contracts (Bounded proofs, export interchange and checkpoints).
Temporal storage and temporal reasoning are separate responsibilities.
TemporalFact / IntervalSet and evaluate_range compute the intervals
over which conclusions follow. update_range reuses eligible segment
computations; verify_closure checks conformance. This enables questions such
as “during which periods did this dependency or eligibility rule hold?”
Recording versions alone does not execute interval reasoning. See
Reason over complete validity ranges, Temporal delta maintenance and interval publication, and
Temporal conformance and audit workflows.
Explicit integration adapters
reasoning.adapters connects the database and standalone logic layers:
Read and map: select graph records or temporal claims, map them to facts, and retain the selected source context and evidence references.
Verify and execute: check database/history, program, policy, and representation compatibility before using a generation.
Save and resume: persist reasoning state and apply committed evidence changes through supported incremental operations or an explicit rebuild.
Publish and project: write inferred claims under controlled publication rules or turn derived relationships into reusable sampler snapshots.
A reasoning session is the saved state of a particular reasoning computation: its program/catalog, source scope and horizon, evidence ledger, facts, and support index. It is not a user login or a database connection. An authenticated result/artifact is source-verified: checked against the expected database history and application-held identities. This checks source and state correspondence; the relevant execution APIs separately define how closure is recomputed or verified.
Use Current-graph ontology adapters and Current-graph generation admission and execution for current property graphs; Opt-in generation identity and admission for typed-point evidence; Resumable incremental reasoning sessions and Authenticated durable-session resume for saved state; Authenticated temporal-range evaluation and re-admission and Authenticated interval-batch publication for finite intervals; and Authenticated inferred sampler artifacts for derived sampling snapshots.
Choose an application workflow
Graph interoperability and visualization are separate boundaries. The optional
gestaltdb.integrations.networkx adapter imports/exports materialized current
records and loads supported local static GEXF, not temporal history or live
algorithm dispatch (Exchange current graphs with NetworkX and GEXF). The base gestaltdb.viz.api builders
consume selected records, query/sample results or reasoning explanations and
produce detached offline figures (Explore graphs and reasoning offline). Rendering does not
require NetworkX; notebook display does not synchronize browser state back into
the database (Notebook Usage). See Installation for independent extras
and Performance and Benchmarks for the costs at each handoff.
Application |
Component handoff |
Start here |
|---|---|---|
Explore a dependency or customer network |
Ingest -> GraphDB/indexes -> Cypher -> visualization |
Quickstart, Compatibility, Migration, and Recovery, Cypher Queries, Explore graphs and reasoning offline |
Train a link predictor or recommender |
Ingest -> filter graph -> snapshot -> sampler -> external ML framework |
Property-Graph Filtering and Indexes, Graph sampling API and policy reference, Performance and Benchmarks |
Classify entities with an ontology |
Ontology -> compiler -> program; selected graph/claims -> adapter -> evaluator |
Ontology reasoning, Current-graph ontology adapters, Explicit negatives and validation reports |
Audit historical eligibility or evidence |
Versioned claims -> pinned history -> temporal closure -> explanations/publication |
Temporal and bitemporal data, Reason over complete validity ranges, Authenticated interval-batch publication |
Maintain conclusions as evidence changes |
Committed versions -> session ledger -> maintenance -> saved state or publication |
Resumable incremental reasoning sessions, Authenticated durable-session resume |
Inspect decisions based on model predictions |
External model -> tagged claims -> stored rules -> inference audit export |
Sourced claims and conflicting evidence, Stored rules and support maintenance, Unified inference audit, Bounded Modal and Epistemic Evaluation |
Scope and caveats
Fast ingestion and sampling are workload-oriented strengths. Snapshot building, index rebuilding, source verification, conversion, and inference incur separate costs (Performance and Benchmarks). Applications choose synchronization points and handle explicit rebuilds when incremental operations do not apply.
Conflict-tolerant evidence and truth maintenance preserve supported conclusions; they do not automatically resolve contradictions. Broader OWL coverage, signed-denial premises, datatype shapes, and reusable TBox closure remain gated or deferred (Gated profile expansion and conformance matrix). External frameworks perform model training. Weighted-rule semantics and an automated neuro-symbolic loop are not provided. Operational guarantees follow the selected backend and documented coordination scope.