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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:09:14+00:00 2026-06-07T00:09:14+00:00

I have a graph representing users and some articles they wrote. I need to

  • 0

I have a graph representing users and some articles they wrote. I need to create something like an activity stream including the articles wrote by the user and also by its friends.

http://twitpic.com/a342f4

I can have all the user’s friends’ posts like this:

g.v(4).out("KNOWS").out("POSTED")

and returns

v[9]
v[11]

But I also need to include the posts from the original user retrieved with query:

g.v(4).out("POSTED")

this returns

v[10]

How can I have all the posts without having to do 2 queries and then merging them later?
I need to get something like this in return:

v[9]
v[10]
v[11]   

Thanks

PD: I’m using Gremlin and Neo4jClient but if anyone have a better solution with something else its will be fine too, at this point I still can change some of the tools I’m using

  • 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-07T00:09:16+00:00Added an answer on June 7, 2026 at 12:09 am

    Use Gremlin’s aggregate step and Groovy’s unique method:

    posts = []
    g.v(4).out('POSTED').aggregate(posts).iterate()
    g.v(4).out('KNOWS').out('POSTED').aggregate(posts).iterate()
    return posts.unique()
    

    See…

    • https://github.com/tinkerpop/gremlin/wiki/Gremlin-Steps
    • http://groovy.codehaus.org/groovy-jdk/java/util/Collection.html
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some graph, which I want to display using JUNG2 like in the
I have a graph created with MS Chart like the following picture. As you
I have a graph library that I use to plot some data. This data
Need help. I have Graph API code that uses an auth token with offline
We have social graph that is later broken to clusters of high cohesion. Something
I'm trying to create a model representing graph node. class Node(models.model): ins = models.ManyToManyField(self,
I have a graph like structure. I don't know exactly when to destroy the
I have a graph object, that I need to serialize. Nomatter which members i
I'm doing some FK analysis of our tables by making a directed graph representing
I have a control flow graph representing a single procedure of my intermediate language

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.