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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:36:26+00:00 2026-06-16T20:36:26+00:00

I have the following graph as a Neo4j graph database: activates (80 °F) (A)————————————->(D)

  • 0

I have the following graph as a Neo4j graph database:

                           activates
                            (80 °F)
          (A)------------------------------------->(D)
           | \__                                _/->^
           |    \__  activates               __/    |
           |       \__(50 °F)             __/       |
           |          \__              __/          |             
           |             \__        __/             | 
activates  |                \__  __/                |
 (50 °F)   |                   \/                   | activates
           |                 __/\__                 | (50 °F)
           |    activates __/      \__              |
           |    (60 °F)__/            \__           |
           |        __/                  \__        |
           |     __/                        \__     |
           |  __/                              \_   |
           v /                                   \->|
          (B)------------------------------------->(C)
                           activates                          
                            (50 °F)

Each relationship has a property denoting the required temperature for the ‘activates’ action.

I need to retrieve all the available paths between (A) and (D) WHERE the temperature is 50 °F along the path.

The output should include:

A -[:activates{temperature:'50'}]-> B -[:activates{temperature:'50'}]-> C -[:activates{temperature:'50'}]-> D

A -[:activates{temperature:'50'}]-> C -[:activates{temperature:'50'}]-> D

but not

A -[:activates{temperature:'80'}]-> D

A -[:activates{temperature:'50'}]-> B -[:activates{temperature:'60'}]-> D

How do I write the required Cypher query?

Thanks in advance.

Edit 1: I added another diagonal relationship (B -[:activates{temperature:’80’}]-> D) for more clarity.

Edit 2: I need to retrieve all the available paths between (A) and (D) WHERE the temperature is the same along the path, i.e: A -> B -> C -> D, A -> C -> D, A -> D.

  • 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-16T20:36:28+00:00Added an answer on June 16, 2026 at 8:36 pm
    START a=node({A}), d=node({D})
    MATCH p=a-[r:ACTIVATES*..]-d
    WHERE has(r.temperature) and r.temperature='50'
    RETURN p;
    

    substitute the values in the curved brackets (A,D) with their node IDs

    update:
    using function all

    START a=node(1), d=node(4) 
    MATCH p=a-[r:ACTIVATES*..]-d 
    WITH head(relationships(p))as r1,p //since the pointer r is a collection of rels we must declare a single relationship pointer
    WHERE all(r2 in relationships(p) 
              where r2.temperature=r1.temperature) 
    return p;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a vertex {first_name, last_name} in a graph database (Neo4j in this
I have the following simple Graph class, where for each Node , I store
I'm newbie to Neo4j/GraphDB and have created following simple graph node[1]user1 which is 'friend'
I have the following graph using dot layout: digraph G { graph [rankdir=LR]; subgraph
I have the following graph that I generated using ggplot2 I had finalPlot as
We have configured iReport to generate the following graph: The real data points are
I have a graph created with MS Chart like the following picture. As you
I have the following directed graph implementation Nodes nod[] List<Arcs> arc[] So the node
I have the following which searches my graph to see if a vertex is
for reasons based on storabiligty I have the following objects in a XAML graph:

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.