cd /data01/sunxy/hugegraph/apache-hugegraph-incubating-1.3.0/bin
./start-hugegraph.sh
cd /data01/sunxy/hugegraph/apache-hugegraph-toolchain-incubating-1.3.0/apache-hugegraph-loader-incubating-1.3.0/bin
./hugegraph-loader.sh -g hugegraph -f /data01/sunxy/hugegraph/hgdata/struct.json -s /data01/sunxy/hugegraph/hgdata/schema.groovy -h XXX -p 8080
cd /data01/sunxy/hugegraph/apache-hugegraph-toolchain-incubating-1.3.0/apache-hugegraph-tools-incubating-1.3.0/bin
./hugegraph --url http://XXX:8080 --graph hugegraph graph-list
./hugegraph --url http://XXX:8080 --graph hugegraph graph-clear -c “I’m sure to delete all data”
cd /data01/sunxy/hugegraph/apache-hugegraph-toolchain-incubating-1.3.0/apache-hugegraph-hubble-incubating-1.3.0/bin
./start-hubble.sh -d
http://XXX:8088
#查询顶点,一般作为图查询的第1步,后面可以续接的语句种类繁多
g.V()
g.V(‘1:DX_PO_VENDORS’)
g.V(‘1:DX_PO_VENDORS’).both()
g.V(‘1:DX_PO_VENDORS’).in()
g.V(‘1:DX_PO_VENDORS’).out()
#查询图中所有的边
g.E()
#查询所有顶点的id
g.V().id()
#查询所有边的id
g.E().id()
#查询所有关联的边及相邻顶点(路径模式)
g.V(‘1:DX_USERS_VN’).bothE().bothV().path()
查找子树,查找从一个节点出发,到叶子节点结束的所有路径,这些路径的集合为一颗子树(子图)
g.V(‘1:DX_PUR_ASN’).repeat(out()).until(outE().count().is(0)).path()
查找从节点出发的所有路径(到叶子节点)
g.V(‘1:DX_PUR_ASN’).repeat(bothE().bothV().simplePath()).until(outE().count().is(0)).path()
#根据属性查顶点,需要建立索引
g.V().has(‘job’, ‘DX_GEAM_AST_DEVICE_SCRAP_TEAR’).id().toList()
g.V().hasLabel(‘jobbbByjob’).has(‘job’, ‘DX_GEAM_AST_DEVICE_SCRAP_TEAR’).id().toList()
查找从节点出发的所有路径(到叶子节点)
g.V(‘1:DX_PUR_ASN’).repeat(bothE().bothV().simplePath()).until(outE().count().is(0)).path()
根据ads表追溯到相关任务和表到源表!
g.V(‘2:dwd_em_mt_goods_supply_reception@DORIS’) // 从终点 T 开始
.repeat(__.in().simplePath()) // 逆向遍历入边,并禁止重复节点
.emit() // 在每次遍历时输出路径
.path() // 收集完整路径
.limit(100) // 限制返回结果数量(避免内存溢出)