Metadata-Version: 2.4
Name: cjm-graph-domains
Version: 0.0.6
Summary: A shared library of Pydantic models and standard schemas for the cjm-graph-plugin-system ecosystem, enabling type-safe domain definitions across plugins and UIs.
Author-email: "Christian J. Mills" <9126128+cj-mills@users.noreply.github.com>
License: Apache-2.0
Project-URL: Repository, https://github.com/cj-mills/cjm-graph-domains
Project-URL: Documentation, https://cj-mills.github.io/cjm-graph-domains
Keywords: nbdev,jupyter,notebook,python
Classifier: Natural Language :: English
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cjm_graph_plugin_system>=0.0.8
Dynamic: license-file

# cjm-graph-domains


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Install

``` bash
pip install cjm_graph_domains
```

## Project Structure

    nbs/
    ├── domains/ (3)
    │   ├── knowledge.ipynb  # Domain schemas for knowledge management (Person, Work, Concept, Topic, Quote)
    │   ├── relations.ipynb  # Standard relationship types for knowledge and structure graphs
    │   └── structure.ipynb  # Domain schemas for content structure (Document, Segment)
    └── core.ipynb  # Base Pydantic models and conversion logic for domain-specific graph schemas

Total: 4 notebooks across 1 directory

## Module Dependencies

``` mermaid
graph LR
    core[core<br/>Core]
    domains_knowledge[domains.knowledge<br/>Knowledge Domain]
    domains_relations[domains.relations<br/>Domain Relations]
    domains_structure[domains.structure<br/>Content Structure]

    domains_knowledge --> core
    domains_relations --> domains_knowledge
    domains_relations --> domains_structure
    domains_structure --> core
```

*4 cross-module dependencies detected*

## CLI Reference

No CLI commands found in this project.

## Module Overview

Detailed documentation for each module in the project:

### Core (`core.ipynb`)

> Base Pydantic models and conversion logic for domain-specific graph
> schemas

#### Import

``` python
from cjm_graph_domains.core import (
    DomainNode
)
```

#### Classes

``` python
class DomainNode(BaseModel):
    "Base Pydantic model for domain-specific graph nodes."
    
    def get_label(self) -> str:  # Node label for the graph (defaults to class name)
            """Return the node label."""
            return self.__class__.__name__
    
        def to_graph_node(
            self,
            sources: List[SourceRef] = []  # External data references for provenance
        ) -> GraphNode:  # Generic GraphNode for storage in graph plugins
        "Return the node label."
    
    def to_graph_node(
            self,
            sources: List[SourceRef] = []  # External data references for provenance
        ) -> GraphNode:  # Generic GraphNode for storage in graph plugins
        "Convert this domain model to a generic GraphNode."
```

### Knowledge Domain (`knowledge.ipynb`)

> Domain schemas for knowledge management (Person, Work, Concept, Topic,
> Quote)

#### Import

``` python
from cjm_graph_domains.domains.knowledge import (
    Person,
    Work,
    Concept,
    Topic,
    Quote
)
```

#### Classes

``` python
class Person(DomainNode):
    "A human being, historical figure, or speaker."
```

``` python
class Work(DomainNode):
    "A creative work (book, speech, article, etc.)."
```

``` python
class Concept(DomainNode):
    "An abstract idea, theory, or framework."
```

``` python
class Topic(DomainNode):
    "A subject or theme discussed in content."
```

``` python
class Quote(DomainNode):
    "A verbatim segment of notable text."
```

### Domain Relations (`relations.ipynb`)

> Standard relationship types for knowledge and structure graphs

#### Import

``` python
from cjm_graph_domains.domains.relations import (
    KnowledgeRelations,
    StructureRelations
)
```

#### Classes

``` python
class KnowledgeRelations:
    "Registry of standard edge types for knowledge graphs."
    
    def all(cls) -> list:  # List of all relation type strings
        "Return all defined relation types."
```

``` python
class StructureRelations:
    "Registry of standard edge types for content structure graphs."
    
    def all(cls) -> list:  # List of all relation type strings
        "Return all defined relation types."
```

### Content Structure (`structure.ipynb`)

> Domain schemas for content structure (Document, Segment)

#### Import

``` python
from cjm_graph_domains.domains.structure import (
    Document,
    Segment
)
```

#### Classes

``` python
class Document(DomainNode):
    "A logical container for structured content."
```

``` python
class Segment(DomainNode):
    "An atomic unit of text within a document."
```
