JanusGraph / janusgraph

JanusGraph: an open-source, distributed graph database
https://janusgraph.org
Other
5.27k stars 1.16k forks source link

janus graph param set no use #2051

Closed yuqin11 closed 4 years ago

yuqin11 commented 4 years ago

Please include configurations and logs if available. three possible bugs, configurations and logs are below.

  1. Even if i configured graph.set-vertex-id=true, i get this error:
  2. can not reopen a ConfiguredGraphFactory.

when i configured ConfiguredGraphFactory in gremlin-server when the server is stopped for some reason. when i restart the gremlin server. the server get an error with: there hava an janusgraph xxxxxx-id has already been opened.

because i have configured many graph in that ManagementConfigureGraph. I retrieve the graph by g1=ConfiguredGraphFactory.open("kgnlp_sddl");g1.trasversal().V().has(/xxx/,/xxx/)

  1. even if i configured schema=default, when i use g.addV(/person/).property(/name/,/xxx/) I get a label not created error.

For confirmed bugs, please report:

gremlin> map = new HashMap();\
......1> map.put("graph.graphname", "idtest");\
......2> map.put("storage.backend", "cql");\
......3> map.put("query.batch", "true");\
......4> map.put("query.force-index", "false");\
......5> map.put("storage.cql.compression", "true");\
......6> map.put("storage.cql.compression-block-size", "4");\
......7> map.put("storage.cql.keyspace", "graphtest");\
......8> map.put("storage.cql.read-consistency-level", "LOCAL_ONE");\
......9> map.put("storage.cql.write-consistency-level", "LOCAL_QUORUM");\
.....10> map.put("storage.cql.local-core-connections-per-host", "2");\
.....11> map.put("storage.cql.local-max-connections-per-host", "2");\
.....12> map.put("storage.cql.replication-factor", "1");\
.....13> map.put("storage.hostname", "xxxx");\
.....14> map.put("ids.block-size", "10000000");\
.....15> map.put("storage.batch-loading", "true");\
.....16> map.put("storage.buffer-size", "1024");\
.....17> map.put("index.ES.backend", "elasticsearch");\
.....18> map.put("index.ES.hostname", "xxx");\
.....19> map.put("index.ES.index-name", "idtest");\
.....20> map.put("index.ES.elasticsearch.client-only", "true");\
.....21> map.put("index.ES.elasticsearch.create.ext.index.number_of_shards", "4");\
.....22> map.put("index.ES.elasticsearch.create.ext.index.number_of_replicas", "1");\
.....23> map.put("index.ES.elasticsearch.create.ext.index.refresh_interval", "600s");\
.....24> map.put("log.tx.key-consistent", "true");\
.....25> map.put("cache.db-cache-size", "0");\
.....26> map.put("cache.db-cache-time", "0");\
.....27> map.put("cache.db-cache", "false");\
.....28> map.put("metrics.enabled", "false");\
.....29> map.put("graph.replace-instance-if-exists", "true");\
.....30> map.put("graph.set-vertex-id", "true");\
.....31> map.put("schema.default", "default");\
.....32> ConfiguredGraphFactory.createConfiguration(new MapConfiguration(map));
==>null
gremlin> 
gremlin> 
gremlin> 
gremlin> 
gremlin> g1 = ConfiguredGraphFactory.open("idtest");g1.traversal().addV(/person/).property(T.id,1L)
Vertex does not support user supplied identifiers
Type ':help' or ':h' for help.
Display stack trace? [yN]y
org.apache.tinkerpop.gremlin.jsr223.console.RemoteException: Vertex does not support user supplied identifiers
        at org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:178)
        at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:99)
        at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
        at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95)
        at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
        at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
        at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:130)
        at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
        at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
        at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:89)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
        at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:146)
        at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
        at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:453)

Stack Trace (if you have one)

paste stack trace here
yuqin11 commented 4 years ago

would you please be patient? take a look carefully?

saralov commented 4 years ago

Vertex does not support user supplied identifiers, 是因为不能设置jg的id,你可以自定义一个属性 _id 去保存吧,然后创建一个compose索引 label not created error,是因为你default schema是指自带的god模型是吧,没有person这个label的实体类型啊

------------------ 原始邮件 ------------------ 发件人: "yuqin11"<notifications@github.com>; 发送时间: 2020年3月20日(星期五) 下午4:22 收件人: "JanusGraph/janusgraph"<janusgraph@noreply.github.com>; 抄送: "Subscribed"<subscribed@noreply.github.com>; 主题: [JanusGraph/janusgraph] janus graph param set no use (#2051)

Please include configurations and logs if available. three possible bugs, configurations and logs are below.

Even if i configured graph.set-vertex-id=true, i get this error:

can not reopen a ConfiguredGraphFactory.

when i configured ConfiguredGraphFactory in gremlin-server when the server is stopped for some reason. when i restart the gremlin server. the server get an error with: there hava an janusgraph xxxxxx-id has already been opened.

because i have configured many graph in that ManagementConfigureGraph. I retrieve the graph by g1=ConfiguredGraphFactory.open("kgnlp_sddl");g1.trasversal().V().has(/xxx/,/xxx/)

even if i configured schema=default, when i use g.addV(/person/).property(/name/,/xxx/) I get a label not created error.

For confirmed bugs, please report:

Version: 0.3.1

Storage Backend: cql

Mixed Index Backend:es

Mailing list Thread URL:

Steps to Reproduce: gremlin> map = new HashMap();\ ......1> map.put("graph.graphname", "idtest");\ ......2> map.put("storage.backend", "cql");\ ......3> map.put("query.batch", "true");\ ......4> map.put("query.force-index", "false");\ ......5> map.put("storage.cql.compression", "true");\ ......6> map.put("storage.cql.compression-block-size", "4");\ ......7> map.put("storage.cql.keyspace", "graphtest");\ ......8> map.put("storage.cql.read-consistency-level", "LOCAL_ONE");\ ......9> map.put("storage.cql.write-consistency-level", "LOCAL_QUORUM");\ .....10> map.put("storage.cql.local-core-connections-per-host", "2");\ .....11> map.put("storage.cql.local-max-connections-per-host", "2");\ .....12> map.put("storage.cql.replication-factor", "1");\ .....13> map.put("storage.hostname", "xxxx");\ .....14> map.put("ids.block-size", "10000000");\ .....15> map.put("storage.batch-loading", "true");\ .....16> map.put("storage.buffer-size", "1024");\ .....17> map.put("index.ES.backend", "elasticsearch");\ .....18> map.put("index.ES.hostname", "xxx");\ .....19> map.put("index.ES.index-name", "idtest");\ .....20> map.put("index.ES.elasticsearch.client-only", "true");\ .....21> map.put("index.ES.elasticsearch.create.ext.index.number_of_shards", "4");\ .....22> map.put("index.ES.elasticsearch.create.ext.index.number_of_replicas", "1");\ .....23> map.put("index.ES.elasticsearch.create.ext.index.refresh_interval", "600s");\ .....24> map.put("log.tx.key-consistent", "true");\ .....25> map.put("cache.db-cache-size", "0");\ .....26> map.put("cache.db-cache-time", "0");\ .....27> map.put("cache.db-cache", "false");\ .....28> map.put("metrics.enabled", "false");\ .....29> map.put("graph.replace-instance-if-exists", "true");\ .....30> map.put("graph.set-vertex-id", "true");\ .....31> map.put("schema.default", "default");\ .....32> ConfiguredGraphFactory.createConfiguration(new MapConfiguration(map)); ==>null gremlin> gremlin> gremlin> gremlin> gremlin> g1 = ConfiguredGraphFactory.open("idtest");g1.traversal().addV(/person/).property(T.id,1L) Vertex does not support user supplied identifiers Type ':help' or ':h' for help. Display stack trace? [yN]y org.apache.tinkerpop.gremlin.jsr223.console.RemoteException: Vertex does not support user supplied identifiers at org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:178) at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:99) at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122) at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95) at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy) at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165) at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:130) at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59) at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165) at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:89) at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236) at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:146) at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236) at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:453)
Stack Trace (if you have one) paste stack trace here
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

yuqin11 commented 4 years ago

Vertex does not support user supplied identifiers, 是因为不能设置jg的id,你可以自定义一个属性 _id 去保存吧,然后创建一个compose索引 label not created error,是因为你default schema是指自带的god模型是吧,没有person这个label的实体类型啊 ------------------ 原始邮件 ------------------ 发件人: "yuqin11"<notifications@github.com>; 发送时间: 2020年3月20日(星期五) 下午4:22 收件人: "JanusGraph/janusgraph"<janusgraph@noreply.github.com>; 抄送: "Subscribed"<subscribed@noreply.github.com>; 主题: [JanusGraph/janusgraph] janus graph param set no use (#2051) Please include configurations and logs if available. three possible bugs, configurations and logs are below. Even if i configured graph.set-vertex-id=true, i get this error: can not reopen a ConfiguredGraphFactory. when i configured ConfiguredGraphFactory in gremlin-server when the server is stopped for some reason. when i restart the gremlin server. the server get an error with: there hava an janusgraph xxxxxx-id has already been opened. because i have configured many graph in that ManagementConfigureGraph. I retrieve the graph by g1=ConfiguredGraphFactory.open("kgnlp_sddl");g1.trasversal().V().has(/xxx/,/xxx/) even if i configured schema=default, when i use g.addV(/person/).property(/name/,/xxx/) I get a label not created error. For confirmed bugs, please report: Version: 0.3.1 Storage Backend: cql Mixed Index Backend:es Mailing list Thread URL: Steps to Reproduce: gremlin> map = new HashMap();\ ......1> map.put("graph.graphname", "idtest");\ ......2> map.put("storage.backend", "cql");\ ......3> map.put("query.batch", "true");\ ......4> map.put("query.force-index", "false");\ ......5> map.put("storage.cql.compression", "true");\ ......6> map.put("storage.cql.compression-block-size", "4");\ ......7> map.put("storage.cql.keyspace", "graphtest");\ ......8> map.put("storage.cql.read-consistency-level", "LOCAL_ONE");\ ......9> map.put("storage.cql.write-consistency-level", "LOCAL_QUORUM");\ .....10> map.put("storage.cql.local-core-connections-per-host", "2");\ .....11> map.put("storage.cql.local-max-connections-per-host", "2");\ .....12> map.put("storage.cql.replication-factor", "1");\ .....13> map.put("storage.hostname", "xxxx");\ .....14> map.put("ids.block-size", "10000000");\ .....15> map.put("storage.batch-loading", "true");\ .....16> map.put("storage.buffer-size", "1024");\ .....17> map.put("index.ES.backend", "elasticsearch");\ .....18> map.put("index.ES.hostname", "xxx");\ .....19> map.put("index.ES.index-name", "idtest");\ .....20> map.put("index.ES.elasticsearch.client-only", "true");\ .....21> map.put("index.ES.elasticsearch.create.ext.index.number_of_shards", "4");\ .....22> map.put("index.ES.elasticsearch.create.ext.index.number_of_replicas", "1");\ .....23> map.put("index.ES.elasticsearch.create.ext.index.refresh_interval", "600s");\ .....24> map.put("log.tx.key-consistent", "true");\ .....25> map.put("cache.db-cache-size", "0");\ .....26> map.put("cache.db-cache-time", "0");\ .....27> map.put("cache.db-cache", "false");\ .....28> map.put("metrics.enabled", "false");\ .....29> map.put("graph.replace-instance-if-exists", "true");\ .....30> map.put("graph.set-vertex-id", "true");\ .....31> map.put("schema.default", "default");\ .....32> ConfiguredGraphFactory.createConfiguration(new MapConfiguration(map)); ==>null gremlin> gremlin> gremlin> gremlin> gremlin> g1 = ConfiguredGraphFactory.open("idtest");g1.traversal().addV(/person/).property(T.id,1L) Vertex does not support user supplied identifiers Type ':help' or ':h' for help. Display stack trace? [yN]y org.apache.tinkerpop.gremlin.jsr223.console.RemoteException: Vertex does not support user supplied identifiers at org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:178) at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:99) at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122) at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95) at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy) at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165) at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:130) at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59) at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165) at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:89) at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236) at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:146) at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236) at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:453) Stack Trace (if you have one) paste stack trace here — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

please refer to graph.set-vertex-id and configure refference, vertex id can be set. default schema means: (not means the god graph) If an edge label, property key, or vertex label has not been defined explicitly, it will be defined implicitly when it is first used during the addition of an edge, vertex or the setting of a property. The DefaultSchemaMaker configured for the JanusGraph graph defines such types.

By default, implicitly created edge labels have multiplicity MULTI and implicitly created property keys have cardinality SINGLE and data type Object.class. Users can control automatic schema element creation by implementing and registering their own DefaultSchemaMaker.

It is strongly encouraged to explicitly define all schema elements and to disable automatic schema creation by setting schema.default=none in the JanusGraph graph configuration.

yuqin11 commented 4 years ago

by the way , i want to set vertex id is because i want to import billions of data, for example twitter dataset. set vertex id myself can reduce import time.

yuqin11 commented 4 years ago

i know how to save id in property !

yuqin11 commented 4 years ago

I do not need that.

li-boxuan commented 4 years ago

I am unable to reproduce. Try opening a new graph as suggested by https://groups.google.com/forum/#!topic/janusgraph-users/_UEKC8kRxI8

gremlin> graph = JanusGraphFactory.open('conf/janusgraph-inmemory.properties')
==>standardjanusgraph[inmemory:[127.0.0.1]]
gremlin> g = graph.traversal()
==>graphtraversalsource[standardjanusgraph[inmemory:[127.0.0.1]], standard]
gremlin> g.addV("person").property(T.id, 8).next()
==>v[8]

Please also make sure that you use a valid id. See https://github.com/JanusGraph/janusgraph/blob/c01bfea2ce602696163aa50fde9be1cdeea13fc1/janusgraph-core/src/main/java/org/janusgraph/graphdb/tinkerpop/JanusGraphBlueprintsTransaction.java#L87-L97

porunov commented 4 years ago

@yuqin11 1) Please, read Configuration Reference section (https://docs.janusgraph.org/basics/configuration-reference/) for more information about Mutability Levels of configuration parameters. You cannot change the behaviour of your graph once it was opened with FIXED parameters. If you opened your graph earlier without graph.set-vertex-id (i.e. by default it is false) and now trying to reopen the graph, you will not be able to change graph.set-vertex-id to true anymore. And vice versa, if you opened your graph with graph.set-vertex-id = true you will not be able to change your graph to use graph.set-vertex-id = false anymore. Make sure that your graph is created initially with right parameters. When you change FIXED parameters for your graph, you will be shown WARN about the usage of such parameter and inability to modify it. Notice from you stack trace: Vertex does not support user supplied identifiers. It means that in your situation you cannot use user supplied identifiers because the graph was created earlier with graph.set-vertex-id = false. So, you cannot change it to graph.set-vertex-id = true anymore and your custom ids are not allowed.

2) > by the way , i want to set vertex id is because i want to import billions of data, for example twitter dataset. set vertex id myself can reduce import time.

If you use default behaviour (i.e. graph.set-vertex-id = false) and you see performance decrease on ids allocation, you can increase ids.block-size (let say 10,000,000 in your situation). In such situation you will access id blocks much less and that is why you id allocation process will be much faster. I don't think you will improve performance much by using graph.set-vertex-id = true. I strongly suggest to check the presentation Session 5 - High Performance JanusGraph Data Loading by Ted Wilmes which can be retrieved here: https://www.experoinc.com/online-seminar/janusgraph-online-meetup Especially slides where he talks about ID Allocation (it will help in your situation).

3) As @li-boxuan answered, you should use valid ids in your situation. As seen from the javadocs, you can use long vertexId = ((StandardJanusGraph) graph).getIDManager().toVertexId(userVertexId) to convert your id into correct vertex id.


@yuqin11 I am closing your issue because it isn't a discovered bug or feature request. Notice, don't get me wrong, we are not ignoring you or trying to close issues as fast as possible. We want to help you but it is easier for contributors to focus on current bugs and feature requests by checking GitHub issues to pickup something and work with. That is why, we have separation for different topics:

I hope it helps, if you have any other questions / problems, let discuss them in JanusGraph users group https://groups.google.com/forum/#!forum/janusgraph-users

yuqin11 commented 4 years ago

I am unable to reproduce. Try opening a new graph as suggested by https://groups.google.com/forum/#!topic/janusgraph-users/_UEKC8kRxI8

gremlin> graph = JanusGraphFactory.open('conf/janusgraph-inmemory.properties')
==>standardjanusgraph[inmemory:[127.0.0.1]]
gremlin> g = graph.traversal()
==>graphtraversalsource[standardjanusgraph[inmemory:[127.0.0.1]], standard]
gremlin> g.addV("person").property(T.id, 8).next()
==>v[8]

Please also make sure that you use a valid id. See

https://github.com/JanusGraph/janusgraph/blob/c01bfea2ce602696163aa50fde9be1cdeea13fc1/janusgraph-core/src/main/java/org/janusgraph/graphdb/tinkerpop/JanusGraphBlueprintsTransaction.java#L87-L97

Have reproduce with the same method I use? I met the problem when i use configuredManagementGraph. would you please try it. I did not open the same graph . I opened a new graph. and I reprodiced this problem many times. have you tried? You just reproduce with your method.