Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8865701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:34:54+00:00 2026-06-14T16:34:54+00:00

Beginner Gremlin question. I’d like to retrieve a node from the graph using a

  • 0

Beginner Gremlin question. I’d like to retrieve a node from the graph using a property name, and then print all its attached properties.

This is what I’m trying:

println g.v(20020000001901003)

That’s giving me null. When I try this:

println g.idx('mygraph')[[id:20020000001901003]]

the output is [StartPipe].

How can I get from StartPipe to the node’s properties?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:34:55+00:00Added an answer on June 14, 2026 at 4:34 pm

    Here’s some examples from the Gremlin terminal using the toy graph and TinkerPop 2.x (3.x instructions are further below). The following console session shows how to create a key index and search on it.

    gremlin> g = TinkerGraphFactory.createTinkerGraph()
    ==>tinkergraph[vertices:6 edges:6]
    gremlin> g.createKeyIndex("name",Vertex.class)
    ==>null
    gremlin> g.V("name","marko").name
    ==>marko
    gremlin> g.V("name","marko").map
    ==>{age=29, name=marko}
    

    You should note that the reason g.v(20020000001901003) returns null for you is because that function tries to look up the vertex based on the unique identifier for the element in the graph, and not your assigned identifier (very few graphs support user assignment of the id…they generally generate their own). Consider the following where I’m using the assigned identifier to access the vertex:

    gremlin> g.V("name","marko")
    ==>v[1]
    gremlin> g.v(1).map
    ==>{age=29, name=marko}
    

    If you have created a manual index, then you would use the g.idx syntax that you are referencing. Here’s an example:

    gremlin> idx = g.createIndex("my-index",Vertex.class)
    ==>index[my-index:Vertex]
    gremlin> idx.put("id", 1000, g.v(1))
    ==>null
    gremlin> g.idx("my-index")[[id:1000]]
    ==>v[1]
    

    I assume that you are not using the Gremlin terminal and as such you would need to iterate that start pipe. You might do something like sending it to a List:

    gremlin> x=[];g.idx("my-index")[[id:1000]].fill(x)
    ==>v[1]
    gremlin> x.size()
    ==>1
    

    In TinkerPop 3.x there is no TinkerPop abstraction over indices. You must use the method for index creation prescribed by the underlying graph database. For example, in neo4j you would use some Cypher syntax. With TinkerGraph, there is just a createIndex() method. You can see it’s usage as follows:

    gremlin> graph = TinkerGraph.open()
    ==>tinkergraph[vertices:0 edges:0]
    gremlin> graph.createIndex('name',Vertex.class)
    gremlin> g = graph.traversal()
    ==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
    gremlin> g.addV('name','stephen')
    ==>v[0]
    gremlin> g.addV('name','steve')
    ==>v[2]
    gremlin> g.V().has('name','stephen')
    ==>v[0]
    

    Note that when doing a lookup with that last line above, there is no explicit syntax to use from Gremlin’s perspective to use the index on “name”. TinkerGraph automatically detects the use of has() and that the key is “name” and then it uses the index. If it didn’t find an index for “name” it would do a full scan of the vertices to find “stephen”. All TinkerPop implementations will have similar strategies for doing those kinds of index lookups.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Beginner rails question: How does one return a file from a controller in rails?
Python beginner here. I am using the matplotlib library to make graphs from tab
I'm a beginner in jQuery area and I have simple question like this :
Definitely a beginner question... basically, I want to have the same design from this
Beginner question... How different is define($a,365); from $a = 365; ? Thanks! JDelage
Beginner android question. Ok, I've successfully written files. E.g. // get the file name
A beginner's Cygwin question here - I'd like to install a newer version of
Beginner jquery question. I am using the Tokenizing Autocomplete Text Entry plugin, with the
Beginner question perhaps: I'm trying to check my user permissions from facebook with Koala.
Beginner Node question. I'm running a Node/Express app, and I want to send client-side

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.