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

neo4j

MATCH (n:Test) RETURN distinct keys(n)   查看哪些属性

https://www.cnblogs.com/jstarseven/p/9546602.html  例子

https://www.it1352.com/1674148.html 模糊查询

https://blog.csdn.net/weixin_40739969/article/details/101781409  字符串函数
https://www.w3cschool.cn/neo4j/neo4j_cql_union.html 手册

https://www.cnblogs.com/sea520/p/11940400.html   关系复杂查询

https://www.jianshu.com/p/8b9b49e9e3cf   详细用法

https://www.jianshu.com/p/8b9b49e9e3cf neo4j的一些特别用法

 

大数据方案设计

 

debezium   可以轻松将 mysql,mongodb等数据库,增量同步到kafka中

kafka         一个重要的流平台

doris         非常适合的olap数据分析库,使用mysql的标准接口就可以访问

Doris 的目标是:实现低成本(主要针对商业产品),可线性扩展,支持云化部署,高可用,高查询性能,高加载性能。

clickhouse   单机强

es             搜索引擎,目前用在单应用分析上

 

使用debezium同步数据,使用kafka的消费生产用户需要的表,将表同步到doris中提供用户的分析需求

若宽表数据发生结构变换,需要对doris进行调整,这时候可以考虑重建doris的同步任务。    doris用来替代mysql。

https://cloud.tencent.com/developer/article/1506780  大数据需要一个OLAP

https://www.apache.org/dyn/closer.cgi?path=/incubator/doris/0.12.0-incubating/apache-doris-0.12.0-incubating-src.tar.gz   doris下载

http://doris.incubator.apache.org/master/zh-CN/administrator-guide/load-data/routine-load-manual.html  doris手册

https://zhuanlan.zhihu.com/p/128068950   doris实践案例

https://www.jianshu.com/p/d3742af8ecce  doris介绍