我有一個父類「起因」有子類「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 –