# Endpoint: https://id.nlm.nih.gov/mesh/sparql
# Description: Descriptor -> Concept -> Term, Descriptor -> Qualifier, Descriptor -> Term, Descriptor -> TreeNumber
PREFIX meshv: <http://id.nlm.nih.gov/mesh/vocab#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?descriptor_id ?descriptor_label ?concept_id ?concept_label ?term_id ?term_label ?qualifier_id ?qualifier_label ?tree_number_label
FROM <http://id.nlm.nih.gov/mesh>
WHERE {
?Descriptor a meshv:TopicalDescriptor ;
meshv:identifier ?descriptor_id ;
rdfs:label ?descriptor_label ;
meshv:treeNumber / rdfs:label ?tree_number_label .
OPTIONAL {
?Descriptor meshv:concept ?concept .
OPTIONAL {
?concept meshv:identifier ?concept_id .
}
OPTIONAL {
?concept rdfs:label ?concept_label .
}
OPTIONAL {
?concept meshv:term ?concept_term .
OPTIONAL {
?concept_term meshv:identifier ?term_id .
}
OPTIONAL {
?concept_term meshv:prefLabel ?term_label .
}
}
OPTIONAL {
?Descriptor meshv:allowableQualifier ?allowable_qualifier .
OPTIONAL {
?allowable_qualifier meshv:identifier ?qualifier_id .
}
OPTIONAL {
?allowable_qualifier rdfs:label ?qualifier_label .
}
}
}
}
LIMIT 100