How to enclose multiple type constraints in ShEx?

If I have data such as

@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 that the subjects are students or teachers, and they can be zero or more football, baseball or rugby players, how can I write this in ShEx? I know this works for a single arc like:

my:person {
  a [my:Student my:Teacher]
}
+4
source share
1 answer

You do not need to do anything except one type-arc constraint; just add another set of values my:*Player:

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

demo

+4
source

Source: https://habr.com/ru/post/1687260/


All Articles