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 8972205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:09:42+00:00 2026-06-15T18:09:42+00:00

For a given vertex, how can we get all the out-edges of two different

  • 0

For a given vertex, how can we get all the out-edges of two different types (i.e. labels) only when both edge-types exist for that vertex??

For example,

g = TinkerGraphFactory.createTinkerGraph(); 

I want to know all those who have created some software AND know someone. Obviously, I can’t use

g.V.out('created', 'knows')

because, that would give all those who have either created something OR know someone.

  • 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-15T18:09:43+00:00Added an answer on June 15, 2026 at 6:09 pm

    I didn’t set out to solve this in this manner, but using the and() step seems to work well here:

    gremlin> g = TinkerGraphFactory.createTinkerGraph()
    ==>tinkergraph[vertices:6 edges:6]
    gremlin> g.V.and(_().both("knows"),_().both("created"))
    ==>v[1]
    ==>v[4]
    

    To get the edges/paths of the vertices that meet the AND criteria, you could do:

    gremlin> g.V.and(_().both("knows"),_().both("created")).bothE("created","knows").dedup
    ==>e[9][1-created->3]
    ==>e[7][1-knows->2]
    ==>e[8][1-knows->4]
    ==>e[10][4-created->5]
    ==>e[11][4-created->3]
    

    Since the first part of the Gremlin gets the vertices that have both “knows” AND “created” edges, you can then safely just grab those edges of both the returned vertices and return the unique ones.

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

Sidebar

Related Questions

Given a directed graph with weighted edges, what algorithm can be used to give
If you have a given vertex how could you determine whether that vertex is
Given the next vertex shader, what is the simplest, most efficient and fastest way
I have Depth first searching algorithm whose pseudo code is given below: DFS(Vertex v)
Given a cartesian position, how can you map the angle from the origin into
I can't figure out what is up with this. I have a Scene class
Given the following code: QList<Vertex*> _vertices; //this gets filled //at some other point i
How can I tell whether two triangles intersect in 2D Euclidean space? (i.e. classic
I'm have a large list of value types that needs to be given to
Given a Vertex as: class VertexProps { public: int id; float frame; string name;

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.