mirror of
https://github.com/OpenSPG/openspg.git
synced 2025-08-03 14:32:09 +00:00
96 lines
2.8 KiB
Plaintext
96 lines
2.8 KiB
Plaintext
namespace SupplyChain
|
|
|
|
`TaxOfProdEvent`/`价格上涨`:
|
|
rule: [[
|
|
Define (e:ProductChainEvent)-[p:belongTo]->(o:`TaxOfProdEvent`/`价格上涨`) {
|
|
Structure {
|
|
}
|
|
Constraint {
|
|
R1: e.index == '价格'
|
|
R2: e.trend == '上涨'
|
|
}
|
|
}
|
|
]]
|
|
|
|
`TaxOfCompanyEvent`/`成本上涨`:
|
|
rule: [[
|
|
Define (e:CompanyEvent)-[p:belongTo]->(o:`TaxOfCompanyEvent`/`成本上涨`) {
|
|
Structure {
|
|
}
|
|
Constraint {
|
|
R1: e.index == '成本'
|
|
R2: e.trend == '上涨'
|
|
}
|
|
}
|
|
]]
|
|
`TaxOfCompanyEvent`/`利润下跌`:
|
|
rule: [[
|
|
Define (e:CompanyEvent)-[p:belongTo]->(o:`TaxOfCompanyEvent`/`利润下跌`) {
|
|
Structure {
|
|
}
|
|
Constraint {
|
|
R1: e.index == '利润'
|
|
R2: e.trend == '下跌'
|
|
}
|
|
}
|
|
]]
|
|
|
|
`TaxOfProdEvent`/`价格上涨`:TaxOfCompanyEvent/`成本上涨`
|
|
rule: [[
|
|
Define (s:`TaxOfProdEvent`/`价格上涨`)-[p:leadTo]->(o:`TaxOfCompanyEvent`/`成本上涨`) {
|
|
Structure {
|
|
(s)-[:subject]->(prod:Product)-[:hasSupplyChain]->(down:Product)<-[:product]-(c:Company)
|
|
}
|
|
Constraint {
|
|
eventName = concat(c.name, "成本上升事件")
|
|
}
|
|
Action {
|
|
downEvent = createNodeInstance(
|
|
type=CompanyEvent,
|
|
value = {
|
|
subject=c.id
|
|
name=eventName
|
|
trend="上涨"
|
|
index="成本"
|
|
}
|
|
)
|
|
createEdgeInstance(
|
|
src=s,
|
|
dst=downEvent,
|
|
type=leadTo,
|
|
value={}
|
|
)
|
|
}
|
|
}
|
|
]]
|
|
|
|
`TaxOfCompanyEvent`/`成本上涨`:TaxOfCompanyEvent/`利润下跌`
|
|
rule: [[
|
|
Define (s:`TaxOfCompanyEvent`/`成本上涨`)-[p:leadTo]->(o:`TaxOfCompanyEvent`/`利润下跌`) {
|
|
Structure {
|
|
(s)-[:subject]->(c:Company)
|
|
}
|
|
Constraint {
|
|
eventName = concat(c.name, "利润下跌事件")
|
|
}
|
|
Action {
|
|
downEvent = createNodeInstance(
|
|
type=CompanyEvent,
|
|
value={
|
|
subject=c.id
|
|
name=eventName
|
|
trend="下跌"
|
|
index="利润"
|
|
}
|
|
)
|
|
createEdgeInstance(
|
|
src=s,
|
|
dst=downEvent,
|
|
type=leadTo,
|
|
value={}
|
|
)
|
|
}
|
|
}
|
|
]]
|
|
|