Skip to main content

cjm-graph-domains

Install

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

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

from cjm_graph_domains.core import (
    DomainNode
)

Classes

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

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

Classes

class Person(DomainNode):
    "A human being, historical figure, or speaker."
class Work(DomainNode):
    "A creative work (book, speech, article, etc.)."
class Concept(DomainNode):
    "An abstract idea, theory, or framework."
class Topic(DomainNode):
    "A subject or theme discussed in content."
class Quote(DomainNode):
    "A verbatim segment of notable text."

Domain Relations (relations.ipynb)

Standard relationship types for knowledge and structure graphs

Import

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

Classes

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."
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

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

Classes

class Document(DomainNode):
    "A logical container for structured content."
class Segment(DomainNode):
    "An atomic unit of text within a document."

Metadata

Release files for cjm-graph-domains 0.0.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cjm-graph-domains 0.0.18
File Size Uploaded Provenance
cjm_graph_domains-0.0.18.tar.gz 10.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cjm-graph-domains 0.0.18
File Interpreter ABI Platform
cjm_graph_domains-0.0.18-py3-none-any.whl Python 3 none any Details

Total release size: 22.6 kB

Release files / cjm_graph_domains-0.0.18.tar.gz

Download URL cjm_graph_domains-0.0.18.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ad0d5254e3478abc53b0de4761bcf2051c264d2ea2931df65eb88291775929da
BLAKE2b-256 checksum
How to use checksums
75b7aadbbba73c50d668fdc0945b4cfd1d8fa5f5badcec6ecfcf58aae5153953
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / cjm_graph_domains-0.0.18-py3-none-any.whl

Download URL cjm_graph_domains-0.0.18-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c784a77e7697078bf3933cc9c04dc93f6ef1b182989e9525d0d88d76ce81b384
BLAKE2b-256 checksum
How to use checksums
72790342333312af7c8cd05715e6081cda0016b4eb00ef6b66444b83caa9c097
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for cjm-graph-domains 0.0.18

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page