g.addV('Sample').property(confirmed', '0')
mgmt = graph.openManagement()
confirmed = mgmt.makePropertyKey('confirmed').dataType(Boolean.class).cardinality(Cardinality.SINGLE).make()
mgmt.commit()
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/6232df75-8618-4ead-86f2-7e5149915c4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
GLVs only support the traversal API. Schema management is database-specific. Thus, you will need to submit database schema changes as a script to be evaluated on the remote Gremlin Server. You can use the gremlin-python driver to submit scripts. Be sure to use the matching version (JanusGraph 0.2 -> TinkerPop 3.2.6).Robert Dale
On Sat, Oct 21, 2017 at 4:34 AM, Tomasz <troj...@gmail.com> wrote:
I want to create vertex with 'confirmed' property which should be a boolen data type. Currently, when I add vertex I do it as follows:
g.addV('Sample').property(confirmed', '0')
The '0' value is string type. I want to insert the value which will be the boolen type.
I found information about configuring data types in Janus: http://docs.janusgraph.org/latest/schema.html. According to it, I can do it as follows:
mgmt = graph.openManagement()
confirmed = mgmt.makePropertyKey('confirmed').dataType(Boolean.class).cardinality(Cardinality.SINGLE).make()
mgmt.commit()
I use gremlin-python, that's why I ask here not in JanusGraph groups. I try to execute above code on my graph object which is Graph class type (graph = Graph(), Graph is - from gremlin_python.structure.graph import Graph) but I get an error that there is no openManagement() method on graph object.
I confused how to pass that configutation via gremlin-python to Janus Graph. Maybe I should do in not via Gremlin but in some configuration file od JanusGraph.
How can I add a property of certain type using gremlin-python to JanusGraph database?
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/6232df75-8618-4ead-86f2-7e5149915c4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/CABed_4pJdhXYt7xe2fzvc14hcUVLQTMiNTMV3BTP%2BLn53%3D9C%2Bg%40mail.gmail.com.
458911 [gremlin-server-exec-2] WARN org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor - Exception processing a script on request [RequestMessage{, requestId=a2de96bf-ccf5-4bf0-9332-a8e5fd3d4cbb, op='eval', processor='', args={gremlin=mgmt = graph.openManagement()
number = mgmt.makePropertyKey('number').dataType(Integer.class).cardinality(Cardinality.SINGLE).make()
mgmt.commit(), aliases={g=g}}}].
org.janusgraph.core.SchemaViolationException: Adding this property for key [~T$SchemaName] and value [rt number] violates a uniqueness constraint [SystemIndex#~T$SchemaName]
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addProperty(StandardJanusGraphTx.java:793)
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addProperty(StandardJanusGraphTx.java:722)
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.makeSchemaVertex(StandardJanusGraphTx.java:849)
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.makePropertyKey(StandardJanusGraphTx.java:869)
at org.janusgraph.graphdb.types.StandardPropertyKeyMaker.make(StandardPropertyKeyMaker.java:100)
at org.janusgraph.core.schema.PropertyKeyMaker$make$7.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at Script8.run(Script8.groovy:2)
at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:843)
at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:548)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
at org.apache.tinkerpop.gremlin.groovy.engine.ScriptEngines.eval(ScriptEngines.java:120)
at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(GremlinExecutor.java:290)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
violates a uniqueness constraint". Could you explain me it?
mgmt = graph.openManagement()
number = mgmt.makePropertyKey('number').dataType(Integer.class).cardinality(Cardinality.SINGLE).make()
...
...
mgmt.commit()
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/095f5010-4f7d-4760-bcd8-262367c8f4d5%40googlegroups.com.