본문으로 건너뛰기
cccskills
무료GitHub에 공개

catcolab-schemas

CatColab Schemas - database schema modeling distinguishing entities (tables) from attributes (columns). Foundation for ACSets (Attributed C-Sets) and AlgebraicJulia data structures.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(3)

  • SKILL.md5.5 KB
  • CONCOMITANT_SKILLS.md2.2 KB
  • NEIGHBOR_SKILLS.md2.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

CatColab Schemas: Database Schema Modeling

Trit: +1 (PLUS - generator) Color: Green (#32CD32)

Overview

Schemas in CatColab upgrade ologs by explicitly distinguishing:

  • Entities: Tables with identity (foreign key targets)
  • Attributes: Columns/properties (data values)
  • Mappings: Foreign key relationships

This is the foundation for ACSets (Attributed C-Sets), the core data structure of AlgebraicJulia.

Mathematical Foundation

A schema is a profunctor or displayed category:

┌─────────────────────────────────────────────────────┐
│                     SCHEMA                           │
├─────────────────────────────────────────────────────┤
│  Entities (Ob):                                      │
│    Person, Company, Project                          │
│                                                      │
│  AttrTypes (Data):                                   │
│    String, Int, Date, Bool                           │
│                                                      │
│  Mappings (Hom):                                     │
│    works_at: Person → Company                        │
│    leads: Person → Project                           │
│                                                      │
│  Attributes (Attr):                                  │
│    name: Person → String                             │
│    age: Person → Int                                 │
│    founded: Company → Date                           │
└─────────────────────────────────────────────────────┘

Double Theory

// Schema double theory in catlog
pub fn th_schema() -> DiscreteDblTheory {
    let mut cat = FpCategory::new();

    // Object types
    cat.add_ob_generator(name("Entity"));
    cat.add_ob_generator(name("AttrType"));

    // Morphism types
    cat.add_mor_generator(name("Mapping"), name("Entity"), name("Entity"));
    cat.add_mor_generator(name("Attr"), name("Entity"), name("AttrType"));

    cat.into()
}

CatColab Implementation

Entity Declaration

{
  "type": "ObDecl",
  "name": "Person",
  "theory_type": "Entity",
  "description": "people in the system"
}

Attribute Type Declaration

{
  "type": "ObDecl",
  "name": "String",
  "theory_type": "AttrType",
  "description": "text values"
}

Mapping (Foreign Key)

{
  "type": "MorDecl",
  "name": "employer",
  "dom": "Person",
  "cod": "Company",
  "theory_type": "Mapping",
  "description": "the company this person works for"
}

Attribute (Column)

{
  "type": "MorDecl",
  "name": "salary",
  "dom": "Person",
  "cod": "Int",
  "theory_type": "Attr",
  "description": "annual salary in dollars"
}

ACSet Connection

A CatColab schema defines the type; an ACSet is an instance:

# Schema defines structure
@present SchPerson(FreeSchema) begin
  Person::Ob
  Company::Ob

  employer::Hom(Person, Company)

  Name::AttrType
  name::Attr(Person, Name)
end

# ACSet populates data
people = @acset SchPerson begin
  Person = 3
  Company = 2
  employer = [1, 1, 2]
  name = ["Alice", "Bob", "Charlie"]
end

Practical Examples

Example 1: E-Commerce Schema

Entities: Customer, Order, Product, Category
AttrTypes: String, Int, Float, DateTime

Mappings:
  placed_by: Order → Customer
  contains: Order → Product (many-to-many via junction)
  in_category: Product → Category

Attributes:
  email: Customer → String
  total: Order → Float
  price: Product → Float
  name: Category → String

Example 2: Social Network

Entities: User, Post, Comment, Group
AttrTypes: String, DateTime, Int

Mappings:
  author: Post → User
  on_post: Comment → Post
  member_of: User → Group

Attributes:
  username: User → String
  content: Post → String
  timestamp: Post → DateTime
  likes: Post → Int

Schema Composition

Schemas compose via pullback and pushout:

     Schema A          Schema B
         \               /
          \   pullback  /
           \           /
            ▼         ▼
          Schema A ×_C B

GF(3) Triads

catcolab-ologs (-1) ⊗ topos-catcolab (0) ⊗ catcolab-schemas (+1) = 0 ✓
database-design (-1) ⊗ acsets-relational-thinking (0) ⊗ catcolab-schemas (+1) = 0 ✓

Commands

# Create schema
just catcolab-new schema "my-database"

# Generate Julia ACSet code
just catcolab-export my-database --format=julia

# Create instance (diagram)
just catcolab-instance my-database "sample-data"

# Migrate schema
just catcolab-migrate old-schema new-schema

References


Skill Name: catcolab-schemas Type: Database Schema Design Trit: +1 (PLUS) GF(3): Conserved via triadic composition

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Model ElevenLabs voice synthesis as an ACSet schema with Unison ability handlers for typed voice operations. Use when integrating ElevenLabs TTS into category-theoretic pipelines, building typed voice synthesis workflows, or managing multi-voice narration with GF(3) conservation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

Systematic process for analyzing and modernizing legacy applications to comply with the 12-Factor App methodology. Covers code analysis, configuration externalization, dependency management, and container/Kubernetes best practices.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

13c0e3

무료

Gay MCP skill at invocation 26

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

19d57d

무료

Gay MCP skill at invocation 5

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

1ea91a

무료

Gay MCP skill at invocation 27

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

1eab21

무료

Gay MCP skill at invocation 3

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

plurigrid의 스킬 모두 보기

이 스킬의 문제 신고