Assembler components for the Sayou Data Platform
Project description
sayou-assembler
sayou-assembler is the graph construction engine of the Sayou Data Platform. It takes standardized nodes from sayou-wrapper and assembles them into a logical In-Memory Knowledge Graph.
It is responsible for interpreting relationships (like Parent-Child), generating reverse edges, and ensuring the graph's topological integrity before it is persisted by sayou-loader.
Philosophy
"Structure before Storage."
A database is just a container. The value of a Knowledge Graph comes from its structure. sayou-assembler focuses on the logic of connecting dots (Nodes) to create meaning (Context), independent of the underlying database technology (Neo4j, SQL, NetworkX).
🚀 Key Features
- In-Memory Graph Model: Manages
GraphNodeandGraphEdgeobjects efficiently in Python. - Hierarchy Strategy: Automatically builds tree-like structures using
parent_idattributes. - Bi-directional Linking: Automatically generates reverse edges (e.g.,
hasChildfromhasParent) to enable bidirectional graph traversal. - Strategy Pattern: Supports pluggable assembly strategies (Hierarchy, Semantic, Chronological).
📦 Installation
pip install sayou-assembler
⚡ Quickstart
The AssemblerPipeline creates the graph using a specified strategy (default: hierarchy).
import json
from sayou.assembler.pipeline import AssemblerPipeline
def run_demo():
# 1. Load Standard Nodes (Output from sayou-wrapper)
input_file = "wrapped_nodes.json"
with open(input_file, "r", encoding="utf-8") as f:
wrapper_output = json.load(f)
# 2. Initialize Pipeline
# Uses 'HierarchyBuilder' to link parent-child nodes
pipeline = AssemblerPipeline(strategy="hierarchy")
pipeline.initialize()
# 3. Run Assembly
kg_result = pipeline.run(wrapper_output)
# 4. Inspect Graph
print(f"Nodes: {kg_result['summary']['node_count']}")
print(f"Edges: {kg_result['summary']['edge_count']}")
for edge in kg_result['edges'][:3]:
print(f"{edge['source']} --[{edge['type']}]--> {edge['target']}")
if __name__ == "__main__":
run_demo()
🤝 Contributing
Contributions for new assembly strategies (e.g., constructing graphs based on keyword co-occurrence) are welcome.
📜 License
Apache 2.0 License © 2025 Sayouzone
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 Distribution
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 sayou_assembler-0.1.2.tar.gz.
File metadata
- Download URL: sayou_assembler-0.1.2.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ba6365e9485a4f1af555540fc8cce399f8740b406b93c0158fbf919007593aa
|
|
| MD5 |
cdfc1a6c474e87ff8aed36f50060ac7f
|
|
| BLAKE2b-256 |
2c2651d5774a294c6786cf580ad42df3cd0b38dc7c8016f02142dcf88fc0b6a1
|
File details
Details for the file sayou_assembler-0.1.2-py3-none-any.whl.
File metadata
- Download URL: sayou_assembler-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
feb1ee7e226e6cda9edf021d6b09b311c9bfcca67fa38d28e3eacb96346a5be7
|
|
| MD5 |
542b204e988641436b58e78f10b30f08
|
|
| BLAKE2b-256 |
dcb79fa0d4880a2411fa2ee1480ad948977aba2e4de21ab34e425503b7c5d3e6
|