neo4j例子

match (a)-[r]->(b)
where type(r) in [‘sHAS’,’sHAS_dans’,’sHas_dan’,’sHAS_tech_t’,’sHAS_tech_ts’,’sHAS_tech’]
return id(a),a.id,replace(a.name,”\n”,””),r.name,id(b),b.id,replace(b.name,”\n”,”-“),labels(b)

match (a:Technology_info),(b:S_Technology_s),(c:Enterprise_s)
where a.disable=’0′ and a.gongyimingcheng=b.name and b.qiyemingcheng=c.qiyemingcheng
merge (c)-[r:sHAS_tech{name:a.gongyimingcheng}]->(a)
return c,a,r.name

MATCH (a:Enterprise_s),(b:S_Dangerous),(c:Dangerou)
where a.qiyemingcheng=b.qiyemingcheng and (b.chanpinzuidachuliang <>” or b.chanpinzuidachuliang1 <> ”) and b.disable <> ‘1’ and b.zhongwenming = c.name
merge (a)-[r:sHAS_dans{name:”重点危化品存储”}]->(c)
return a,r,c.name

MATCH (a:Enterprise_s),(b:S_Dangerous),(c:Dangerou)
where a.qiyemingcheng=b.qiyemingcheng and (b.chanpinshengchannen1 <>” or b.chanpinshengchanneng <> ”) and b.disable <> ‘1’ and b.zhongwenming = c.name
merge (a)-[r:sHAS_dans{name:”重点危化品生产”}]->(c)
return a,r,c.name

MATCH (a:Enterprise_s),(b:S_Dangerous),(c:Dangerou)
where a.qiyemingcheng=b.qiyemingcheng and (b.nianshejishiyonglian <>” or b.nianshejishiyongqiti <> ”) and b.disable <> ‘1’ and b.zhongwenming = c.name
merge (a)-[r:sHAS_dans{name:”重点危化品使用”}]->(c)
return a,r,c.name

match (a:Dangerous_s),(b:Dangerou),(c:Enterprise_s)
WHERE a.zhongwenming=b.name and a.qiyemingcheng=c.qiyemingcheng and a.weihuapinshejihuanji =~ “.*使用.*”
with c,b
merge (c)-[r:sHas_dan{name:”危化品使用”}]->(b)
return r
match (a:Park_s{id:”18″})-[r]->(b)-[r2]->(c)
where right(r2.name,2) <> “风险”
return a,b,c,r,r2

match (c:S_Technology_s),(a:Dangerou),(b:Technology_info)
where  c.zhongjianchanpin = a.name  and c.name=b.gongyimingcheng and b.disable <> ‘1’
with b,a
match (b),(a),(d:Dangerou_category)
where a.name = d.pinming and d.disable <> ‘1’ and d.huaxuepinleixing=”重点监管危险化学品”
merge (b)-[r:sHAS_tech_ts{name:’重点危化品中间产品’}]->(a)
return b,a

Leave a Reply

Your email address will not be published. Required fields are marked *