I am using bulbs
and rexster
and am trying to store nodes with unicode properties (see example below).
Apparently, creating nodes in the graph works properly as I can see the nodes in the web interface that comes with rexster (Rexster Dog House) but retrieving the same node does not work - all I get is None
.
Everything works as expected when I create and look for nodes with non-unicode-specific letters in their properties.
E.g. in the following example a node with name = u'University of Cambridge'
would be retrievable as expected.
Rexster version:
[INFO] Application - Rexster version [2.4.0]
Example code:
# -*- coding: utf-8 -*-
from bulbs.rexster import Graph
from bulbs.model import Node
from bulbs.property import String
from bulbs.config import DEBUG
import bulbs
class University(Node):
element_type = 'university'
name = String(nullable=False, indexed=True)
g = Graph()
g.add_proxy('university', University)
g.config.set_logger(DEBUG)
name = u'Université de Montréal'
g.university.create(name=name)
print g.university.index.lookup(name=name)
print bulbs.__version__
Gives the following output on the command line:
POST url: http://localhost:8182/graphs/emptygraph/tp/gremlin
POST body: {"params": {"keys": null, "index_name": "university", "data": {"element_type": "university", "name": "Universit\u00e9 de Montr\u00e9al"}}, "script": "def createIndexedVertex = {\n vertex = g.addVertex()\n index = g.idx(index_name)\n for (entry in data.entrySet()) {\n if (entry.value == null) continue;\n vertex.setProperty(entry.key,entry.value)\n if (keys == null || keys.contains(entry.key))\n\tindex.put(entry.key,String.valueOf(entry.value),vertex)\n }\n return vertex\n }\n def transaction = { final Closure closure ->\n try {\n results = closure();\n g.commit();\n return results; \n } catch (e) {\n g.rollback();\n throw e;\n }\n }\n return transaction(createIndexedVertex);"}
GET url: http://localhost:8182/graphs/emptygraph/indices/university?value=Universit%C3%A9+de+Montr%C3%A9al&key=name
GET body: None
None
0.3