4

If I have data like

@prefix my: <http://example.com/>
my:student1 a my:Student .
my:student1 a my:FoodballPlayer .
my:teacher2 a my:Teacher .
my:teacher2 a my:BaseballPlayer .
my:teacher2 a my:RugbyPlayer .

and I want to say the subjects are either students or teachers and they may be zero or more of football, baseball or rugby players, how do I write that in ShEx? I know this works for one type arc:

my:person {
  a [my:Student my:Teacher]
}
unor
  • 92,415
  • 26
  • 211
  • 360
Andra
  • 687
  • 2
  • 9
  • 20

1 Answers1

4

You don't need to do anything different than for one type arc constraint; just add another with your my:*Player value set:

PREFIX my: <http://example.com/>
my:person {
  a [my:Student my:Teacher];
  a [my:FootballPlayer my:BaseballPlayer my:RugbyPlayer]+
}

demo

ericP
  • 1,675
  • 19
  • 21