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.
Project description
cjm-graph-domains
Install
pip install cjm_graph_domains
Project Structure
nbs/
├── domains/ (2)
│ ├── knowledge.ipynb # Domain schemas for knowledge management (Person, Work, Concept, Topic, Quote)
│ └── relations.ipynb # Standard relationship types for knowledge graphs
└── core.ipynb # Base Pydantic models and conversion logic for domain-specific graph schemas
Total: 3 notebooks across 1 directory
Module Dependencies
graph LR
core[core<br/>Core]
domains_knowledge[domains.knowledge<br/>Knowledge Domain]
domains_relations[domains.relations<br/>Knowledge Relations]
domains_knowledge --> core
domains_relations --> domains_knowledge
2 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."
Knowledge Relations (relations.ipynb)
Standard relationship types for knowledge graphs
Import
from cjm_graph_domains.domains.relations import (
KnowledgeRelations
)
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."
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cjm_graph_domains-0.0.1-py3-none-any.whl.
File metadata
- Download URL: cjm_graph_domains-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5077eaf402ff23a7697a0dd15a8ac2672791ec7aa8a2bc51498720c0ca85e91c
|
|
| MD5 |
aedbc639c1ac087470406ff7b3372036
|
|
| BLAKE2b-256 |
3626733709e5dcaa9d2e615ef409ecbe5ffa6b732451ec43835eaad6611c9af6
|