【问题标题】:Adding condition on the value of property of parent node to set value of property of child node in Neo4j在 Neo4j 中添加父节点属性值的条件以设置子节点属性值
【发布时间】:2022-10-03 17:22:05
【问题描述】:

我的数据库中有以下图表:

有一个保密要求节点 1我需要在节点 4.我需要设置的值评分节点 4基于从值节点 1.我不知道如何做到这一点。这是我的创建脚本:

CREATE 
(App4:App {name:          'Consumer Banking Portal No Review',  confidential_requirement: 'high', integrity_requirement: 'high', availability_requirement: 'high',           inherent_risk_rating: 'critical', crown_jewel_application: 'yes', internet_facing: 'yes', average_transaction: '100', max_number_of_daily_transaction: '200',         number_of_pii_record: '5000' }),

(feat1: FEATURE {name: "Update_Profile", desc: "update customer profile"}),

(gf_query: GENERIC_FEAT {name: "QUERY_INFO",  desc: "retrieve info"}),

(t_auth_read: THREAT {name: "Auth_Read_t", desc: "Compromise authorization in query info", impact: "Information Disclosure", rating: ""}),


(App4)-[:HAS]->(feat1),
(feat1)-[:HAS]->(gf_query),
(gf_query)-[:HAS]->(t_auth_read); 

【问题讨论】:

    标签: neo4j


    【解决方案1】:

    目前尚不清楚您要如何识别这些特定节点,但如果您想使用它们的名称和它们之间的距离,一种选择是:

    MATCH (a:App{name:'Consumer Banking Portal No Review'})-[*0..3]->(b:THREAT{name: 'Auth_Read_t'})
    SET b.rating = a.confidential_requirement
    RETURN a, b
    

    【讨论】:

      最近更新 更多