我有一个模型,我有3个类:
EMail Entity Attribute Value
john.smith@email.com 1 Active 1
john.smith@email.com 1 First_Name John
john.smith@email.com 1 Last_Name Smith
john.smith@email.com 1 EMail john.smith@email.com
<http://data.sample.com/vocab/StudentRecord>
<http://data.sample.com/vocab/HealthCenterVisitRecord>
<http://data.sample.com/vocab/ClassRoom>
有一个属性StudentRecord
。
classRoom
有一个属性HealthCenterVisitRecord
。
鉴于特定的studentRecord
URI,如何查找属于ClassRoom
s的所有StudentRecord
。
我试过的查询(查询的初始部分提取属于HealthCenterVisitRecord
的学生,但第二部分搞砸了,我知道了):
ClassRoom
我尝试了另一个问题:
SELECT ?hcvr
WHERE {
?sr rdf:type <http://data.sample.com/vocab/StudentRecord>.
?sr <http://data.sample.com/vocab/classRoom> <http://data.sample.com/resource/ClassRoom/1156>.
?sr <http://data.sample.com/vocab/healthCentreVisitRecord> ?hcvr.
}
答案 0 :(得分:0)
想出来,这是查询:
SELECT ?hcvr
WHERE {
?sr rdf:type <http://data.sample.com/vocab/StudentRecord>.
?sr <http://data.sample.com/vocab/classRoom> <http://data.sample.com/resource/ClassRoom/1156>.
?hcvr rdf:type <http://data.sample.com/vocab/healthCentreVisitRecord>.
?hcvr <http://data.sample.com/vocab/studentRecord> ?sr.
}