Sparql query containment result

匆匆过客 提交于 2019-12-11 07:35:40

问题


Not familiar with semantic web, under the following context:

// owl in terms of Java-like syntax
Class Person {}
Class GraduateStudent extends Person {reference takesCourse [*] : GraduateCourse}
Class Student intersect Person {reference takesCourse [*] : Course}
Class UndergradStudent extends Student {}

Class Course{}
Class GraduateCourse extends Course{}
Class CsCourse extends Course{}

My question is why Q1 ⊑ Q2 does not hold? In particular, if I understand correctly, Q1 select undergraduate students take CsCourse and graduate students take GraduateCourse, and Q2 select undergraduate students take any Course and graduate students take any Course:

// Q1:
SELECT ?x ?y WHERE 
{ 
  { ?x a :UndergradStudent .
    ?x :takesCourse ?y . 
    ?y a :CsCourse 
  }
    UNION 
  { ?x a :GraduateStudent .
    ?x :takesCourse ?y 
  }
}

// Q2: 
SELECT ?x ?y WHERE 
{ 
  {
    { 
      ?x a :UndergradStudent . 
      ?x :takesCourse ?y 
    }
     UNION 
    { 
      ?x a :GraduateStudent .
      ?x :takesCourse ?y 
    } 
   }
   ?y a :Course .
}

edit: this example can be found at: http://sparql-qc-bench.inrialpes.fr/UCQrdfs.html, Q43b and Q43c in particular.

来源:https://stackoverflow.com/questions/49673086/sparql-query-containment-result

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!