Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Values for Titan Cardinality.SET / Cardinality.LIST Properties Fails #146

Open
jjo-sec opened this issue Aug 20, 2014 · 0 comments
Open

Comments

@jjo-sec
Copy link

jjo-sec commented Aug 20, 2014

I did not test this functionality in the 0.4.X series, so I do not know if titan behavior has changed and broken bulbs support, but in 0.5.0 to add a property to a SET/LIST property addProperty must be used instead of SetProperty

example titan property creation in 0.5.0:
g = TitanFactory.open('conf/titan-cassandra-es.properties')
mgmt = g.getManagementSystem()
rrname = mgmt.makePropertyKey('rrname').dataType(String.class).cardinality(Cardinality.SINGLE).make()
cat = mgmt.makePropertyKey('category').dataType(String.class).cardinality(Cardinality.SET).make()

Associated error seen in in bulbs when attempting to add a vertex with a category property ( tried value as both list and string ) and see the same error message back saying to use addProperty:

g.vertices.create(rrname='evil.net',_data={'category':['evil']})
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/bulbs-0.3.29_20140417-py2.7.egg/bulbs/element.py", line 565, in create
resp = self.client.create_vertex(data, keys=_keys)
File "/usr/local/lib/python2.7/dist-packages/bulbs-0.3.29_20140417-py2.7.egg/bulbs/rexster/client.py", line 375, in create_vertex
return self.request.post(vertex_path, data)
File "/usr/local/lib/python2.7/dist-packages/bulbs-0.3.29_20140417-py2.7.egg/bulbs/rest.py", line 131, in post
return self.request(POST, path, params)
File "/usr/local/lib/python2.7/dist-packages/bulbs-0.3.29_20140417-py2.7.egg/bulbs/rest.py", line 186, in request
return self.response_class(http_resp, self.config)
File "/usr/local/lib/python2.7/dist-packages/bulbs-0.3.29_20140417-py2.7.egg/bulbs/rexster/client.py", line 198, in init
self.handle_response(response)
File "/usr/local/lib/python2.7/dist-packages/bulbs-0.3.29_20140417-py2.7.egg/bulbs/rexster/client.py", line 222, in handle_response
response_handler(http_resp)
File "/usr/local/lib/python2.7/dist-packages/bulbs-0.3.29_20140417-py2.7.egg/bulbs/rest.py", line 50, in server_error
raise SystemError(http_resp)
SystemError: ({'status': '500', 'transfer-encoding': 'chunked', 'vary': 'Accept', 'server': 'grizzly/2.2.16', 'connection': 'close', 'date': 'Wed, 20 Aug 2014 14:51:14 GMT', 'access-control-allow-origin': '*', 'content-type': 'application/json;charset=UTF-8'}, '{"message":"Not an single key: category. Use addProperty instead","error":"Not an single key: category. Use addProperty instead"}')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant