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

  • Home
  • SEARCH
  • 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 9201715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:05:00+00:00 2026-06-17T23:05:00+00:00

I am having a a traversal use case as follows .Does orientDb supports it?

  • 0

I am having a a traversal use case as follows .Does orientDb supports it?

1)Find all paths from node1 to node2 .ONLY TRAVERSE those nodes which has property xyz=”val1″
2)Find shortest path .ONLY TRAVERSE those nodes which has property xyz=”val1″
3)Find longest path .ONLY TRAVERSE those nodes which has property xyz=”val1″

abstract class TraversGraph{
     public  Path getPath(Node src,Node dest, Propery property,Value value);
}

Note :Please note the condition which i mentioned in caps

  • 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-17T23:05:02+00:00Added an answer on June 17, 2026 at 11:05 pm

    You can use Gremlin to get paths between two nodes. You can firstly find all the paths, so the shortest and the longest are included in all these paths.
    Here is an example:
    enter image description here
    As you can see in the image, from A to B there are three paths(A->B, A->F->C->B, A->E->D->C->B), but node F doesn’t have property "xyz" with value "val1", so this paths should not be included.

    Code:

    gremlin> g = new TinkerGraph()
    ==>tinkergraph[vertices:0 edges:0]
    gremlin> a = g.addVertex(null,[name: "A", xyz: "val1"])
    ==>v[0]
    gremlin> b = g.addVertex(null,[name: "B", xyz: "val1"])
    ==>v[1]
    gremlin> c = g.addVertex(null,[name: "C", xyz: "val1"])
    ==>v[2]
    gremlin> d = g.addVertex(null,[name: "D", xyz: "val1"])
    ==>v[3]
    gremlin> e = g.addVertex(null,[name: "E", xyz: "val1"])
    ==>v[4]
    gremlin> f = g.addVertex(null,[name: "F"])
    ==>v[5]
    gremlin> g.addEdge(a, b, "KNOWS")
    ==>e[6][0-KNOWS->1]
    gremlin> g.addEdge(a, e, "KNOWS")
    ==>e[7][0-KNOWS->4]
    gremlin> g.addEdge(a, f, "KNOWS")
    ==>e[8][0-KNOWS->5]
    gremlin> g.addEdge(f, c, "KNOWS")
    ==>e[9][5-KNOWS->2]
    gremlin> g.addEdge(e, d, "KNOWS")
    ==>e[10][4-KNOWS->3]
    gremlin> g.addEdge(d, c, "KNOWS")
    ==>e[11][3-KNOWS->2]
    gremlin> g.addEdge(c, b, "KNOWS")
    ==>e[12][2-KNOWS->1]
    

    And traversel between node A and node B(Here we do not filter the property "xyz"), so we get three paths:

    gremlin> a.out('KNOWS').loop(1){it.loops<100}{true}.has('name', 'B').path{it.name}
    ==>[A, B]
    ==>[A, F, C, B]
    ==>[A, E, D, C, B]
    

    And add the filter of property "xyz"

    gremlin> a.out('KNOWS').loop(1){it.loops<100 && it.object.hasNot('xyz', null)}{true}.has('name', 'B').path{it.name}
    ==>[A, B]
    ==>[A, E, D, C, B]
    

    Thus we get the shortest path: [A, B]
    and the longest path: [A, E, D, C, B]

    English is not my mother language, so if any confusion, feel free to contact me.

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

Sidebar

Related Questions

Having understood Traversal and the whole resource and context concepts from my question ,
I'm having the following issue - I want to traverse all the xml files
I'm having memory woes. I've got a C++ Library (Equalizer from Eyescale) and they
Background: Having given up on the practical daily use of XSLT as a part
I've searched for an answer all over but I can't find a way to
Having searched a whole lot of similair posts, workarounds, I decided to make my
Having trouble with each function... Will try to explain by example... In my code,
Having a hard time with labels on a ggplot2 plot. Here's a similar plot
Having used storyboards for a while now I have found them extremely useful however,
Having just added a new button in my web application, I get an error

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.