tasks: AbutioGraph is a time-series kowledge graph database for real-time OLAP。 AbutioGraph是一款端到端的流式数据实时分析的图谱数据库,实时(流式写入实时、高QPS决策分析实时、流式预处理实时)表现在: AbutioGraph具有多种数据库的特性,除传统图谱数据存储模型外,Abutio的目标是以足够低的延迟(亚秒级)来服务大规模图谱数据(达BP级)的实时决策分析。
AbutioGraph特别适用于业务指标系统建设、实时交互式数据分析、可视化大屏展现、IOT流式数据监测、拓扑数据动态行为计算、相同点边id的数据根据标签分类管理等等。
AbutioGraph使用Java/C++开发,支持Aremli、Gremli、GraphQL查询语法,并支持与Java进行混合编程开发和Pytho API。 分布式企业级图数据库,提供图数据的实时-存储、查询和OLAP分析能力,主要面向对 及一切希望在亚秒实现关联数据分析的场景 - 执行查询即所得、数据写入即见变化,类似于Kafka、Flik、Kyli等系统,不过Abuio旨在关联计算上弥补缺陷,所以它更擅长处理关联分析问题,且比传统图数据库更节省计算资源和响应时间。
视频介绍 Abutio的TmpGraph实例使用临时缓存持久化数据,无需安装部署即可体验大部分功能,程序执行完毕则释放空间,本意是方便开发者本地调试编写的程序。
TmpGraph推荐使用jdk8/11进行开发。此外,abutio-jshell是系统封装的一个REPL启动命令,可以直接输入业务代码并查看其执行结果。 Ps:可见,实体和关系可以0属性,这是RDF图谱的特性。此外,实体和关系也无需完全对应,允许孤立点和孤立边数据的导入。 Ps:因为Etity和Edge都属于Kowledge类,因此实体与关系数据无需分开,可以混合导入,数据库会自动区分。 时序动态图谱实际是一种预计算技术,其核心思想是提前计算和存储某些计算结果,以便在需要时能够更快地获取结果,用于提高应用程序的响应时间。 1)构建图谱 2)模拟数据 3)导入数据 查看结果: 查看结果: 可见,与schema预设一致,"hercules"的Etity中,cout自动累加成2(1+1),hll也由1变成了2(hydra与emea两个不重复),而时间则都是2023-10-08(开始和结束点是该天的窗口界限);Edge中,total_duratio变成了新老数据只和。 结果打印效果: 可见,节点"hercules"的Etity有两条已经完成所有属性聚合的数据(不同时间窗口的两天);而"hercules to emea"的Edge是全局聚合,所以始终会聚合属性并合并成一条边。 AbutioGraph旨在为需要关联数据实时分析的场景提供解决方案,即需要在超大数据量的图谱中立即返回统计分析结果,而不是像传统图数据库那样查询后等待漫长的计算过程,尽管这种实时响应计算分析的场景在每个项目中仅占2%-30%的需求,恰是这一部分需求会拖垮整个平台的使用体验。
安装包下载
git cloe https://www.modelscope.c/AbutioGraph/abutio_graph_db_istall_package.git
用于大数据量高吞吐率和低延迟的同时,实时反馈数据态势变化(异常)情况,保障决策分析业务7*24小时在线运行。
支持功能
AbutioGraph
Neo4j
TigerGraph
分布式
√
X
√
RDF图模型
√
X
X
属性图模型
√
√
√
实时增删查改
√
√
√
TB级大容量
√
√
√
高性能批量导入
√
√
√
点边检索、全文检索
√
√
√
千万顶点/秒的高吞吐率
√
√
√
对接流式数据源、关系型数据源
√
√
√
图分析算法
√
√
√
高可用性支持
√
√
√
图谱可视化工具
√
√
√
读写任务内高效并行存储)
√
√
√
在线/离线、全量/增量的备份恢复
√
√
√
多图(大图与多个子图)
√
√
√
丰富的离线图算法
√
√
√
-
-
-
单独删除点边(支持独立点/边存储)
√
X
X
动态新增/隐藏字段
√
X
X
√
X
X
实时大数据流式图 存储/计算/更新
√
X
X
多重/多维图关系(每对点间都允许多种不同标签的边共存)
√
X
X
多重/多维图实体(每个点上都允许多种不同标签的点共存)
√
X
X
动图-时序关系聚合(根据年月日等时间窗口-自动合并边属性)
√
X
X
动图-时序实体聚合(根据年月日等时间窗口-自动合并点属性)
√
X
X
导出图数据到大数据平台继续计算(Spark/Flik/Hadoop等。
对接AI算法作为特征工程库,实时更新模型指标,实时取用)√
X
X
√
X
X
分布式图实例
√
X
X
节点模糊查询
√
X
X
自定义节点类型
√
X
X
图数据库专家支持服务
√
X
X
希望快速从大规模历史数据中得出统计分析报告用于决策,数据探索-秒内响应、年月日时间窗口分析-秒内响应等。
希望从实时源源不断产生数据的iot/应用程序中立即反映趋势,态势感知、实时聚合计算、时序指标变化规律等。
希望将同一个id-人身份证等,绑定上工商/税务/车房产/银行/通话等不同结构的数据,并通过设定标签识别类别数据,实现高效管理与查询。
希望导入的实体与关系自动实现关联,而不是明确“点表/边表”必须一一具备,允许孤立点。此外,希望自动汇总一跳邻居节点信息如:出度入度、基数统计、百分位数等,实现复杂关联指标的即席查询。
希望在一个图谱中实现不同用户导入的数据仅自己可见,或授权可见,很适用于公安、政府、跨部门、多用户协作等场景。 快速上手体验
传统静态图谱
AbutioGraph的Schema由etity和edge组成,缺少任一项也是允许的。其中,维度标签都由Dimesio类定义,label第二个参数为标签描述,可缺省;property的字段可以指定为任意类型,只要写入数据类型一致即可。Schema schema = Schema
.etity(
Dimesio.label("V|Tita", "太阳神").property("age", Iteger.class).build(),
Dimesio.label("V|God", "上帝").property("age", Iteger.class).build(),
Dimesio.label("V|Demigod", "小神").property("age", Iteger.class).build(),
Dimesio.label("V|Huma", "人类").property("age", Iteger.class).build(),
Dimesio.label("V|Moster", "怪物").build(),
Dimesio.label("V|Locatio", "场景").build()
).edge(
Dimesio.label("E|Father", "父亲").build(),
Dimesio.label("E|Brother", "兄弟").build(),
Dimesio.label("E|Mother", "母亲").build(),
Dimesio.label("E|Battled", "战争")
.property("time", Iteger.class)
.property("place", Geoshape.class)
.build(),
Dimesio.label("E|Pet", "宠物").build(),
Dimesio.label("E|Lives", "生活").property("reaso", Strig.class).build()
).build();
Graph g = G.TmpGraph("Gods", schema);
Etity satur = Kowledge.dimV("V|Tita").vertex("satur").property("age", 10000).build();
Etity sky = Kowledge.dimV("V|Locatio").vertex("sky").build();
Etity jupiter = Kowledge.dimV("V|God").vertex("jupiter").property("age", 5000).build();
Etity eptue = Kowledge.dimV("V|God").vertex("eptue").property("age", 4500).build();
Etity hercules = Kowledge.dimV("V|Demigod").vertex("hercules").property("age", 30).build();
...
// jupiter relatio
Edge eg = Kowledge.dimE("E|Father").edge("jupiter", "satur", true).build();
Edge eg1 = Kowledge.dimE("E|Lives").edge("jupiter", "sky", true).property("reaso", "loves fresh breezes").build();
Edge eg2 = Kowledge.dimE("E|Brother").edge("jupiter", "eptue", true).build();
//hercules relatio
Edge eg7 = Kowledge.dimE("E|Father").edge("hercules", "jupiter", true).build();
Edge eg8 = Kowledge.dimE("E|Mother").edge("hercules", "alcmee", true).build();
Edge eg9 = Kowledge.dimE("E|Battled").edge("hercules", "emea", true).property("time", 1).property("place", Geoshape.poit(38.1, 23.7)).build();
Edge eg10 = Kowledge.dimE("E|Battled").edge("hercules", "hydra", true).property("time", 2).property("place", Geoshape.poit(37.7, 23.9)).build();
...
List<Edge> edges = Lists.ewArrayList(eg, eg1, eg2, eg3, eg4, eg5, ...);
g.addKow(satur, sky, sea, jupiter, eptue, hercules, ...).exec();
g.addKow(edges).exec();
Aremli语法规则:piplie大写字母开头的为功能函数,后接小写开头的都为该功能函数的参数,直到下一个大写开头的功能函数出现。
Iterable<? exteds Kowledge> sca1 = g.V("satur").dims().exec();
System.out.pritl(Lists.ewArrayList(sca1));
// [Etity[vertex=satur,dimesio=Tita,properties=Properties[age=<java.lag.Iteger>10000]]]
Iterable<? exteds Object> sca2 = g.V("satur").I().dim("E|Father").I().dim("E|Father").exec();
System.out.pritl(Lists.ewArrayList(sca2));
// ["hercules"]
Iterable<? exteds Etity> sca3 = g.V().dim("V|Huma").has("age").by(P.LessTha(50)).exec();
System.out.pritl(JsoSerialiser.serialise(sca3));
DimsCouter couter = g.V("satur").OutV().dims().CoutDims().exec();
System.out.pritl(Lists.ewArrayList(couter));
//[DimsCouter[etityDims={Tita=1},edgeDims={},limitHit=false]]
System.out.pritl(Lists.ewArrayList( g.V().ToEtityIds().exec() ));
// [EtityKey[vertex=hercules], EtityKey[vertex=hydra], EtityKey[vertex=cerberus], ...]
Iterable<Object> sca6 = g.V("jupiter").OutV().dims().Map(F.ItFuc(x-> ((Kowledge)x).getDimesio())).exec();
System.out.pritl(JsoSerialiser.serialise(sca6));
// ["god","Tita","god","locatio"]
进阶-时序动态图谱
静态图谱:只需要指定字段及类型;
动态图谱:需要指定字段类型、聚合函数、序列化函数(可选)、.groupBy()聚合窗口;
Ps:静态图谱和动态图谱可以节点不同维度的形式异构存储。
可见property多了一些聚合配置(除默认功能外,聚合函数可自定义):Graph g = G.TmpGraph("Gods", Schema
.etity(
Dimesio.label("Vgg|TimeWidow", "")
.property("startDate", Date.class, Agg.Mi())
.property("stopDate", Date.class, Agg.Max())
.property("hll", DistictCoutHll.class, Agg.DistictCoutHll(), ew DistictCoutHllSerialiser())
.property("freq", FreqMap.class, Agg.FreqMap(), ew FreqMapSerialiser())
.property("cout", Iteger.class, Agg.Sum())
.groupBy("startDate", "stopDate") // 指定聚合窗口; 不指定字段即为全局聚合:.groupBy()
.build())
.edge(
Dimesio.label("Egg|Merge", "合并边")
.property("total_duratio", Double.class, Agg.Sum())
.groupBy()
.build()
).build());
起点(人), 终点(地点), 关系标签, 发生时间, 持续时长
"hercules", "emea", Battled, 2023-10-08, 20.0
"hercules", "hydra", Battled, 2023-10-08, 10.1
"hercules", "hydra", Battled, 2023-10-09, 10.1
"hercules", "hydra", Battled, 2023-10-09, 11.1
下面我们将模拟流式数据一条一条的导入并立即查看存储效果。
Etity ett1 = Kowledge.dimV("Vgg|TimeWidow")
.vertex("hercules") //人名作为节点id
.property("startDate", DateUtil.parse("2023-10-08 00:00:00")) //开始时间(窗口开)
.property("stopDate", DateUtil.parse("2023-10-08 23:59:59")) //结束时间(窗口闭)
.property("hll", ew DistictCoutHll().update("emea")) //将尾节点放入基数统计类
.property("freq", ew FreqMap().update("emea")) //将尾节点放入频率估计类
.property("cout", 1) //本次自动+1
.build();
Edge edge1 = Kowledge.dimE("Egg|Merge")
.edge("hercules","emea",true)
.property("total_duratio", 20.0d)
.build();
g.addKow(ett1,edge1).exec();
System.out.pritl(JsoSerialiser.serialise(
g.V("hercules").dim("Vgg|TimeWidow").exec()
));
[{"class":"Etity","dimesio":"Vgg|TimeWidow","vertex":"hercules","properties":
{"freq":{"FreqMap":{"emea":1}},"cout":1,"hll":{"DistictCoutHll":{"cardiality":1.0}},"startDate":{"java.util.Date":1696694400000},"stopDate":{"java.util.Date":1696780799000}}}]
System.out.pritl(JsoSerialiser.serialise(
g.E("hercules->emea").dim("Egg|Merge").exec()
));
[{"class":"Edge","dimesio":"Egg|Merge","source":"hercules","target":"emea","directed":true,"properties":{"total_duratio":20.0}}]
Etity ett2 = Kowledge.dimV("Vgg|TimeWidow")
.vertex("hercules") //
.property("startDate", DateUtil.parse("2023-10-08 00:00:00")) //开始时间(窗口开)
.property("stopDate", DateUtil.parse("2023-10-08 23:59:59")) //结束时间(窗口闭)
.property("hll", ew DistictCoutHll().update("hydra")) //将尾节点放入基数统计类
.property("freq", ew FreqMap().update("hydra")) //将尾节点放入频率估计类
.property("cout", 1) //本次自动+1
.build();
Edge edge2 = Kowledge.dimE("Egg|Merge")
.edge("hercules","emea",true)
.property("total_duratio", 10.1d)
.build();
g.addKow(ett2,edge2).exec();
System.out.pritl(JsoSerialiser.serialise(
g.V("hercules").dim("Vgg|TimeWidow").exec()
));
[{"class":"Etity","dimesio":"Vgg|TimeWidow","vertex":"hercules","properties":
{"freq":{"FreqMap":{"hydra":1,"emea":1}},"cout":2,"hll":{"DistictCoutHll":{"cardiality":2.0}},"startDate":{"java.util.Date":1696694400000},"stopDate":{"java.util.Date":1696780799000}}}]
System.out.pritl(JsoSerialiser.serialise(
g.E("hercules->emea").dim("Egg|Merge").exec()
));
[{"class":"Edge","dimesio":"Egg|Merge","source":"hercules","target":"emea","directed":true,"properties":{"total_duratio":30.1}}]
// "hercules", "hydra", Battled, 2023-10-09, 10.1
// "hercules", "hydra", Battled, 2023-10-09, 11.1 Etity ett3 = Kowledge.dimV("Vgg|TimeWidow")
.vertex("hercules")
.property("startDate", DateUtil.parse("2023-10-09 00:00:00"))
.property("stopDate", DateUtil.parse("2023-10-09 23:59:59"))
.property("hll", ew DistictCoutHll().update("hydra").update("hydra"))
.property("freq", ew FreqMap().update("hydra").update("hydra"))
.property("cout", 2) //本次自动+2:篇幅影响,两条数据手动合并录入了
.build();
Edge edge3 = Kowledge.dimE("Egg|Merge")
.edge("hercules","emea",true)
.property("total_duratio", 10.1d+11.1d)
.build();
g.addKow(ett3,edge3).exec();
// 打印结果:
System.out.pritl(JsoSerialiser.serialise(
g.V("hercules").dim("Vgg|TimeWidow").exec()
));
System.out.pritl(JsoSerialiser.serialise(
g.E("hercules->emea").dim("Egg|Merge").exec()
));
[{"class":"Etity","dimesio":"Vgg|TimeWidow","vertex":"hercules","properties":{"freq":{"FreqMap":{"hydra":2}},"cout":2,"hll":{"DistictCoutHll":{"cardiality":1.0}},"startDate":{"java.util.Date":1696780800000},"stopDate":{"java.util.Date":1696867199000}}},
{"class":"Etity","dimesio":"Vgg|TimeWidow","vertex":"hercules","properties":{"freq":{"FreqMap":{"hydra":1,"emea":1}},"cout":2,"hll":{"DistictCoutHll":{"cardiality":2.0}},"startDate":{"java.util.Date":1696694400000},"stopDate":{"java.util.Date":1696780799000}}},
{"class":"Edge","dimesio":"Egg|Merge","source":"hercules","target":"emea","directed":true,"properties":{"total_duratio":51.3}}]
AbutioGraph-解决方案展示
公安经济侦察
平安车险理赔风控
天然气感知分析
中国烟草科技图谱
5G物联网设备诊断
科研时序搜索引擎
生物基因知识库
科协态势感知系统
电信话单分析方案
流式销量预测-时序AI特征指标中台
航天搜索引擎问答知识库
点击空白处退出提示
评论