0

I have the following model

(Club)-HAS-(Match)-AT-(Datetime) And (Club)-HAS-(Player)-UNAVAILABLE-(Datetime)

I am using Amazon Neptune to run this, and i am running in the following situation:

I should be able to for each match that a club has, identify which player are available

  1. I need to check the date of each match Match
  2. For each match, identify the club
  3. From club, get players
  4. From player, check if he has an unavailable state on the same match-DateTime

How could I run this in Neptune?

thanks

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
groovekiller
  • 1,122
  • 2
  • 8
  • 20

1 Answers1

1

You need to look for all players that does not close the circle. This query should give you what you need:

g.V().hasLabel('Match').as('m')
.project('match', 'players')
.by(select('m'))
.by(__.in('HAS').hasLabel('Club').out('HAS').hasLabel('Player')
.where(__.not(
    out('UNAVAILABLE').hasLabel('Datetime')
    .in('AT').where(eq('m')))).fold())
Kfir Dadosh
  • 1,411
  • 9
  • 9