# pandora-graph **Repository Path**: ali88888/pandora-graph ## Basic Information - **Project Name**: pandora-graph - **Description**: 知识图谱-java后端,功能:建图schema、导入/查询图数据、多阶推演 JanusGraph+Cassandra+ES+docker,使用docker-compose编排 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 6 - **Forks**: 1 - **Created**: 2020-09-04 - **Last Updated**: 2024-03-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # pandora-graph 由于JanusGraph支持不同的存储后端和索引后端,所以安装方式也有几种: 1、 JanusGraph+Berkeley+ES:主要用于小型环境 2、JanusGraph+Cassandra+ES:适用于无Hadoop环境 3、JanusGraph+HBase+ES:适用于与Hadoop集成的环境 docker更换镜像源 首先在Mac的docker的配置中找到 Daemon 选项卡,点击 Registry mirrors 栏左下角的 + 添加一条https://docker.mirrors.ustc.edu.cn 1.编写docker-compose文件 2.构建 ``` docker-compose -f docker-compose-graph.yml up -d ``` 在指定固定ip时,如果提示如下错误 ``` User specified IP address is supported only when connecting to networks with user configured subnets ``` 则需要创建subnet网络 ``` docker network create --driver bridge --subnet 192.168.12.0/24 graph ``` 查看创建好的网络 ```html docker network inspect graph ``` 参考说明 ```html https://www.it610.com/article/1279550509954383872.htm ``` 3.运行项目代码 TODO 待完善 4.相关文档 ```html https://blog.csdn.net/zg_hover/article/details/89381150 ``` 查看索引概述 ``` http://127.0.0.1:9200/_cat/indices?v ``` 注意事项:先新增实体,再新增边,因为实体加到图数据库里需要时间,新增边时需要查询源点和目标点,如果其中一点不存在则加边失败 图管理方法的官方文档 ``` https://docs.janusgraph.org/basics/configured-graph-factory/ ``` ------------------------------------ 问题记录 问题1:删除图时报错 ``` java.lang.NullPointerException: Gremlin Server must be configured to use the JanusGraphManager. ``` 问题2:更换为动态创建图时报错 客户端报错: ``` org.janusgraph.graphdb.management.utils.ConfigurationManagementGraphNotEnabledException: Please add a key named "ConfigurationManagementGraph" to the "graphs" property in your YAML file and restart the server to be able to use the functionality of the ConfigurationManagementGraph class. ``` 解决方式:暂时未解决 服务端报错: ``` Graph [ConfigurationManagementGraph] configured at [/etc/opt/janusgraph/janusgraph.properties] could not be instantiated and will not be available in Gremlin Server. ``` 解决方式:从janusgraph服务端的gramlin-cassdra-configration.yaml配置文件里拷贝写法--> ``` GraphFactory can only instantiate Graph implementations from classes that have a static open() method that takes a single Apache Commons Configuration argument - [class org.janusgraph.core.ConfiguredGraphFactory] does not seem to have one ``` 问题3:janusgraph服务端报错 ``` Could not invoke constructor on class org.janusgraph.graphdb.management.JanusGraphManager (defined by the 'graphManager' setting) with one argument of class Settings ``` 问题4:gremlin-server.yaml中graphs节点里把图名改了之后,建图schema成功,但获取g出错 ``` The traversal source [g] for alias [g] is not configured on the server. ```