Skip to content
Toshiaki Katayama edited this page Nov 1, 2021 · 16 revisions

MeSH

SPARQL for SPARQList API

rdf-config --config config/mesh --sparql togodx:integbio
# Endpoint: https://integbio.jp/togosite/sparql
# Description: SPARQL for https://integbio.jp/togosite/sparqlist/disease_diseases_mesh

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

SELECT ?Descriptor ?TreeNumber ?descriptor_label
FROM <http://rdf.integbio.jp/dataset/togosite/mesh>
WHERE {
    ?Descriptor a meshv:TopicalDescriptor ;
        meshv:treeNumber ?TreeNumber ;
        rdfs:label ?descriptor_label .
    ?TreeNumber a meshv:TreeNumber .
}
LIMIT 100

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

SELECT (?TreeNumber AS ?category) (?descriptor_label AS ?label) (COUNT(DISTINCT ?Descriptor) AS ?count)
FROM <http://rdf.integbio.jp/dataset/togosite/mesh>
WHERE {
    ?Descriptor a meshv:TopicalDescriptor ;
#        meshv:treeNumber ?TreeNumber ;
        meshv:treeNumber/meshv:parentTreeNumber* ?TreeNumber ;
        rdfs:label ?descriptor_label .
    ?TreeNumber a meshv:TreeNumber .
    MINUS {
        ?TreeNumber meshv:parentTreeNumber ?parent .
    }
    FILTER (CONTAINS(STR(?TreeNumber),"mesh/C"))
    FILTER(lang(?descriptor_label) = "en")
}
ORDER BY DESC(?count)
LIMIT 100

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

SELECT
    (?TreeNumber AS ?category)
    (?descriptor_label AS ?label)
    (COUNT(DISTINCT ?Descriptor) AS ?count)
FROM <http://rdf.integbio.jp/dataset/togosite/mesh>
WHERE {
    ?Descriptor a meshv:TopicalDescriptor ;
        meshv:treeNumber/meshv:parentTreeNumber* ?TreeNumber ;
    MINUS {
        ?TreeNumber meshv:parentTreeNumber ?parent .
    }
    ?TreeNumber a meshv:TreeNumber ;
        ^meshv:treeNumber/rdfs:label ?descriptor_label .
    FILTER (contains(str(?TreeNumber), "mesh/C"))
    FILTER (lang(?descriptor_label) = "en")
}
ORDER BY DESC(?count)

あと、中間階層の ID を受け取って集計するなど要改訂

SPARQL for TogoDX dump

# Endpoint: https://integbio.jp/togosite/sparql
# Description: SPARQL for https://togodx.integbio.jp/sparqlist/disease_diseases_mesh

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

SELECT DISTINCT
    (?Descriptor AS ?mesh_id)                              # 本人
    (?descriptor_label AS ?mesh_label)            # ラベル
    (?parentDescriptor AS ?parent_mesh_id)  # 親
    (SAMPLE(?child) AS ?tree_child)         # leafフラグ
FROM <http://rdf.integbio.jp/dataset/togosite/mesh>
WHERE {
    ?Descriptor a meshv:TopicalDescriptor ;
        meshv:treeNumber ?TreeNumber ;
        rdfs:label ?descriptor_label .
    ?TreeNumber a meshv:TreeNumber .
    OPTIONAL {
        ?TreeNumber meshv:parentTreeNumber ?parent .
        ?parentDescriptor meshv:treeNumber ?parent .
    }
    OPTIONAL {
        ?child meshv:parentTreeNumber ?TreeNumber.
    }
    FILTER (contains(str(?TreeNumber), "mesh/C"))
    FILTER (lang(?descriptor_label) = "en")
}
GROUP BY ?Descriptor ?descriptor_label ?parentDescriptor

このあと JS で

      leaf: (d.tree_child == undefined ? true : false),
      parent: (d.parent_mesh_id == undefined ? "root" :  d.parent_mesh_id.value.replace(idPrefix, ""))

のような処理をしているけど SPARQL だけで leaf を boolean に、parent が空なら root を補完できるとよい(宿題)。

PubChem assay

rdf-config --config config/pubchem --sparql test_types              
# Endpoint: https://integbio.jp/rdf/ncbi/sparql
PREFIX bao: <http://www.bioassayontology.org/bao#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX sio: <http://semanticscience.org/resource/>

SELECT DISTINCT ?PubChemEndpointClass # ?PubChemEndpoint ?value ?unit
FROM <http://rdf.integbio.jp/dataset/pubchem>
WHERE {
  ?PubChemBioAssay a bao:BAO_0000015 ;
    bao:BAO_0000209 / obo:OBI_0000299 ?PubChemEndpoint .
  ?PubChemEndpoint a ?PubChemEndpointClass ;
    sio:has-value ?value ;
    sio:has-unit ?unit .
}
LIMIT 200
PubChemEndpointClass
bao:BAO_0000034
bao:BAO_0000186
bao:BAO_0000187
bao:BAO_0000188
bao:BAO_0000189
bao:BAO_0000190
bao:BAO_0000192
bao:BAO_0000194
bao:BAO_0000477
bao:BAO_0002117
bao:BAO_0002144
bao:BAO_0002145
bao:BAO_0002146
bao:BAO_0002162
bao:BAO_0002862
bao:BAO_0002877
bao:BAO_0002878
bao:BAO_0002879
bao:BAO_0002880
bao:BAO_0002881
bao:BAO_0002882
bao:BAO_0002883
bao:BAO_0002884
bao:BAO_0002886
bao:BAO_0002887
bao:BAO_0003036
PREFIX bao: <http://www.bioassayontology.org/bao#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX sio: <http://semanticscience.org/resource/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?PubChemEndpointClass ?label # ?PubChemEndpoint ?value ?unit
FROM <http://rdf.integbio.jp/dataset/pubchem>
WHERE {
        ?PubChemBioAssay a bao:BAO_0000015 ;
            bao:BAO_0000209 / obo:OBI_0000299 ?PubChemEndpoint .
        ?PubChemEndpoint a ?PubChemEndpointClass ;
            rdfs:label ?label .
}
LIMIT 200
PubChemEndpointClass	label
bao:BAO_0000034	"Average Kd"@en
bao:BAO_0000034	"IC50"@en
bao:BAO_0000034	"Kd (FL)"@en
bao:BAO_0000034	"Kd"@en
bao:BAO_0000034	"Ki"@en
bao:BAO_0000186	"AC50"@en
bao:BAO_0000186	"AC_50_uM"@en
bao:BAO_0000186	"POTENCY_uM"@en
bao:BAO_0000186	"Potency"@en
bao:BAO_0000186	"XC50_3D7"@en
bao:BAO_0000187	"CC50"@en
bao:BAO_0000187	"EC50"@en
bao:BAO_0000187	"IC50"@en
bao:BAO_0000188	"CC50"@en
bao:BAO_0000188	"EC50"@en
bao:BAO_0000188	"EC90"@en
bao:BAO_0000188	"IC50"@en
bao:BAO_0000188	"Ki"@en
bao:BAO_0000189	"GI50"@en
bao:BAO_0000189	"IC50"@en
bao:BAO_0000189	"LC50"@en
bao:BAO_0000190	"64"@en
bao:BAO_0000190	"CC50"@en
bao:BAO_0000190	"EC50"@en
bao:BAO_0000190	"GI50"@en
bao:BAO_0000190	"IC50"@en
bao:BAO_0000190	"IC80"@en
bao:BAO_0000190	"Imax"@en
bao:BAO_0000190	"Kd"@en
bao:BAO_0000190	"Ki "@en
bao:BAO_0000190	"Ki"@en
bao:BAO_0000190	"LC50"@en
bao:BAO_0000190	"TGI"@en
bao:BAO_0000192	"EC50"@en
bao:BAO_0000192	"IC50"@en
bao:BAO_0000192	"KI_MICROM"@en
bao:BAO_0000192	"Kd"@en
bao:BAO_0000192	"Ki"@en
bao:BAO_0000194	"IC50"@en
bao:BAO_0000194	"LC50"@en
bao:BAO_0000194	"TGI"@en
bao:BAO_0000477	"Km"@en
bao:BAO_0002117	"LD50"@en
bao:BAO_0002144	"Active Concentration IC90"@en
bao:BAO_0002144	"ActiveConcentrationIC90"@en
bao:BAO_0002144	"Active_Concentration_IC90"@en
bao:BAO_0002144	"Average IC90"@en
bao:BAO_0002144	"Avg IC90"@en
bao:BAO_0002144	"IC90"@en
bao:BAO_0002144	"LogCFU_IC90"@en
bao:BAO_0002144	"StarvMIC_IC90"@en
bao:BAO_0002145	"GI50"@en
bao:BAO_0002145	"IC50"@en
bao:BAO_0002145	"LC50"@en
bao:BAO_0002145	"TGI"@en
bao:BAO_0002146	"MIC [4 fold reduction]"@en
bao:BAO_0002146	"MIC"@en
bao:BAO_0002146	"MIC_EC_37"@en
bao:BAO_0002146	"MIC_YP_37"@en
bao:BAO_0002146	"Mean MIC"@en
bao:BAO_0002162	"2nd Test Concentration"@en
bao:BAO_0002162	"AC200"@en
bao:BAO_0002162	"AC90_uM"@en
bao:BAO_0002162	"ACTIVE_CONCENTRATION_(uM)"@en
bao:BAO_0002162	"AbsAC0.39_uM"@en
bao:BAO_0002162	"AbsAC0.47_uM"@en
bao:BAO_0002162	"AbsAC0.54_uM"@en
bao:BAO_0002162	"AbsAC1_uM"@en
bao:BAO_0002162	"AbsAC200_uM"@en
bao:BAO_0002162	"AbsAC30_uM"@en
bao:BAO_0002162	"AbsAC90_uM"@en
bao:BAO_0002162	"Ac50"@en
bao:BAO_0002162	"Active Concentration"@en
bao:BAO_0002162	"Activity at 9.921 uM"@en
bao:BAO_0002162	"Activity"@en
bao:BAO_0002162	"Agonism inflection point"@en
bao:BAO_0002162	"Average Kd"@en
bao:BAO_0002162	"Average_Ki_uM"@en
bao:BAO_0002162	"CC20"@en
bao:BAO_0002162	"CMC"@en
bao:BAO_0002162	"CO2"@en
bao:BAO_0002162	"CRC/CRC0 at 12.5 microM_mean"@en
bao:BAO_0002162	"CRC/CRC0 at 50 microM_mean"@en
bao:BAO_0002162	"Cell Proliferation EC50"@en
bao:BAO_0002162	"Cell Proliferation EC70"@en
bao:BAO_0002162	"Cell Proliferation IC50"@en
bao:BAO_0002162	"Cmax"@en
bao:BAO_0002162	"Compound_Concentration"@en
bao:BAO_0002162	"Cp"@en
bao:BAO_0002162	"DC50"@en
bao:BAO_0002162	"Drug uptake"@en
bao:BAO_0002162	"Drug uptake(free)"@en
bao:BAO_0002162	"EC"@en
bao:BAO_0002162	"EC200"@en
bao:BAO_0002162	"EC50"@en
bao:BAO_0002162	"EC90"@en
bao:BAO_0002162	"HC10"@en
bao:BAO_0002162	"HEPG2TOX ASSAY - CC50"@en
bao:BAO_0002162	"HEPG2TOX ASSAY - CC90"@en
bao:BAO_0002162	"IC25"@en
bao:BAO_0002162	"IC30"@en
bao:BAO_0002162	"IC50"@en
bao:BAO_0002162	"IC80"@en
bao:BAO_0002162	"IC90_uM"@en
bao:BAO_0002162	"ID50"@en
bao:BAO_0002162	"INH"@en
bao:BAO_0002162	"Imax"@en
bao:BAO_0002162	"Inhibition"@en
bao:BAO_0002162	"K"@en
bao:BAO_0002162	"K1/2"@en
bao:BAO_0002162	"KDss"@en
bao:BAO_0002162	"Kact"@en
bao:BAO_0002162	"Kb"@en
bao:BAO_0002162	"Kd apparent"@en
bao:BAO_0002162	"Kd for PAK2"@en
bao:BAO_0002162	"Kd"@en
bao:BAO_0002162	"Ki "@en
bao:BAO_0002162	"Ki1"@en
bao:BAO_0002162	"Ki2"@en
bao:BAO_0002162	"Ki_uM"@en
bao:BAO_0002162	"Kr"@en
bao:BAO_0002162	"LUCIFERASE EXPRESSION CONTROL - IC50"@en
bao:BAO_0002162	"LUCIFERASE EXPRESSION CONTROL - IC90"@en
bao:BAO_0002162	"LUCIFERASE INFECTION ASSAY - IC50"@en
bao:BAO_0002162	"LUCIFERASE INFECTION ASSAY - IC90"@en
bao:BAO_0002162	"LogChange"@en
bao:BAO_0002162	"MEC"@en
bao:BAO_0002162	"MEC1.5"@en
bao:BAO_0002162	"MEC2.0"@en
bao:BAO_0002162	"MIC90"@en
bao:BAO_0002162	"Max_Activity_Concentration_uM "@en
bao:BAO_0002162	"Max_Concentration(uM) "@en
bao:BAO_0002162	"Potentiation inflection point"@en
bao:BAO_0002162	"Solubility"@en
bao:BAO_0002162	"TC50 "@en
bao:BAO_0002162	"TC50 (2% Serum) "@en
bao:BAO_0002162	"TC50 (5% Serum) "@en
bao:BAO_0002162	"TC50 (5% Serum)"@en
bao:BAO_0002162	"TD100"@en
bao:BAO_0002162	"TD50 (microM)"@en
bao:BAO_0002162	"Toxicity"@en
bao:BAO_0002862	"5h_period"@en
bao:BAO_0002877	"AbsAC1000_uM"@en
bao:BAO_0002878	"AbsAC10_uM"@en
bao:BAO_0002879	"AbsAC26_uM"@en
bao:BAO_0002880	"AbsAC35_uM"@en
bao:BAO_0002881	"AbsAC40_uM"@en
bao:BAO_0002882	"AbsAC500_uM"@en
bao:BAO_0002883	"ECMax"@en
bao:BAO_0002884	"Max_Activity_Conc_uM"@en
bao:BAO_0002884	"Max_Delta_Tm_Conc_uM"@en
bao:BAO_0002886	"Conc @ Max Fold Increase"@en
bao:BAO_0002887	"Concentration @ Maximum % Inhibition"@en
bao:BAO_0003036	"ED50"@en
sort | uniq -c
   1 bao:BAO_0000477
   1 bao:BAO_0002117
   1 bao:BAO_0002862
   1 bao:BAO_0002877
   1 bao:BAO_0002878
   1 bao:BAO_0002879
   1 bao:BAO_0002880
   1 bao:BAO_0002881
   1 bao:BAO_0002882
   1 bao:BAO_0002883
   1 bao:BAO_0002886
   1 bao:BAO_0002887
   1 bao:BAO_0003036
   2 bao:BAO_0002884
   3 bao:BAO_0000187
   3 bao:BAO_0000189
   3 bao:BAO_0000194
   4 bao:BAO_0002145
   5 bao:BAO_0000034
   5 bao:BAO_0000186
   5 bao:BAO_0000188
   5 bao:BAO_0000192
   5 bao:BAO_0002146
   8 bao:BAO_0002144
  12 bao:BAO_0000190
  81 bao:BAO_0002162
Clone this wiki locally