【问题标题】:How do state multiple type constraints in ShEx?如何在 ShEx 中声明多种类型约束?
【发布时间】:2017-10-10 21:03:05
【问题描述】:

如果我有类似的数据

@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]
}

【问题讨论】:

    标签: rdf semantic-web shex


    【解决方案1】:

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

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

    demo

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-28
      • 1970-01-01
      • 2017-04-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-21
      相关资源
      最近更新 更多