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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:14:53+00:00 2026-06-18T05:14:53+00:00

I’m creating a system in which we match orders to staff . Conceptually, an

  • 0

I’m creating a system in which we match orders to staff. Conceptually, an order is a request for person to do some work, and a staff is a person who can do that work. An order can have one or more requirements (i.e. restrictions on who can do the work), and a staff can have one more more requirements (i.e. qualifications to do work).

I’m attempting to create a cypher query that will give me all staff that have all of the requirements listed by a given order. Said another way, I’m trying to find all staff nodes that are related to every requirement node that is related to a given order node. My question is: how do I create a cypher query to model that business logic?

As an example, consider the following sample data:

  • A picture view of my sample data
  • Alternatively, here is an
    interactive console for my data

Look at the orderId: 1 node. it has a requires relationship to two nodes, labeled RN and ER IV. In order words, order #1 requires any applicants to have the RN qualification and the ER IV qualification. It so happens that staff member Evan (staffId: 1) has both of those qualifications, so he should be able to apply for that job. The staff member Tim has ONE of those requirements, but not both, so he should not be able to apply for that job. Additionally, orderId: 2 only has one requirement, which Evan and Tim both have, so they should both be able to apply for that job.

So in essence, if I were to start with order #1 I would want to get back only Evan. If I were to start with order #2 I would want to get back Evan and Tim*.

The following query is half way there. It will give me all unique paths from a given order to a staff member one requirement at a time. However, it does not check that EVERY requirement path is satisfied (which means currently it will only work for orders that only have a single requirement):

start o=node(2) 
match o-[:requires]->req<-[:hasRequirement]-s 
return o, req, s;

So what are my options? Can I somehow check the presence of an unknown number of matching relationships? Or will I need to model my data a different way?

*Edit: I made a mistake when setting up my sample data. Tim should have been associated with RN so that he qualified for order #2.

  • 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-18T05:14:54+00:00Added an answer on June 18, 2026 at 5:14 am

    I guess this cypher statement solves your problem:

    start o=node(2) 
    match o-[:requires]->req<-[:hasRequirement]-p 
    with o, p, count(req) as c 
    where length(o-[:requires]-()) = c 
    return p, c
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have an autohotkey script which looks up a word in a bilingual dictionary
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from

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.