| Crates.io | kotoba-core |
| lib.rs | kotoba-core |
| version | 0.1.22 |
| created_at | 2025-09-14 07:45:07.06879+00 |
| updated_at | 2025-09-19 18:34:26.964821+00 |
| description | Core data structures and algorithms for the Kotoba distributed graph database system |
| homepage | https://github.com/com-junkawasaki/kotoba |
| repository | https://github.com/com-junkawasaki/kotoba |
| max_upload_size | |
| id | 1838438 |
| size | 173,098 |
Core components for the Kotoba graph processing system. Provides fundamental types, IR definitions, and common utilities used across the entire Kotoba ecosystem.
Kotoba Core serves as the foundational layer for all Kotoba crates, providing:
types.rs)// Fundamental data types
pub type VertexId = Uuid;
pub type EdgeId = Uuid;
pub type Label = String;
// Extensible value system
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub enum Value {
Null,
Bool(bool),
Int(i64),
String(String),
}
// Cryptographic primitives
pub struct ContentHash(String);
impl ContentHash {
pub fn sha256(data: [u8; 32]) -> Self;
}
ir/)| Metric | Status |
|---|---|
| Compilation | โ Clean (no warnings) |
| Tests | โ 100% coverage on core types |
| Documentation | โ Complete API docs |
| Dependencies | โ Minimal, secure |
| Performance | โ Zero-cost abstractions |
use kotoba_core::prelude::*;
// Working with core types
let vertex_id = VertexId::new_v4();
let value = Value::String("Hello, Kotoba!".to_string());
// Hash generation
let data = [42u8; 32];
let hash = ContentHash::sha256(data);
// Error handling
fn process_graph() -> Result<GraphRef_> {
// Implementation using unified error types
Ok(GraphRef_("graph_hash".to_string()))
}
use kotoba_core::ir::{query::QueryIR, rule::RuleIR};
// Query processing
let query = QueryIR::parse("MATCH (n) RETURN n")?;
// Rule application
let rule = RuleIR::new("optimization_rule");
Kotoba Core is the foundation for:
| Crate | Purpose | Dependency |
|---|---|---|
kotoba-graph |
Graph data structures | Required |
kotoba-execution |
Query execution engine | Required |
kotoba-jsonnet |
Configuration processing | Required |
kotoba-storage |
Persistence layer | Required |
kotoba-security |
Authentication & authorization | Required |
kotoba-server |
HTTP server components | Required |
kotoba-rewrite |
Graph transformations | Required |
cargo test -p kotoba-core
Test Coverage:
Value] - Extensible value type systemVertexId] / [EdgeId] - UUID-based identifiersContentHash] - Cryptographic content verificationProperties] - Key-value property storagecatalog] - Schema and catalog managementquery] - Query representation and optimizationrule] - Graph rewriting rulespatch] - Graph transformation operationsstrategy] - Execution strategy patternsSee the main Kotoba repository for contribution guidelines.
Licensed under MIT OR Apache-2.0. See LICENSE for details.