hlzd-knowledge-graphlisted
Install: claude install-skill Alexxiang2008/hlzd-b2b-export-skills
# HLZD Knowledge Graph
B2B 实体抽取 + 轻量内存图 + BFS 查询 + DOT 导出。
## 节点类型
`customer` / `product` / `country` / `certification` / `hs_code` / `supplier`
## 边类型
| 边 | 含义 |
|---|---|
| `interested_in` | customer → product |
| `sourced_from` / `hosted_in` | customer → country |
| `certified_by` | product → certification |
| `classified_under` | product → hs_code |
| `ordered_from` | customer → supplier |
| `complies_with` | product/customer → standard |
## 用法
```python
from scripts import lib
text = "We need OCTG from Saudi Arabia with API 5CT and ISO 9001."
result = lib.run_pipeline(text, customer_name="Aramco",
query_product="OCTG",
query_country="Saudi Arabia")
# result["extracted_entities"] + result["graph"] + result["queries"]
```
## Output schema
```json
{
"$schema": "hlzd-knowledge-graph/v1",
"extracted_entities": {
"products": ["OCTG", "Steel Pipe"],
"countries": ["Saudi Arabia"],
"certifications": ["API 5CT", "ISO 9001"]
},
"graph": {
"nodes": [...],
"edges": [...],
"stats": {"node_count": 5, "edge_count": 6, "by_type": {...}}
},
"queries": {
"related_customers_for_product": [...],
"products_in_country": [...]
}
}
```
## DOT 导出
```python
import lib
g = lib.build_graph_from_entities(entities)
dot_str = lib.export_dot(g)
# `dot -Tpng > out.png`
```
## Related Skills
- `hlzd-inquiry-qualify` (上游) — inquiry JSON 输入
- `hlzd-buyer-finder` (上游) — buyer JSON 输入
- `hlzd-quot