@dazitech/cli 3.0.9 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/clis/dazi-app.js +2 -2
- package/dist/clis/dazi-flow.js +2 -2
- package/dist/clis/dazi-onto.js +324 -41
- package/dist/clis/dazi.js +407 -185
- package/dist/docs/flow/flow-project-guide.md +1 -1
- package/dist/docs/guides/cli-reference.md +16 -3
- package/dist/docs/guides/troubleshooting.md +3 -3
- package/dist/docs/index.json +3 -15
- package/dist/docs/onto/dazi_script_sdk_reference.md +246 -244
- package/dist/docs/onto/dazi_script_seed_data_guide.md +1 -1
- package/dist/docs/onto/function-guide.md +123 -123
- package/dist/docs/onto//346/234/254/344/275/223/345/210/206/347/261/273/350/247/204/345/210/222/344/270/216SDK/346/211/251/345/261/225/346/226/271/346/241/210.md +169 -168
- package/dist/docs/onto//346/234/254/344/275/223/345/221/275/345/220/215/350/247/204/350/214/203_/347/211/251/347/220/206/350/241/250Cube/344/270/216/345/257/271/350/261/241.md +403 -402
- package/dist/docs/onto//346/234/254/344/275/223/345/274/200/345/217/221/344/274/230/345/214/226/346/200/273/347/273/223.md +257 -0
- package/dist/docs/onto//346/234/254/344/275/223/350/204/232/346/234/254/347/274/226/345/206/231/346/214/207/345/215/227.md +339 -311
- package/dist/docs/onto//346/234/254/344/275/223/350/247/204/345/210/222/346/214/207/345/215/227.md +305 -281
- package/dist/docs/onto//350/204/232/346/234/254/350/277/220/350/241/214/345/270/270/350/247/201/351/224/231/350/257/257/345/244/204/347/220/206.md +297 -0
- package/dist/examples/index.json +222 -6
- package/dist/examples/onto/README.md +34 -36
- package/dist/examples/onto/_templates/onto_preflight.ps1 +84 -0
- package/dist/examples/onto/index.json +53 -0
- package/dist/examples/onto/index.yaml +29 -0
- package/dist/examples/onto//345/210/251/346/266/246/347/244/272/344/276/213/README.md +23 -0
- package/dist/examples/onto//345/210/251/346/266/246/347/244/272/344/276/213/functions/save_test_arguments.ps1 +12 -11
- package/dist/{docs/onto → examples/onto//345/210/251/346/266/246/347/244/272/344/276/213/plans}//350/247/204/345/210/222/347/244/272/344/276/213_/345/210/251/346/266/246/345/210/206/346/236/220/346/234/254/344/275/223/346/226/271/346/241/210.md +37 -35
- package/dist/examples/onto//345/210/251/346/266/246/347/244/272/344/276/213/setup/profit_category_mount.py +85 -0
- package/dist/examples/onto//345/210/251/346/266/246/347/244/272/344/276/213/setup/profit_ontology_init.py +3 -66
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/README.md +24 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/equip_ops_fn_availability_analysis.py +84 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/equip_ops_fn_downtime_breakdown.py +119 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/equip_ops_fn_energy_intensity.py +98 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/equip_ops_fn_get_summary.py +125 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/equip_ops_fn_maintenance_compliance.py +77 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/equip_ops_fn_mom_analysis.py +118 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/equip_ops_fn_oee_analysis.py +126 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/equip_ops_fn_plan_vs_actual.py +105 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/equip_ops_fn_top_fault_equipment.py +104 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/equip_ops_fn_unit_comparison.py +120 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/equip_ops_fn_yoy_analysis.py +115 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/save_test_arguments.ps1 +42 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/test_arguments/equip_ops.fn.availability_analysis.json +7 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/test_arguments/equip_ops.fn.downtime_breakdown.json +8 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/test_arguments/equip_ops.fn.energy_intensity.json +8 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/test_arguments/equip_ops.fn.get_summary.json +7 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/test_arguments/equip_ops.fn.maintenance_compliance.json +7 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/test_arguments/equip_ops.fn.mom_analysis.json +8 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/test_arguments/equip_ops.fn.oee_analysis.json +8 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/test_arguments/equip_ops.fn.plan_vs_actual.json +8 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/test_arguments/equip_ops.fn.top_fault_equipment.json +8 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/test_arguments/equip_ops.fn.unit_comparison.json +8 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/functions/test_arguments/equip_ops.fn.yoy_analysis.json +8 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/plans//345/214/226/345/267/245/350/256/276/345/244/207/350/277/220/350/220/245/345/210/206/346/236/220/346/234/254/344/275/223/346/226/271/346/241/210.md +735 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/setup/equip_ops_category_mount.py +106 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/setup/equip_ops_ontology_init.py +1077 -0
- package/dist/examples/onto//350/256/276/345/244/207/350/277/220/350/220/245/setup/equip_ops_seed_data.py +552 -0
- package/dist/examples/onto//351/224/200/345/224/256/347/244/272/344/276/213/README.md +23 -0
- package/dist/examples/onto//351/224/200/345/224/256/347/244/272/344/276/213/functions/save_test_arguments.ps1 +13 -12
- package/dist/{docs/onto → examples/onto//351/224/200/345/224/256/347/244/272/344/276/213/plans}//350/247/204/345/210/222/347/244/272/344/276/213_/344/272/247/345/223/201/351/224/200/345/224/256/346/234/254/344/275/223/350/247/204/345/210/222/346/226/271/346/241/210.md +34 -34
- package/dist/examples/onto//351/224/200/345/224/256/347/244/272/344/276/213/setup/sales_category_mount.py +82 -0
- package/dist/examples/onto//351/224/200/345/224/256/347/244/272/344/276/213/setup/sales_ontology_init.py +3 -54
- package/dist/prompts/index.json +8 -1
- package/dist/prompts/onto/function-design.md +73 -73
- package/dist/prompts/onto/planning-design.md +226 -0
- package/dist/prompts/onto/script-publish-run.md +231 -208
- package/package.json +1 -1
- package/dist/docs/onto//350/204/232/346/234/254/350/277/220/350/241/214/347/272/240/351/224/231_/345/225/206/345/212/241/346/210/220/346/234/254/346/226/271/346/241/210/345/274/200/345/217/221/350/277/207/347/250/213.md +0 -213
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"""化工设备运营分析 — 347 分类挂载(init + seed + 全部函数 publish 之后执行)
|
|
2
|
+
|
|
3
|
+
放置:项目/DAZI_TEST/本体/ontos/设备运营/setup/equip_ops_category_mount.py
|
|
4
|
+
发布:dazi onto script publish 项目/DAZI_TEST/本体/ontos/设备运营/setup/equip_ops_category_mount.py --space space_cate_test01 --type setup
|
|
5
|
+
规划对照:项目/DAZI_TEST/本体/ontos/设备运营/plans/化工设备运营分析本体方案.md 附录 B
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import json
|
|
9
|
+
|
|
10
|
+
CATEGORY_REGISTRY = {
|
|
11
|
+
"table": {
|
|
12
|
+
"维度表": [
|
|
13
|
+
"dim_plant",
|
|
14
|
+
"dim_process_unit",
|
|
15
|
+
"dim_equipment_type",
|
|
16
|
+
"dim_equipment",
|
|
17
|
+
"dim_downtime_reason",
|
|
18
|
+
],
|
|
19
|
+
"事实表": [
|
|
20
|
+
"fact_equipment_daily_ops",
|
|
21
|
+
"fact_downtime_event",
|
|
22
|
+
"fact_maintenance_record",
|
|
23
|
+
"fact_equipment_plan",
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
"cube": {
|
|
27
|
+
"流程型": ["OperationCube", "DowntimeCube", "MaintenanceCube"],
|
|
28
|
+
"主体型": ["EquipmentCube", "PlantCube", "ProcessUnitCube"],
|
|
29
|
+
"对比型": ["PlanVsActualCube"],
|
|
30
|
+
},
|
|
31
|
+
"object": {
|
|
32
|
+
"主数据": ["Plant", "ProcessUnit", "EquipmentType", "Equipment"],
|
|
33
|
+
"参考": ["DowntimeReason"],
|
|
34
|
+
"事务": ["OperationSnapshot", "DowntimeEvent", "MaintenanceRecord"],
|
|
35
|
+
"分析": ["EquipmentAnalysis", "PlanAnalysis"],
|
|
36
|
+
},
|
|
37
|
+
"relation": {
|
|
38
|
+
"时间关联": [
|
|
39
|
+
("fact_equipment_daily_ops", "dim_date"),
|
|
40
|
+
("fact_downtime_event", "dim_date"),
|
|
41
|
+
("fact_maintenance_record", "dim_date"),
|
|
42
|
+
("fact_equipment_plan", "dim_date"),
|
|
43
|
+
],
|
|
44
|
+
"主数据关联": [
|
|
45
|
+
("dim_process_unit", "dim_plant"),
|
|
46
|
+
("dim_equipment", "dim_equipment_type"),
|
|
47
|
+
("dim_equipment", "dim_plant"),
|
|
48
|
+
("dim_equipment", "dim_process_unit"),
|
|
49
|
+
("fact_equipment_daily_ops", "dim_equipment"),
|
|
50
|
+
("fact_downtime_event", "dim_equipment"),
|
|
51
|
+
("fact_downtime_event", "dim_downtime_reason"),
|
|
52
|
+
("fact_maintenance_record", "dim_equipment"),
|
|
53
|
+
("fact_equipment_plan", "dim_equipment"),
|
|
54
|
+
],
|
|
55
|
+
"层级自关联": [
|
|
56
|
+
("dim_equipment_type", "dim_equipment_type"),
|
|
57
|
+
("dim_downtime_reason", "dim_downtime_reason"),
|
|
58
|
+
],
|
|
59
|
+
"预实关联": [
|
|
60
|
+
("fact_equipment_plan", "fact_equipment_daily_ops"),
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
"link": {
|
|
64
|
+
"归属关系": [
|
|
65
|
+
"unit_belongs_plant",
|
|
66
|
+
"equipment_belongs_plant",
|
|
67
|
+
"equipment_belongs_unit",
|
|
68
|
+
"equipment_has_type",
|
|
69
|
+
"snapshot_for_equipment",
|
|
70
|
+
"downtime_on_equipment",
|
|
71
|
+
"downtime_has_reason",
|
|
72
|
+
"maint_for_equipment",
|
|
73
|
+
],
|
|
74
|
+
"层级关系": ["equip_type_has_parent", "reason_has_parent"],
|
|
75
|
+
"对比关系": ["plan_compared_to_actual"],
|
|
76
|
+
"分析归因": [
|
|
77
|
+
"analysis_by_equipment",
|
|
78
|
+
"analysis_by_plant",
|
|
79
|
+
"analysis_by_unit",
|
|
80
|
+
"analysis_by_downtime",
|
|
81
|
+
"analysis_by_maintenance",
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
"function": {
|
|
85
|
+
"总览分析": ["equip_ops.fn.get_summary", "equip_ops.fn.oee_analysis"],
|
|
86
|
+
"趋势分析": ["equip_ops.fn.yoy_analysis", "equip_ops.fn.mom_analysis"],
|
|
87
|
+
"结构分析": [
|
|
88
|
+
"equip_ops.fn.availability_analysis",
|
|
89
|
+
"equip_ops.fn.downtime_breakdown",
|
|
90
|
+
"equip_ops.fn.top_fault_equipment",
|
|
91
|
+
"equip_ops.fn.energy_intensity",
|
|
92
|
+
],
|
|
93
|
+
"预实分析": ["equip_ops.fn.plan_vs_actual"],
|
|
94
|
+
"组织分析": ["equip_ops.fn.maintenance_compliance", "equip_ops.fn.unit_comparison"],
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def main():
|
|
100
|
+
space_id = "space_cate_test01"
|
|
101
|
+
s = space.get(space_id)
|
|
102
|
+
output.print("=== 化工设备运营分析 — 347 分类挂载 ===")
|
|
103
|
+
cat_counts = s.categories.apply_registry(CATEGORY_REGISTRY, skip_missing=True)
|
|
104
|
+
output.print(f"OK 分类挂载: {json.dumps(cat_counts, ensure_ascii=True)}")
|
|
105
|
+
output.success("分类挂载完成")
|
|
106
|
+
output.print("__JSON_SUMMARY__" + json.dumps({"ok": True, "category_mounts": cat_counts}, ensure_ascii=True, default=str))
|