# KnowledgeUnit

- File ID: file:h6a0xu:knowledgeunit-cs
- Path: NexusReader.Domain/Entities/KnowledgeUnit.cs
- Role: entity
- Layer: domain

## Purpose

Defines the domain entity KnowledgeUnit representing a unit of extracted/ingested knowledge (content, type, metadata, links) stored per tenant with EF Core mapping attributes.

## Key Details

Primary key Id is intended as a content hash (comment). CreatedAt defaults to UTC now. Uses EF Core data annotations for schema (Key, Required, MaxLength, ForeignKey). Navigation properties are initialized to avoid null collections.

## Symbols

- KnowledgeUnit: Defines the domain entity KnowledgeUnit representing a unit of extracted/ingested knowledge (content, type, metadata, links) stored per tenant with EF Core mapping attributes.
- KnowledgeUnit: Represents a stored piece of knowledge (content + type + metadata) with tenant scoping and links to other KnowledgeUnits and an optional Ebook.

## Dependencies

- imports NexusReader.Domain/Entities/Ebook.cs
- imports NexusReader.Domain/Entities/KnowledgeUnitLink.cs
- imports NexusReader.Domain/Enums/KnowledgeUnitType.cs

## Calls

- No resolved calls.

## Coverage

- Symbols: 2
- Executable symbols: 0
- Executable symbols with control flow: 0
- Grounded edges: 5
- Unresolved references: 0
- Control-flow fragments: 0
- Unresolved jumps: 0
- Unsupported constructs: 0
- Control-flow coverage: 100%
- Required diagrams: 1
- Generated diagrams: 1

## Diagrams

### KnowledgeUnit Neighborhood

```mermaid
flowchart LR
    class_fvtez6_knowledgeunit("KnowledgeUnit")
    file_h6a0xu_knowledgeunit_cs("KnowledgeUnit")
    file_17um7nh_knowledgeunittype_cs[/"KnowledgeUnitType"/]
    file_1m6x5qy_knowledgeunitlink_cs[/"KnowledgeUnitLink"/]
    file_lcvwj6_ebook_cs[/"Ebook"/]
    type_sahnml_knowledgeunit[/"KnowledgeUnit"/]
    file_h6a0xu_knowledgeunit_cs -->|KnowledgeUnitType| file_17um7nh_knowledgeunittype_cs
    file_h6a0xu_knowledgeunit_cs -->|KnowledgeUnitLink| file_1m6x5qy_knowledgeunitlink_cs
    file_h6a0xu_knowledgeunit_cs -->|Ebook| file_lcvwj6_ebook_cs
```

## Diagram Validation

- Status: pass
