问题标签 [bulbs]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python-2.7 - 如何将图形添加到 rexster 服务器(titan/cassamdra 后端)以及如何使用 python 客户端将边和 verices 添加到图形?
我有一个 rexster 服务器 2.3.0 和 titan-cassandra 0.3.0 。并且一个图在 rexster.xml 文件中配置了 empgraph 的名称。如何使用 Titan 客户端将边和顶点添加到该 empgraph?所有都安装在本地主机上。
python-2.7 - 我的错误是什么?
这是我的 rexster.xml 文件,配置如下
我写了一个带有灯泡的python客户端,如下所示
我得到以下错误。要正确回答我有什么?
'usr/bin/python2.7 "/home/rpo/Desktop/ramnathreddy/addverices to rexsterdefault graph.py" Traceback (最近一次调用最后): File "/home/rpo/Desktop/ramnath/addverices to rexsterdefault graph.py ”,第 10 行,在 g = Graph(config) 文件中“/usr/local/lib/python2.7/dist-packages/bulbs/rexster/graph.py”,第 56 行,在init super(Graph, self) 中。init(配置)文件“/usr/local/lib/python2.7/dist-packages/bulbs/base/graph.py”,第 58 行,在init self.vertices = self.build_proxy(Vertex) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/base/graph.py”,第 124 行,在 build_proxy 返回 self.factory.build_element_proxy(element_class, index_class) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/factory.py”,第 19 行,在 build_element_proxy primary_index = self.get_index(element_class,index_class,index_name) 文件“/usr/local/ lib/python2.7/dist-packages/bulbs/factory.py”,第 27 行,在 get_index index = index_proxy.get_or_create(index_name) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/rexster /index.py”,第 80 行,在 get_or_create resp = self.client.get_or_create_vertex_index(index_name, index_params) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/rexster/client.py”,行668,在 get_or_create_vertex_index resp = self.gremlin(script, params) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/rexster/client.py”,第 356 行,在 gremlin 中返回 self.request.post( gremlin_path, params) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/rest.py”,第 131 行,后返回 self.request(POST, path, params) 文件“/usr/local /lib/python2.7/dist-packages/bulbs/rest.py”,第 186 行,在请求中返回 self.response_class(http_resp, self.config) 文件“/usr/local/lib/python2.7/dist-packages /bulbs/rexster/client.py”,第 198 行,在参数)文件“/usr/local/lib/python2.7/dist-packages/bulbs/rest.py”,第 131 行,在后返回 self.request(POST,路径,参数)文件“/usr/local/lib /python2.7/dist-packages/bulbs/rest.py”,第 186 行,在请求中返回 self.response_class(http_resp, self.config) 文件“/usr/local/lib/python2.7/dist-packages/bulbs /rexster/client.py”,第 198 行,在参数)文件“/usr/local/lib/python2.7/dist-packages/bulbs/rest.py”,第 131 行,在后返回 self.request(POST,路径,参数)文件“/usr/local/lib /python2.7/dist-packages/bulbs/rest.py”,第 186 行,在请求中返回 self.response_class(http_resp, self.config) 文件“/usr/local/lib/python2.7/dist-packages/bulbs /rexster/client.py”,第 198 行,在在里面 self.handle_response(response) 文件“/usr/local/lib/python2.7/dist-packages/bulbs/rexster/client.py”,第 222 行,在 handle_response response_handler(http_resp) 文件“/usr/local/lib/ python2.7/dist-packages/bulbs/rest.py",第 50 行,在 server_error 中引发 SystemError(http_resp) SystemError: ({'status': '500', 'transfer-encoding': 'chunked', 'server' : 'grizzly/2.2.16', 'connection': 'close', 'date': 'Mon, 16 Mar 2015 11:32:19 GMT', 'access-control-allow-origin': '*', ' content-type': 'application/json'}, '{"message":"","error":"javax.script.ScriptException: groovy.lang.MissingMethodException: 没有方法签名:groovy.lang。MissingMethodException.rollback() 适用于参数类型:() 值:[]\n可能的解决方案:collect(), collect(groovy.lang.Closure), collect(java.util.Collection, groovy.lang.Closure)", "api":{"description":"为图评估一个 ad-hoc Gremlin 脚本。","parameters":{"rexster.returnKeys":"要返回的元素属性键数组(默认是返回所有元素properties)","rexster.showTypes":"显示元素的属性及其本机数据类型(默认为 false)","load":"要在 \' 之前执行的 \'存储过程\' 的列表script\'(如果未指定 \'script\',则此参数中的最后一个脚本将返回值","rexster.offset.end":"要返回的分页数据集的结束索引","rexster.offset.start":"要返回的分页数据集的开始索引","params":"要绑定到脚本引擎的参数映射","language":"要使用的 gremlin 语言风格(默认为 groovy)","script":"要评估的 Gremlin 脚本"}},"success":false}')
python-3.x - Python,灯泡,resxter。从灯泡中获取 gremlin 脚本返回的布尔标量
我正在编写 python 脚本来从多个来源中提取数据并将其以某种结构放入图表中。
我正在为所有数据使用灯泡模型。我有所有相关节点类型和关系的模型。我的边缘模型除了“标签”之外没有其他属性。
由于它在开发中,我多次运行相同的脚本。我get_or_create
用来防止重复节点,但边缘没有这种方法。我没有现有边缘的对象,因为它是在脚本的先前运行中创建的。
我看到几个问题与 espeed这样的答案谈论类似的事情,但我无法为我的具体问题找到令人满意的答案。
这种方法最简单的代码是什么?
目前我正在尝试通过加载 gremlin 脚本来做到这一点;正如斯蒂芬所建议的那样;具有以下功能:
以及下面的python代码。
我不太清楚如何将 bool 结果输入 python。我也试过 g.gremlin.query(script, param)
python - 使用灯泡连接到 Rexster 时出现 SystemError
我已经建立了 Titan + Cassandra + Elasticsearch + Rexster 服务器。一切安装正确,我可以在 Gremlin 控制台中使用“众神图”。titan.sh
我从脚本开始一切。
titan/bin/titan.sh status
输出:
如果我去,http://localhost:8182/doghouse
我可以看到一个名为“graph”的空图。
现在我正在尝试使用灯泡包(http://bulbflow.com/)从 Python(3.4)连接到 Rexster。我正在尝试的代码非常简单:
我得到以下异常:
我应该添加名为“graph”的图是我在 Rexster 中找到的默认图,但我没有添加。
所以,我有一些问题:
- 你如何用灯泡连接到 Rexster(我肯定做错了什么)?
- 如何创建新图表?
python - Bulbs/Neo4j: authentication error when creating Graph object
I'm a newbie and trying to learn Python, Bulbs, Neo4j. I have no idea how to debug this problem that occurs at the very start when I just try to create a Graph object. Here's the traceback:
I'm running on Windows 7, if that matters. Can anyone help?
Thanks!
python - 为什么 Rexster Server(和 Titan)停止响应?
设置
我正在使用带有 Elasticsearch 后端的 Titan Rexster (titan-server-0.4.4.zip) 实现在 Ubuntu 12.4 服务器上运行的推荐系统。为了连接到 Rexster 服务器,我使用 Python 的 Bulbflow 库。
Beta 似乎运行良好 3 周,但随着负载“增加”(只有几个用户 ~10),Rexster 服务器停止响应。我不知道我的 rexster 配置是否错误,或者我没有正确使用 Bulbflow 库。
Rexster / Titan 配置
这是我的 rexster-cassandra-es.xml:
我已经更改了工作线程和内核的线程池的核心大小和最大大小,如果不进行更改,Rexster 服务器将挂起/不响应更快。
核心尺寸和最大尺寸的合适值是多少?
球流使用
为了使用bulbflow,我每次需要执行请求时都会创建一个新的Graph 对象。有很多请求,所以这些对象被频繁地创建。
我真的应该为每个新请求创建一个新的 Graph 对象吗?
是否可以只创建一个 Graph 对象并在向图形数据库发送新请求时使用它,或者我是否遇到会话问题?
错误信息
当一切都卡住并且我强制终止程序(ctrl-c)时,我得到以下堆栈跟踪:
恢复
为了恢复,我必须关闭 rexster / titan 并重新启动它。每当我停止 Rexster 服务器(./bin/titan -c cassandra-es stop)时,我都会收到以下输出:
Rexster 完全卡住了。
期待收到一些有用的指导。
python - 在 py2neo 和灯泡之间进行选择
我想继续从这里开始的讨论以评估这些驱动程序:灯泡或 py2neo。
是否有任何比较可以帮助人们在两者之间进行选择?通过这些类型的比较,该页面将得到极大的改进。
python - 用灯泡将数据加载到 Titan 中,然后访问它
我是图形数据库和所有 Titan 生态系统的完全新手,所以请原谅我听起来很愚蠢。我也因缺乏文档而苦恼-_-
我已经安装了泰坦服务器。我使用 Cassandra 作为后端。
我正在尝试使用 Python 将基本的 twitter 数据加载到 Titan 中。为此,我使用灯泡库。可以说,我在朋友列表中有我在 Twitter 上关注的人的列表
我的python脚本是这样的
据我了解 - 上面的代码应该在 Titan 中创建了一个带有多个顶点的图形,其中一些顶点由跟随边连接。
我的问题是:
我如何在泰坦中保存它?(就像 SQL 中的提交)
以后怎么访问??我应该能够通过 gremlin shell 访问它吗?如果是,怎么做??
我的下一个问题是关于可视化数据,但我离那里很远:)
请帮助 :) 我完全迷失在这一切 Titan、Gremlin、Rexster 等中。:)
更新:我们的 POC 项目的要求之一是...... python :),这就是我直接跳入灯泡的原因。不过,我肯定会遵循以下建议:)
python - 灯泡 - 索引查找
我在按属性查找顶点时遇到问题。
在他引用的文档中:
这将返回所有具有“name”属性的顶点,其值为“James”:g.vertices.index.lookup vertices = (name = "James")。
我创建了一个名为 Product 的模型:
并添加一些信息。
当我运行g.vertices.index.lookup(pid =318)
返回如下:
如果我在 Gremlin 中运行g.V('pid', 318).map()
它会返回:
为什么我不能通过 Bulbs 获得顶点?
谢谢!
groovy - 如何使用 mogwai 执行 gremlin 查询
我试图通过 mogwai 查询 Titan db 0.5.4,但是当我运行以下脚本时出现错误:rexpro.exceptions.RexProScriptException: transaction is not open
我在这里发现了同样的问题
PS mogwai 没有标签
脚本:
日志: