davebshow / goblin

A Python 3.5 rewrite of the TinkerPop 3 OGM Goblin
Other
93 stars 21 forks source link

Problem with Edge data type #87

Closed StanYaha closed 6 years ago

StanYaha commented 7 years ago
class Relation(Edge):
    relationship = goblin.Property(goblin.String, default='unkonwn')

I use this to create edge. When i create mixed index in gremlin-shell

graph = JanusGraphFactory.open('conf/janusgraph-hbase-es.properties')
graph.tx().rollback()
mgmt = graph.openManagement()
relationship = mgmt.getPropertyKey('relationship')
mgmt.buildIndex("RL", Edge.class).addKey(relationship).buildMixedIndex(search);

It reminds '''gremlin> mgmt.buildIndex("RL", Edge.class).addKey(relationship).buildMixedIndex("search") Could not register new index field 'relationship' with index backend as the data type, cardinality or parameter combination is not supported. Type ':help' or ':h' for help. Display stack trace? [yN]n ''' How can i correct my relationship property key data type?Please help me!

StanYaha commented 7 years ago

image

here is my schema It's the data type problem.I use the goblin.String, why type is object

davebshow commented 7 years ago

I'm not exactly sure what is going on here. I can tell you that Goblin doesn't do anything but make sure the property gets validated and serialized properly when it is sent over the wire, and has nothing to do with the internal data types of the Janus schema. What code did you use to create the property keys?

StanYaha commented 7 years ago

image

image Here is the part of the code make property keys.Is there any problem?The data type must be string, i dont know why its object

davebshow commented 7 years ago

Not trying to be rude here, but you have to look in the Janus docs. This stuff doesn't have anything to do with Goblin. Those are all DataType object because you haven't created a schema, which all Janus DBs should have. Here is a link to the docs: http://docs.janusgraph.org/latest/schema.html

I recommend that you thoroughly read all of Janus' documentation before proceeding.

StanYaha commented 7 years ago

Thank you so much! I successfully created mixed index with making property key before i insert data into hbase. Now i want to know how to use mixed index with goblin. I read the document in gremlin-shell it uses like

g.V().has('propertykey', 'value').bothE().has('relationship', textCointains('key')).toList()

How can i use the mixed index with goblin?