is there a method to select all categories MeSH with sparql

拈花ヽ惹草 提交于 2021-01-07 03:22:11

问题


i want to get data with sparql from Medical Subject Headings RDF

i try to do this code :

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX meshv: <http://id.nlm.nih.gov/mesh/vocab#>
PREFIX mesh: <http://id.nlm.nih.gov/mesh/>
PREFIX mesh2015: <http://id.nlm.nih.gov/mesh/2015/>
PREFIX mesh2016: <http://id.nlm.nih.gov/mesh/2016/>
PREFIX mesh2017: <http://id.nlm.nih.gov/mesh/2017/>

SELECT DISTINCT ?descriptor ?label
FROM <http://id.nlm.nih.gov/mesh>

WHERE {
mesh:D009369 meshv:treeNumber ?treeNum .
?childTreeNum meshv:parentTreeNumber+ ?treeNum .
?descriptor meshv:treeNumber ?childTreeNum .
?descriptor rdfs:label ?label .
}

ORDER BY ?label

this code return

 descriptor     label
mesh:D000182    ACTH Syndrome, Ectopic
mesh:D049913    ACTH-Secreting Pituitary Adenoma
mesh:D000008    Abdominal Neoplasms

but me i want to get from this page for example https://meshb.nlm.nih.gov/record/ui?ui=D000172 :

Musculoskeletal Diseases [C05]
Bone Diseases [C05.116]
Bone Diseases, Endocrine [C05.116.132]
Acromegaly [C05.116.132.082]
Congenital Hypothyroidism [C05.116.132.256]
.........

but i want to collect all data (code with label) from mesh, not only this example


回答1:


I know I'm not answering your question, but you are missing the rdfs prefix in the beginning...

PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#

Paul



来源:https://stackoverflow.com/questions/64879704/is-there-a-method-to-select-all-categories-mesh-with-sparql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!