我有一个父类“起因”有子类“Agging”,“BadLifeStyle”每个类导致与个人(Class =>个人)的数据类型属性“名称”原因=> Cause_1, Agging => Agging_1,BadLifeStyle => BadLifeStyle_1 我想这样这个Sparql查询有什么问题
Ind SubCLassOF type
Agging_1 Causes Agging
BadLifeStyle_1 Causes BadLifeStyle
Cause_1 Causes
结果我写此查询
SELECT *
WHERE {
?cause rdf:type ?typename.
?cause rdfs:subClassOf ?subClass.
OPTIONAL{?cause NS:name ?name.}
FILTER(REGEX(STR(?typename),"Causes","i")
|| REGEX(STR(?subClass),"Causes","i"))
}
它没有给我Cause_1个人
您可以发布你的RDF文件? –
answer.semanticweb.com上的重复问题:http://answers.semanticweb.com/questions/12042/help-me-in-this-sparql-query –