Datasets

Medical Subject Headings (MeSH) RDF Dataset Description

A linked data representation of the MeSH biomedical vocabulary produced by the National Library of Medicine.

Dataset specifications

Tags
Ontology/ Terminology/Nomenclature
Provenance Original
Registration Added by RDF portal
Data provider
  • National Library of Medicine
Creator
  • National Library of Medicine
Issued 2024-12-05
Licenses
  • Creative commons 1.0 Universal (CC0 1.0) link
    Genebank Project, NARO licensed under CC Atribution 4.0 International License.
Version 2025
Download https://rdfportal.org/download/mesh
SPARQL Endpoint https://rdfportal.org/ncbi/sparql

Dataset statistics

Triples
154704756
Subjects
23893096
Properties
47
Objects
55145885
Classes
16

SPARQL example queries

Example 1

Run on Endpoint
# 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
WHERE {
    ?Descriptor a meshv:TopicalDescriptor ;
        meshv:identifier ?descriptor_id ;
        rdfs:label ?descriptor_label ;
        meshv:treeNumber / rdfs:label ?tree_number_label .
    OPTIONAL {
        ?Descriptor meshv:concept / meshv:identifier ?concept_id .
    }
    OPTIONAL {
        ?Descriptor meshv:concept / rdfs:label ?concept_label .
    }
    OPTIONAL {
        ?Descriptor meshv:concept / meshv:term / meshv:identifier ?term_id .
    }
    OPTIONAL {
        ?Descriptor meshv:concept / meshv:term / meshv:prefLabel ?term_label .
    }
    OPTIONAL {
        ?Descriptor meshv:allowableQualifier / meshv:identifier ?qualifier_id .
    }
    OPTIONAL {
        ?Descriptor meshv:allowableQualifier / rdfs:label ?qualifier_label .
    }
}
LIMIT 100

Example 2

Run on Endpoint
# Endpoint: https://id.nlm.nih.gov/mesh/sparql
# Description: 
# Parameter: parent_tree_number: (example: mesh:C01)

PREFIX meshv: <http://id.nlm.nih.gov/mesh/vocab#>
PREFIX mesh: <http://id.nlm.nih.gov/mesh/>

SELECT ?TreeNumber ?parent_tree_number
WHERE {
    VALUES ?parent_tree_number { mesh:C01 }
    ?TreeNumber a meshv:TreeNumber ;
        meshv:parentTreeNumber ?parent_tree_number .
    ?parent_tree_number a meshv:TreeNumber .
}
LIMIT 100

Example 3

Run on Endpoint
# Endpoint: https://id.nlm.nih.gov/mesh/sparql
# Description: 
# Parameter: qualifier_active: (example: true)
#            allowed_descriptor_qualifier_pair_active: (example: true)

PREFIX meshv: <http://id.nlm.nih.gov/mesh/vocab#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?AllowedDescriptorQualifierPair ?Qualifier ?qualifier_label ?qualifier_active ?allowed_descriptor_qualifier_pair_active
WHERE {
    VALUES ?qualifier_active { true }
    VALUES ?allowed_descriptor_qualifier_pair_active { true }
    ?Qualifier a meshv:Qualifier ;
        meshv:active ?qualifier_active .
    ?AllowedDescriptorQualifierPair a meshv:AllowedDescriptorQualifierPair ;
        meshv:active ?allowed_descriptor_qualifier_pair_active .
    OPTIONAL {
        ?Chemical a meshv:SCR_Chemical ;
            meshv:preferredMappedTo ?AllowedDescriptorQualifierPair .
    }
    OPTIONAL {
        ?Concept a meshv:Concept ;
            meshv:seeAlso / meshv:broaderDescriptor ?Descriptor .
        ?Descriptor a meshv:TopicalDescriptor ;
            meshv:allowableQualifier ?Qualifier .
    }
    OPTIONAL {
        ?Qualifier rdfs:label ?qualifier_label .
    }
}
LIMIT 100

Example 4

Run on Endpoint
# Endpoint: https://id.nlm.nih.gov/mesh/sparql
# Description: 

PREFIX meshv: <http://id.nlm.nih.gov/mesh/vocab#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?Concept ?concept_label ?concept_preferred_term ?term_label
WHERE {
    OPTIONAL {
        ?Concept a meshv:Concept ;
            meshv:seeAlso / meshv:broaderDescriptor ?Descriptor ;
            rdfs:label ?concept_label ;
            meshv:preferredTerm ?concept_preferred_term .
        ?Descriptor a meshv:TopicalDescriptor ;
            meshv:concept ?Concept .
        ?concept_preferred_term a meshv:Term .
    }
    OPTIONAL {
        ?concept_preferred_term a meshv:Term ;
            meshv:prefLabel ?term_label .
    }
    OPTIONAL {
        ?Concept a meshv:Concept ;
            meshv:term / meshv:prefLabel ?term_label .
    }
}
LIMIT 100

Example 5

Run on Endpoint
# Endpoint: https://id.nlm.nih.gov/mesh/sparql
# Description: 

PREFIX meshv: <http://id.nlm.nih.gov/mesh/vocab#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?Concept ?concept_label ?concept_preferred_term ?descriptor_preferred_term ?qualifier_preferred_term ?term_label
WHERE {
    ?Concept a meshv:Concept ;
        meshv:seeAlso / meshv:broaderDescriptor ?Descriptor .
    ?Descriptor a meshv:TopicalDescriptor ;
        meshv:preferredTerm ?descriptor_preferred_term .
    ?descriptor_preferred_term a meshv:Term ;
        meshv:prefLabel ?term_label .
    OPTIONAL {
        ?Concept meshv:seeAlso / meshv:broaderDescriptor ?Descriptor ;
            rdfs:label ?concept_label ;
            meshv:preferredTerm ?concept_preferred_term .
        ?Descriptor meshv:concept ?Concept .
        ?concept_preferred_term a meshv:Term .
    }
    OPTIONAL {
        ?concept_preferred_term a meshv:Term ;
            meshv:prefLabel ?term_label .
    }
    OPTIONAL {
        ?Descriptor meshv:allowableQualifier / meshv:preferredTerm ?qualifier_preferred_term .
        ?qualifier_preferred_term a meshv:Term ;
            meshv:prefLabel ?term_label .
    }
    OPTIONAL {
        ?Concept meshv:term / meshv:prefLabel ?term_label .
    }
}
LIMIT 100

Schema diagram

Schema diagram for mesh
Schema diagram for mesh