gremlin-server neo4j : How to set id, multi label










0















I lunched gremlin-server 3.3.4 with neo4j 3.3.4 using http channelizer,
and it worked.
neo4j-empty.propertiesconfiguration was below



gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
gremlin.neo4j.directory=/tmp/neo4j
gremlin.neo4j.conf.dbms.auto_index.nodes.enabled=true
gremlin.neo4j.conf.dbms.auto_index.relationships.enabled=true


but
1. http://localhost:8182/?gremlin=g.addV("test").property(id,"abc")
return error




"message": "Vertex does not support user supplied identifiers",
"Exception-Class": "java.lang.UnsupportedOperationException",
"exceptions": [
"java.lang.UnsupportedOperationException"
],
"stackTrace": "java.lang.UnsupportedOperationException: Vertex does not support user supplied identifiersntat org.apache.tinkerpop.gremlin.structure.Vertex$Exceptions.userSuppliedIdsNotSupported(Vertex.java:163)ntat org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.addVertex(Neo4jGraph.java:162)ntat org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStartStep.processNextStart(AddVertexStartStep.java:91)ntat org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)ntat org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:192)ntat org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.fill(IteratorUtils.java:62)ntat org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.list(IteratorUtils.java:85)ntat org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.asList(IteratorUtils.java:382)ntat org.apache.tinkerpop.gremlin.server.handler.HttpGremlinEndpointHandler.lambda$channelRead$1(HttpGremlinEndpointHandler.java:247)ntat org.apache.tinkerpop.gremlin.util.function.FunctionUtils.lambda$wrapFunction$0(FunctionUtils.java:36)ntat org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(GremlinExecutor.java:269)ntat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)ntat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)ntat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)ntat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)ntat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)ntat java.base/java.lang.Thread.run(Thread.java:834)n"



and 2. I added vertex with multilabel http://localhost:8182/?gremlin=g.addV("test::test2") and query http://localhost:8182/?gremlin=g.V().hasLabel("test") return empty node




"requestId": "ec79c0f7-e4aa-485e-ace4-6e534e8252c5",
"status":
"message": "",
"code": 200,
"attributes":
"@type": "g:Map",
"@value":

,
"result":
"data":
"@type": "g:List",
"@value":
,
"meta":
"@type": "g:Map",
"@value":





How can I make them work? I found some things, but I couldn't find config option yet. please help
http://tinkerpop.apache.org/docs/current/reference/#_elementidstrategy
http://tinkerpop.apache.org/docs/current/reference/#_multi_label










share|improve this question


























    0















    I lunched gremlin-server 3.3.4 with neo4j 3.3.4 using http channelizer,
    and it worked.
    neo4j-empty.propertiesconfiguration was below



    gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
    gremlin.neo4j.directory=/tmp/neo4j
    gremlin.neo4j.conf.dbms.auto_index.nodes.enabled=true
    gremlin.neo4j.conf.dbms.auto_index.relationships.enabled=true


    but
    1. http://localhost:8182/?gremlin=g.addV("test").property(id,"abc")
    return error




    "message": "Vertex does not support user supplied identifiers",
    "Exception-Class": "java.lang.UnsupportedOperationException",
    "exceptions": [
    "java.lang.UnsupportedOperationException"
    ],
    "stackTrace": "java.lang.UnsupportedOperationException: Vertex does not support user supplied identifiersntat org.apache.tinkerpop.gremlin.structure.Vertex$Exceptions.userSuppliedIdsNotSupported(Vertex.java:163)ntat org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.addVertex(Neo4jGraph.java:162)ntat org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStartStep.processNextStart(AddVertexStartStep.java:91)ntat org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)ntat org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:192)ntat org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.fill(IteratorUtils.java:62)ntat org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.list(IteratorUtils.java:85)ntat org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.asList(IteratorUtils.java:382)ntat org.apache.tinkerpop.gremlin.server.handler.HttpGremlinEndpointHandler.lambda$channelRead$1(HttpGremlinEndpointHandler.java:247)ntat org.apache.tinkerpop.gremlin.util.function.FunctionUtils.lambda$wrapFunction$0(FunctionUtils.java:36)ntat org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(GremlinExecutor.java:269)ntat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)ntat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)ntat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)ntat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)ntat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)ntat java.base/java.lang.Thread.run(Thread.java:834)n"



    and 2. I added vertex with multilabel http://localhost:8182/?gremlin=g.addV("test::test2") and query http://localhost:8182/?gremlin=g.V().hasLabel("test") return empty node




    "requestId": "ec79c0f7-e4aa-485e-ace4-6e534e8252c5",
    "status":
    "message": "",
    "code": 200,
    "attributes":
    "@type": "g:Map",
    "@value":

    ,
    "result":
    "data":
    "@type": "g:List",
    "@value":
    ,
    "meta":
    "@type": "g:Map",
    "@value":





    How can I make them work? I found some things, but I couldn't find config option yet. please help
    http://tinkerpop.apache.org/docs/current/reference/#_elementidstrategy
    http://tinkerpop.apache.org/docs/current/reference/#_multi_label










    share|improve this question
























      0












      0








      0








      I lunched gremlin-server 3.3.4 with neo4j 3.3.4 using http channelizer,
      and it worked.
      neo4j-empty.propertiesconfiguration was below



      gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
      gremlin.neo4j.directory=/tmp/neo4j
      gremlin.neo4j.conf.dbms.auto_index.nodes.enabled=true
      gremlin.neo4j.conf.dbms.auto_index.relationships.enabled=true


      but
      1. http://localhost:8182/?gremlin=g.addV("test").property(id,"abc")
      return error




      "message": "Vertex does not support user supplied identifiers",
      "Exception-Class": "java.lang.UnsupportedOperationException",
      "exceptions": [
      "java.lang.UnsupportedOperationException"
      ],
      "stackTrace": "java.lang.UnsupportedOperationException: Vertex does not support user supplied identifiersntat org.apache.tinkerpop.gremlin.structure.Vertex$Exceptions.userSuppliedIdsNotSupported(Vertex.java:163)ntat org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.addVertex(Neo4jGraph.java:162)ntat org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStartStep.processNextStart(AddVertexStartStep.java:91)ntat org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)ntat org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:192)ntat org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.fill(IteratorUtils.java:62)ntat org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.list(IteratorUtils.java:85)ntat org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.asList(IteratorUtils.java:382)ntat org.apache.tinkerpop.gremlin.server.handler.HttpGremlinEndpointHandler.lambda$channelRead$1(HttpGremlinEndpointHandler.java:247)ntat org.apache.tinkerpop.gremlin.util.function.FunctionUtils.lambda$wrapFunction$0(FunctionUtils.java:36)ntat org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(GremlinExecutor.java:269)ntat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)ntat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)ntat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)ntat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)ntat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)ntat java.base/java.lang.Thread.run(Thread.java:834)n"



      and 2. I added vertex with multilabel http://localhost:8182/?gremlin=g.addV("test::test2") and query http://localhost:8182/?gremlin=g.V().hasLabel("test") return empty node




      "requestId": "ec79c0f7-e4aa-485e-ace4-6e534e8252c5",
      "status":
      "message": "",
      "code": 200,
      "attributes":
      "@type": "g:Map",
      "@value":

      ,
      "result":
      "data":
      "@type": "g:List",
      "@value":
      ,
      "meta":
      "@type": "g:Map",
      "@value":





      How can I make them work? I found some things, but I couldn't find config option yet. please help
      http://tinkerpop.apache.org/docs/current/reference/#_elementidstrategy
      http://tinkerpop.apache.org/docs/current/reference/#_multi_label










      share|improve this question














      I lunched gremlin-server 3.3.4 with neo4j 3.3.4 using http channelizer,
      and it worked.
      neo4j-empty.propertiesconfiguration was below



      gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
      gremlin.neo4j.directory=/tmp/neo4j
      gremlin.neo4j.conf.dbms.auto_index.nodes.enabled=true
      gremlin.neo4j.conf.dbms.auto_index.relationships.enabled=true


      but
      1. http://localhost:8182/?gremlin=g.addV("test").property(id,"abc")
      return error




      "message": "Vertex does not support user supplied identifiers",
      "Exception-Class": "java.lang.UnsupportedOperationException",
      "exceptions": [
      "java.lang.UnsupportedOperationException"
      ],
      "stackTrace": "java.lang.UnsupportedOperationException: Vertex does not support user supplied identifiersntat org.apache.tinkerpop.gremlin.structure.Vertex$Exceptions.userSuppliedIdsNotSupported(Vertex.java:163)ntat org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph.addVertex(Neo4jGraph.java:162)ntat org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStartStep.processNextStart(AddVertexStartStep.java:91)ntat org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)ntat org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:192)ntat org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.fill(IteratorUtils.java:62)ntat org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.list(IteratorUtils.java:85)ntat org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils.asList(IteratorUtils.java:382)ntat org.apache.tinkerpop.gremlin.server.handler.HttpGremlinEndpointHandler.lambda$channelRead$1(HttpGremlinEndpointHandler.java:247)ntat org.apache.tinkerpop.gremlin.util.function.FunctionUtils.lambda$wrapFunction$0(FunctionUtils.java:36)ntat org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(GremlinExecutor.java:269)ntat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)ntat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)ntat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)ntat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)ntat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)ntat java.base/java.lang.Thread.run(Thread.java:834)n"



      and 2. I added vertex with multilabel http://localhost:8182/?gremlin=g.addV("test::test2") and query http://localhost:8182/?gremlin=g.V().hasLabel("test") return empty node




      "requestId": "ec79c0f7-e4aa-485e-ace4-6e534e8252c5",
      "status":
      "message": "",
      "code": 200,
      "attributes":
      "@type": "g:Map",
      "@value":

      ,
      "result":
      "data":
      "@type": "g:List",
      "@value":
      ,
      "meta":
      "@type": "g:Map",
      "@value":





      How can I make them work? I found some things, but I couldn't find config option yet. please help
      http://tinkerpop.apache.org/docs/current/reference/#_elementidstrategy
      http://tinkerpop.apache.org/docs/current/reference/#_multi_label







      rest neo4j gremlin-server






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 15 '18 at 6:14









      이승훈이승훈

      15117




      15117






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Neo4j does not allow id assignment. If you want to assign your own identifier then it needs to be a property like:



          g.addV("test").property("id","abc")





          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53313458%2fgremlin-server-neo4j-how-to-set-id-multi-label%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Neo4j does not allow id assignment. If you want to assign your own identifier then it needs to be a property like:



            g.addV("test").property("id","abc")





            share|improve this answer



























              0














              Neo4j does not allow id assignment. If you want to assign your own identifier then it needs to be a property like:



              g.addV("test").property("id","abc")





              share|improve this answer

























                0












                0








                0







                Neo4j does not allow id assignment. If you want to assign your own identifier then it needs to be a property like:



                g.addV("test").property("id","abc")





                share|improve this answer













                Neo4j does not allow id assignment. If you want to assign your own identifier then it needs to be a property like:



                g.addV("test").property("id","abc")






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 15 '18 at 11:56









                stephen mallettestephen mallette

                26.3k33079




                26.3k33079





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53313458%2fgremlin-server-neo4j-how-to-set-id-multi-label%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    How to read a connectionString WITH PROVIDER in .NET Core?

                    Node.js Script on GitHub Pages or Amazon S3

                    Museum of Modern and Contemporary Art of Trento and Rovereto