尝试在DBPEDIA上运行这段代码,除了标题之外,它不会返回任何内容。
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?diseasename ?personname where {
?disease a dbo:Disease .
?person dbo:deathCause ?disease .
?person rdfs:label ?personname FILTER (lang(?personname) = "en").
?disease rdfs:label ?diseasename FILTER (lang(?diseasename) = "en").
?disease rdfs:label ?diseasename FILTER (?diseasename = "Brain tumor")
}
提前感谢您的帮助!
答案 0 :(得分:0)
试试这个 -
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?diseasename ?personname where {
?disease a dbo:Disease .
?person dbo:deathCause ?disease .
?person rdfs:label ?personname
FILTER (lang(?personname) = "en").
?disease rdfs:label ?diseasename
FILTER (lang(?diseasename) = "en").
?disease rdfs:label ?diseasename
FILTER (?diseasename = "Brain tumor"@en)
}
- 或者,注意上面查询模式中的冗余,这个 -
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?diseasename ?personname where {
?disease a dbo:Disease .
?person dbo:deathCause ?disease .
?person rdfs:label ?personname
FILTER (lang(?personname) = "en").
?disease rdfs:label ?diseasename
FILTER (?diseasename = "Brain tumor"@en)
}