Acsets Hatchery

by plurigrid

data

Attributed C-Sets as algebraic databases. Category-theoretic data structures generalizing graphs and dataframes with Gay.jl color integration.

Skill Details

Repository Files

1 file in this skill directory


name: acsets-hatchery description: Attributed C-Sets as algebraic databases. Category-theoretic data structures generalizing graphs and dataframes with Gay.jl color integration. version: 1.0.0

ACSets Hatchery

Overview

ACSets.jl provides acsets ("attributed C-sets") - data structures generalizing both graphs and data frames. They are an efficient in-memory implementation of category-theoretic relational databases.

Core Features

  • Acset schemas - Category-theoretic data structure definitions
  • Acsets - Instances of schemas (like database rows)
  • Tabular columns - Efficient columnar storage
  • Serialization - JSON/binary format support

What Are ACSets?

An ACSet is a functor from a category C to Set, with attributes. This means:

  • Objects become tables
  • Morphisms become foreign keys
  • Attributes add data types to objects

Usage

using ACSets

# Define a schema
@present SchGraph(FreeSchema) begin
    V::Ob
    E::Ob
    src::Hom(E, V)
    tgt::Hom(E, V)
end

# Create an acset
g = @acset Graph begin
    V = 3
    E = 2
    src = [1, 2]
    tgt = [2, 3]
end

Extensions

  • Catlab.jl - Homomorphisms, limits/colimits, functorial data migration
  • AlgebraicRewriting.jl - DPO/SPO/SqPO rewriting for acsets

Learning Resources

  1. Graphs and C-sets I - What is a graph?
  2. Graphs and C-sets II - Half-edges and rotation systems
  3. Graphs and C-sets III - Reflexive graphs and homomorphisms
  4. Graphs and C-sets IV - Propositional logic of subgraphs

Gay.jl Integration

# Rec2020 wide gamut with acset seed
gay_seed!(0xb4545686b9115a09)

# Mixed mode checkpointing
params = OkhslParameters()
∂params = Enzyme.gradient(Reverse, loss, params, seed)

Citation

Patterson, Lynch, Fairbanks. Categorical data structures for technical computing. Compositionality 4, 5 (2022). arXiv:2106.04703

Repository

  • Source: plurigrid/ACSets.jl (fork of AlgebraicJulia/ACSets.jl)
  • Seed: 0xb4545686b9115a09
  • Index: 494/1055
  • Color: #204677

GF(3) Triad

algebraic-rewriting (-1) ⊗ acsets-hatchery (0) ⊗ gay-monte-carlo (+1) = 0 ✓

Related Skills

  • acsets-algebraic-databases - Full ACSet guide
  • specter-acset - Bidirectional navigation
  • world-a - AlgebraicJulia ecosystem

Forward Reference

  • unified-reafference (ACSet schema consumer)

Patterns That Work

  • Schema-first database design
  • Morphism-based foreign keys
  • Integration with unified-reafference

Patterns to Avoid

  • Ad-hoc schema changes
  • Missing attribute type annotations

SDF Interleaving

This skill connects to Software Design for Flexibility (Hanson & Sussman, 2021):

Primary Chapter: 3. Variations on an Arithmetic Theme

Concepts: generic arithmetic, coercion, symbolic, numeric

GF(3) Balanced Triad

acsets-hatchery (+) + SDF.Ch3 (○) + [balancer] (−) = 0

Skill Trit: 1 (PLUS - generation)

Secondary Chapters

  • Ch4: Pattern Matching
  • Ch7: Propagators
  • Ch10: Adventure Game Example

Connection Pattern

Generic arithmetic crosses type boundaries. This skill handles heterogeneous data.

Related Skills

Xlsx

Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas

data

Clickhouse Io

ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.

datacli

Clickhouse Io

ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.

datacli

Analyzing Financial Statements

This skill calculates key financial ratios and metrics from financial statement data for investment analysis

data

Data Storytelling

Transform data into compelling narratives using visualization, context, and persuasive structure. Use when presenting analytics to stakeholders, creating data reports, or building executive presentations.

data

Kpi Dashboard Design

Design effective KPI dashboards with metrics selection, visualization best practices, and real-time monitoring patterns. Use when building business dashboards, selecting metrics, or designing data visualization layouts.

designdata

Dbt Transformation Patterns

Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.

testingdocumenttool

Sql Optimization Patterns

Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.

designdata

Anndata

This skill should be used when working with annotated data matrices in Python, particularly for single-cell genomics analysis, managing experimental measurements with metadata, or handling large-scale biological datasets. Use when tasks involve AnnData objects, h5ad files, single-cell RNA-seq data, or integration with scanpy/scverse tools.

arttooldata

Xlsx

Spreadsheet toolkit (.xlsx/.csv). Create/edit with formulas/formatting, analyze data, visualization, recalculate formulas, for spreadsheet processing and analysis.

tooldata

Skill Information

Category:Data
Version:1.0.0
Last Updated:1/27/2026