# Create a Person node
person = Person(name="Sun Tzu", role="Military Strategist", era="Ancient China")
print(f"Person: {person.name}")
print(f"Label: {person.get_label()}")Person: Sun Tzu
Label: Person
Represents a human being, historical figure, or speaker referenced in content.
A human being, historical figure, or speaker.
Person: Sun Tzu
Label: Person
Represents a creative work such as a book, speech, article, or other authored content.
A creative work (book, speech, article, etc.).
Work: The Art of War
GraphNode name: The Art of War
Represents an abstract idea, theory, or framework discussed in content.
An abstract idea, theory, or framework.
Represents a subject or theme discussed in content, typically extracted via topic modeling or NLP.
A subject or theme discussed in content.
Represents a specific verbatim segment of text that is noteworthy or frequently referenced.
A verbatim segment of notable text.
Quote: 'All warfare is based on deception.'
Speaker: Sun Tzu
from cjm_graph_plugin_system.core import SourceRef
# Source reference to a transcript
source = SourceRef(
plugin_name="cjm-transcription-plugin-voxtral-hf",
table_name="transcriptions",
row_id="lecture-001"
)
# Create domain nodes
author = Person(name="Sun Tzu", role="Military Strategist")
book = Work(title="The Art of War", author_name="Sun Tzu")
concept = Concept(name="Deception", domain="Military Strategy")
quote = Quote(text="All warfare is based on deception.", speaker="Sun Tzu")
# Convert to GraphNodes with provenance
nodes = [
author.to_graph_node(sources=[source]),
book.to_graph_node(sources=[source]),
concept.to_graph_node(sources=[source]),
quote.to_graph_node(sources=[source])
]
print(f"Created {len(nodes)} graph nodes:")
for node in nodes:
print(f" - {node.label}: {node.properties.get('name', 'N/A')}")Created 4 graph nodes:
- Person: Sun Tzu
- Work: The Art of War
- Concept: Deception
- Quote: All warfare is based on deception.