我对使用DBPedia和SPARQL查询疾病到医学专业的地图很感兴趣。我想编写一个返回疾病名称和相关的医学专业名称的查询。
我知道我可以通过这个查询得到一个疾病列表:
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?disease WHERE {
?disease a dbo:Disease .
}
ORDER BY ?disease我怎样才能获得相关的医学专业?我是斯派克和DBPedia的新手!
发布于 2018-04-02 20:20:21
我测试了它的这里;下面的查询应该给出您想要的内容:
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?disease ?med_spec WHERE {
?disease a dbo:Disease .
?disease dbp:field ?med_spec .
}这就产生了(仅举几个例子):
http://dbpedia.org/resource/Dengue_fever http://dbpedia.org/resource/Infectious_disease_(medical_specialty)
http://dbpedia.org/resource/Dermatitis http://dbpedia.org/resource/Dermatology
http://dbpedia.org/resource/Diabetes_insipidus http://dbpedia.org/resource/Endocrinology
http://dbpedia.org/resource/Diabetic_ketoacidosis http://dbpedia.org/resource/Endocrinology
http://dbpedia.org/resource/Diabetic_retinopathy http://dbpedia.org/resource/Ophthalmology
http://dbpedia.org/resource/Diarrhea http://dbpedia.org/resource/Gastroenterology
http://dbpedia.org/resource/Diarrhea http://dbpedia.org/resource/Infectious_disease_(medical_specialty)https://stackoverflow.com/questions/49617994
复制相似问题