[总目录]JanusGraph重要笔记

如果对您有有用,麻烦右边点个赞哦~~

 

资料查阅

 

远程连接JanusGraph Server(即gremlin-server)

 

JanusGraph数据库配置(官网中文翻译).https://blog.csdn.net/wzwdcld/article/details/82082760

JanusGraph·server端配置启动和远程remote连接·多实例问题 https://blog.csdn.net/wzwdcld/article/details/81460193

远程连接方法一

远程连接方法二

  • 官方github的examples,下载这个文件夹,用IDEA下载,其中有多个Maven模块,找到remote模块,其依赖于commons模块
  • <<janusgraph-examples.zip>>
  • 具体的:下图中的RemoteGraphAPP继承自JanusGraphApp,JanusGraphApp继承自GraghApp.java
  • RemoteGraphApp中只有 远程连接 和 打开Graph的逻辑, 创建Schema和其他元素的逻辑由 JanusGraphApp完成

    <<janusgraph-examples.zip>>

    上面压缩包里的项目从 RemoteGraphApp出运行,可以直接跑通, 服务器端可以查询到数据。

  • 程序运行逻辑: 

    • RemoteGraphApp的main函数

    • RemoteGraphApp的构造函数

    • JanusGraphApp的构造函数

    • GraphApp的构造函数

    • RemoteGraphApp实例调用runApp(),进入GraphApp的runApp();

    • RemoteGraphApp的openGraph()

      • client = cluster.connect(); 连接远端服务器
      •  graph = Empt
         g = graph.tr
         return g;
    • RemoteGraphApp的createSchema()
      • final String req = JanusGraphApp.createSchemaRequest();
      • final ResultSet resultSet = client.submit(req); //客户端提交gremlin的Schema的请求语句,并获得返回结果
    • RemoteGraphApp.createElements()
    • 远程测试结果:
    • GraphApp.readElements()//测试读数据
    • GraphApp.updateElements() //测试更新数据
    • GraphApp.deleteElements() //测试删除一个顶点
    • RemoteApp.closeGraph();
    • GraphApp.closeGraph();
  •  
  • 远程服务器,通过bin下面的脚本 janus.sh启动
  • 更改remote模块中的配置文件remote-objects.yaml为
  • hosts: [10.158.69.75]
    port: 8182
    serializer: {
        className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0,
        config: {
            bufferSize: 8192, useMapperFromGraph: graph,
            ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry],
            serializeResultToString: false,
            custom: [org.janusgraph.graphdb.relations.RelationIdentifier]
        }
  • 更改commons模块中的的  createSchemaRequest() 里的序列化(字符串)逻辑
    • 该字符串将创建schema、创建具体元素的代码序列化到一句请求字符串中
  • 所以需要写序列化请求内容的代码,此处有些繁琐
  • 验证可用 

 

JanusGraph数据库操作

JanusGraph的schema及数据建模

JanusGraph实战笔记·数据写入·查询. https://blog.csdn.net/wzwdcld/article/details/81275923

Java in-memory嵌入式创建schema,解析ttl文件,写入Janus并批量查询的代码:

 

  • 可视化插件
    • Graphexp 
      • Gremlin官网上的介绍:Graphexp - Interactive visualization of the Gremlin graph database with D3.js.
    • Cytoscape
    • Apache TinkerPop的Gephi插件
    • KeyLines by Cambridge Intelligence
    • Linkurious
    •  

JanusGraph·上手JanusGraph

图解JanusGraph内部数据存储结构. https://cloud.tencent.com/developer/news/206999

 

我的博客即将同步至腾讯云+社区,邀请大家一同入驻:https://cloud.tencent.com/developer/support-plan?invite_code=3l3al4ql8ou8o

 

 

  • 4
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值