4

如果我有类似的数据

@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 .

我想说的是学生或老师,他们可能是零个或多个足球、棒球或橄榄球运动员,我如何在 ShEx 中写出来?我知道这适用于一种类型的弧:

my:person {
  a [my:Student my:Teacher]
}
4

1 回答 1

4

除了一种类型的弧约束,您不需要做任何不同的事情;只需使用您的my:*Player值集添加另一个:

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

演示

于 2017-10-10T22:25:36.083 回答