如何通过带灯泡的rexster连接到orientdb图?

 手机用户2602925995 发布于 2023-01-26 04:24

所以,我在mac-osx上使用python3.2和灯泡,使用rexster和orientdb.细节:

orientdb - 从他们的页面下载标准

〜/工作区/ orientdb社区-1.7-RC1

运行服务器, ./bin/server.sh

database - orientdb database~/databases/orientdb/dev-db-01

rexster - 来自github git clone的标准结账git://github.com/tinkerpop/rexster.wiki.git~/ workspace /

配置/ rexster.xml:

        ...
        
        true
        dev-db-01
        orientgraph
        local:**/databases/orientdb/dev-db-01
        
            admin
            admin
        
        
            
                tp:gremlin
            
        
    
    ...

Python代码:

from bulbs.rexster import Graph
from bulbs.config import Config
config = Config("http://localhost:8182/dev-db-01/", username="admin", password="admin")
g = Graph(config)

问题:

Traceback (most recent call last):   File "", line 1, in    File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/rexster/graph.py", li ne 56, in __init__                                                 

    super(Graph, self).__init__(config)   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/base/graph.py", line  58, in __init__                                                 

    self.vertices = self.build_proxy(Vertex)   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/base/graph.py", line  124, in build_proxy                                             

    return self.factory.build_element_proxy(element_class, index_class)   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/factory.py", line 19,  in build_element_proxy                                      

    primary_index = self.get_index(element_class,index_class,index_name)   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/factory.py", line 27,  in get_index                                                

    index = index_proxy.get_or_create(index_name)   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/rexster/index.py", li ne 80, in get_or_create                                            

    resp = self.client.get_or_create_vertex_index(index_name, index_params)   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/rexster/client.py", l ine 668, in get_or_create_vertex_index                              

    resp = self.gremlin(script, params)   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/rexster/client.py", l ine 356, in gremlin                                                 

    return self.request.post(gremlin_path, params)   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/rest.py", line 131, i n post                                                    

    return self.request(POST, path, params)   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/rest.py", line 186, i n request                                                 

    return self.response_class(http_resp, self.config)   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/rexster/client.py", l ine 198, in __init__                                                

    self.handle_response(response)   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/rexster/client.py", l ine 222, in handle_response                                         

    response_handler(http_resp)   File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/rest.py", line 39, in  not_found                                                

    raise LookupError(http_resp) LookupError: ({'date': 'Thu, 20 Feb 2014 07:08:20 GMT', 'status': '404', 'access-control-allow-origin': '*', 'content-lengt h': '0', 'server': 'grizzly/2.2.16'}, b'')

认为 python代码配置中的url是不正确的(我已经尝试了各种变体).但我不知道; 如果我保持rexster.xml不变并只使用标准图形构造函数,它就可以工作; 但那是一个问题,因为它没有向我想要的orientdb数据库添加节点,dev-db-01,它将它们放在默认数据库中.因此,为了确保我连接到正确的数据库,除了我创建的orientdb数据库之外,我禁用了所有数据库.

如何正确连接?

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有