Wikidata talk:ScienceSource project/Queries

From Wikidata
Jump to navigation Jump to search

Histogram query[edit]

Saving work in progress:

#For article Q6679

SELECT ?decile ?hybrid

    ?annotation wdt:P3 wd:Q5 ;
                wdt:P19 ?anchor;
                wdt:P16 ?dic0.
    VALUES ?dic { wd:Q6803 wd:Q6793 }.
    ?dic wdt:P16 ?dic0.
    BIND((IF (?dic=wd:Q6803, "Q6803",1/0)) AS ?hybrid1)
    BIND((IF (?dic=wd:Q6793, "Q6793",1/0)) AS ?hybrid2)
    BIND(COALESCE(?hybrid1,?hybrid2) AS ?hybrid)

    ?anchor wdt:P12 wd:Q6679.
    ?anchor wdt:P10 ?charnumber.
    ?annotationZ wdt:P19 ?anchorZ.
    ?anchorZ wdt:P7 wd:Q6;
             wdt:P12 wd:Q6679;
             wdt:P10 ?length.
   BIND (floor(10*?charnumber/?length) AS ?decile)

Try it!

#For article Q6679
#Two columns of data
SELECT ?decile (COUNT(?hybrid1) AS ?count1) (COUNT(?hybrid2) AS ?count2) 

    ?annotation wdt:P3 wd:Q5 ;
                wdt:P19 ?anchor;
                wdt:P16 ?dic0.
    VALUES ?dic { wd:Q6803 wd:Q6793 }.
    ?dic wdt:P16 ?dic0.
    BIND((IF (?dic=wd:Q6803, "Q6803",1/0)) AS ?hybrid1)
    BIND((IF (?dic=wd:Q6793, "Q6793",1/0)) AS ?hybrid2)  
    BIND(COALESCE(?hybrid1,?hybrid2) AS ?hybrid)
    BIND(COALESCE(?hybrid1Label,?hybrid2Label) AS ?hl)
    ?anchor wdt:P12 wd:Q6679.
    ?anchor wdt:P10 ?charnumber.
    ?annotationZ wdt:P19 ?anchorZ.
    ?anchorZ wdt:P7 wd:Q6;
             wdt:P12 wd:Q6679;
             wdt:P10 ?length.
   BIND (floor(10*?charnumber/?length) AS ?decile)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
 GROUP BY ?decile

Try it!

#For article Q6679
#Two columns of data, breakdown of paper 2% at a time
SELECT ?quantile (COUNT(?hybrid1) AS ?count1) (COUNT(?hybrid2) AS ?count2) 

    ?annotation wdt:P3 wd:Q5 ;
                wdt:P19 ?anchor;
                wdt:P16 ?dic0.
    VALUES ?dic { wd:Q6803 wd:Q6793 }.
    ?dic wdt:P16 ?dic0.
    BIND((IF (?dic=wd:Q6803, "Q6803",1/0)) AS ?hybrid1)
    BIND((IF (?dic=wd:Q6793, "Q6793",1/0)) AS ?hybrid2)  
    BIND(COALESCE(?hybrid1,?hybrid2) AS ?hybrid)
    BIND(COALESCE(?hybrid1Label,?hybrid2Label) AS ?hl)
    ?anchor wdt:P12 wd:Q6679.
    ?anchor wdt:P10 ?charnumber.
    ?annotationZ wdt:P19 ?anchorZ.
    ?anchorZ wdt:P7 wd:Q6;
             wdt:P12 wd:Q6679;
             wdt:P10 ?length.
   BIND (floor(50*?charnumber/?length) AS ?quantile)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
 GROUP BY ?quantile
 ORDER BY ASC(?quantile)

Try it!

Filtered co-occurrence[edit]

This is Wikidata Query Service SPARQL, unlike others on the page, and so can be run from here. Needs debugging.

#Co-occurrence of ScienceSource annotations with known Wikidata drug-disease treatment pairs filtered out.
PREFIX ss: <>
PREFIX sst: <>

SELECT ?drugann ?drug ?diseaseann ?disease ?articletitle ?articledate
  {      ?diseaseann sst:P2 ?wdcode1;
                     sst:P15 ?disease;
                     sst:P16 "infectiousdiseases";
                     sst:P19 ?anchor1.
         ?drugann sst:P2 ?wdcode2;
                  sst:P15 ?drug;
                  sst:P16 "infectiousdiseasesdrugs";
                  sst:P19 ?anchor2.       
         ?anchor1 sst:P10 ?charnumber1.
         ?anchor2 sst:P10 ?charnumber2.
         ?anchor1 sst:P12 ?article.
         ?anchor2 sst:P12 ?article.
         ?article sst:P17 ?articledate.
         ?article sst:P20 ?articletitle.
         FILTER (abs(?charnumber2 - ?charnumber1) < 200)
   ?item1 wdt:P31 wd:Q12136.
   FILTER(str(?item1) = CONCAT("", ?wdcode1))
   ?item2 wdt:P31 wd:Q11173.
   FILTER(str(?item2) = CONCAT("", ?wdcode2))
   MINUS {?item2 wdt:P2175 ?item1}

Try it!

Crossmatching Wikidata items (on focus list) to SS article items[edit]

This is WDQS SPARQL, can be run from this page.

#Filtering query to select articles from the focus list
#From PLOS NTD and with PMC ID, main subject "infectious disease" or part of

PREFIX ss: <>
PREFIX sst: <>
SELECT DISTINCT ?item ?stritem ?articleitem ?itemLabel ?pmcid ?journalLabel ?title ?date ?licenseLabel ?mainsubjectLabel
        SERVICE <>
       { ?articleitem sst:P3 ss:Q4;
            sst:P2 ?stritem. }
          ?item wdt:P31 wd:Q13442814 .
          ?item wdt:P5008 wd:Q55439927 .
          ?item wdt:P932 ?pmcid .
          ?item wdt:P1433 wd:Q3359737.
          ?item wdt:P1433 ?journal .
          ?item wdt:P1476 ?title .
          ?item wdt:P577 ?date .
          ?item wdt:P275 ?license .
          ?item wdt:P921 ?mainsubject .
          ?mainsubject wdt:P361* wd:Q18123741 .
          BIND(substr(str(?item),32,39) AS ?stritem) .
        SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

Try it!

Improved version of the same idea.

#Filtering query to select articles from the focus list not on the ScienceSource wiki

PREFIX ss: <>
PREFIX sst: <>
SELECT DISTINCT ?item ?itemLabel
          ?item wdt:P5008 wd:Q55439927 ;
                wdt:P921 ?mainsubject .
          ?mainsubject wdt:P1995 wd:Q327657 .
       MINUS { SERVICE <>
       { ?articleitem sst:P3 ss:Q4;
            sst:P2 ?stritem. }

          BIND(substr(str(?item),32,39) AS ?stritem) .}
        SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

Try it!

Filtered co-occurrence (doesn't yet work)[edit]

#Infectious diseases, related drugs, filtered co-occurrence

PREFIX ss: <>
PREFIX sst: <>       
SELECT ?item1 ?item2 ?str1 ?str2 
  ?item1 wdt:P31 wd:Q12136;
        wdt:P1995 ?medspec.
  ?medspec wdt:P361* wd:Q788926 .
  ?item2 wdt:P31 wd:Q12140;
         wdt:P2175 ?condition.
  ?condition wdt:P1995 wd:Q788926.
  MINUS {?item2 wdt:P2175 ?item1}.
  BIND(substr(str(?item1),32) AS ?str1) .
  BIND(substr(str(?item2),32) AS ?str2) .
       {?annotation1 sst:P16 "infectiousdiseases";
                     sst:P2 ?str1;
                     sst:P3 ss:Q5.
        ?annotation2 sst:P16 "infectiousdiseasesdrugs";
                     sst:P2 ?str2;
                     sst:P3 ss:Q5.
       ?annotation1 sst:P19 ?anchor1.
        ?annotation2 sst:P19 ?anchor2.
        ?anchor1 sst:P12 ?article;
                 sst:P3 ss:Q2.
        ?anchor2 sst:P12 ?article;
                 sst:P3 ss:Q2.
        ?article sst:P3 ss:Q4.
        ?anchor1 sst:P10 ?charnumber1.
        ?anchor2 sst:P10 ?charnumber2.
        FILTER (?charnumber2 - ?charnumber1 = 100)

Try it!

SS disease list[edit]

This is a finder query for missing medical condition treated (P2175) statements here. A VALUES query with a long list, it could in principle be a federated query, but there is a performance issue to overcome.

#Diseases with MeSH ID where there is no drug treatment, and ScienceSource has annotations
SELECT DISTINCT ?item ?label
  WHERE {?item wdt:P31 wd:Q12136;
               rdfs:label ?label;
               wdt:P486 ?mesh.
         FILTER(STRSTARTS(?mesh, 'D'))
         MINUS {?drug wdt:P2175 ?item}
         VALUES ?term {
"abdominal aortic aneurysm"
"Acanthamoeba keratitis"
"acrodermatitis enteropathica"
"ACTH-secreting pituitary adenoma"
"acute hemorrhagic conjunctivitis"
"acute intermittent porphyria"
"acute kidney injury"
"acute porphyria"
"acute thyroiditis"
"Addison's disease"
"Adenovirus infection"
"adiposis dolorosa"
"adrenal adenoma"
"adrenal cortical adenoma"
"adrenal gland disease"
"adrenal insufficiency"
"adult respiratory distress syndrome"
"African histoplasmosis"
"African horse sickness"
"African tick-bite fever"
"age related macular degeneration"
"AIDS-related complex"
"airway obstruction"
"Albright's hereditary osteodystrophy"
"Alexander disease"
"allergic asthma"
"allergic bronchopulmonary aspergillosis"
"alpha 1-antitrypsin deficiency"
"Alstrom syndrome"
"alveolar echinococcosis"
"American histoplasmosis"
"amoebic dysentery"
"amyloid neuropathy"
"anaerobic pneumonia"
"androgen insensitivity syndrome"
"angle-closure glaucoma"
"ankylosing spondylitis"
"anterior uveitis"
"aortic aneurysm"
"apparent mineralocorticoid excess"
"Argentine hemorrhagic fever"
"argininosuccinic aciduria"
"aspiration pneumonia"
"aspiration pneumonitis"
"aspirin-induced asthma"
"asymptomatic neurosyphilis"
"atheroembolic renal disease"
"autoimmune disease"
"autoimmune polyendocrine syndrome"
"autoimmune polyendocrine syndrome type 1"
"autoimmune thyroiditis"
"autosomal dominant optic atrophy"
"avian influenza"
"avian sarcoma"
"bacillary angiomatosis"
"bacillus anthracis"
"bacterial conjunctivitis"
"bacterial infectious disease"
"bacterial pneumonia"
"band keratopathy"
"Barth syndrome"
"biotinidase deficiency"
"bird fancier's lung"
"blackwater fever"
"Bolivian hemorrhagic fever"
"bone disease"
"borderline leprosy"
"Borna disease"
"bronchiolitis obliterans"
"bubonic plague"
"bulbar polio"
"bullous emphysema"
"bullous keratopathy"
"Buruli ulcer disease"
"Canavan disease"
"carbohydrate metabolic disorder"
"cardiovascular syphilis"
"Carrion's disease"
"cat-scratch disease"
"central retinal vein occlusion"
"cercarial dermatitis"
"cerebral malaria"
"cerebrotendinous xanthomatosis"
"Chagas disease"
"Chediak-Higashi syndrome"
"chemical pneumonitis"
"childhood obesity"
"chlamydia infection"
"cholesterol ester storage disease"
"chronic kidney disease"
"Chronic mucocutaneous candidiasis"
"chronic obstructive pulmonary disease"
"chronic progressive external ophthalmoplegia"
"Chronic recurrent multifocal osteomyelitis"
"chronic rhinitis"
"Clostridium difficile colitis"
"collagenous sprue"
"Colorado tick fever"
"Complete androgen insensitivity syndrome"
"complications of diabetes mellitus"
"conductive hearing loss"
"cone dystrophy"
"congenital adrenal hyperplasia"
"congenital disorder of glycosylation"
"congenital generalized lipodystrophy"
"congenital hypothyroidism"
"congenital syphilis"
"congenital toxoplasmosis"
"connective tissue disease"
"Contrast-induced nephropathy"
"corneal endothelial cell loss"
"corneal neovascularization"
"corneal perforation"
"corneal ulcer"
"cortical deafness"
"Crimean-Congo hemorrhagic fever"
"cryptogenic organizing pneumonia"
"Cushing's syndrome"
"cutaneous anthrax"
"cutaneous candidiasis"
"Cutaneous larva migrans"
"cutaneous leishmaniasis"
"cutaneous lupus erythematosus"
"cystic echinococcosis"
"cystoid macular edema"
"D-bifunctional protein deficiency"
"Danon disease"
"dengue fever"
"dengue hemorrhagic fever"
"desquamative interstitial pneumonia"
"diabetes insipidus"
"diabetes mellitus"
"diabetic angiopathy"
"diabetic autonomic neuropathy"
"diabetic foot"
"diabetic ketoacidosis"
"diabetic neuropathy"
"diabetic retinopathy"
"Donohue syndrome"
"Duane retraction syndrome"
"early yaws"
"Eastern equine encephalitis"
"Ebola virus disease"
"empty sella syndrome"
"endemic goiter"
"endemic typhus"
"endometrial carcinoma"
"eosinophilic pneumonia"
"epidemic typhus"
"erythema infectiosum"
"erythropoietic protoporphyria"
"esophageal candidiasis"
"estrogen excess"
"euthyroid sick syndrome"
"exfoliation syndrome"
"experimental diabetes mellitus"
"exudative vitreoretinopathy"
"Fabry disease"
"familial combined hyperlipidemia"
"familial dysbetalipoproteinemia"
"familial hypercholesterolemia"
"familial hyperlipidemia"
"familial hypocalciuric hypercalcemia"
"Familial partial lipodystrophy"
"Fanconi syndrome"
"Farber lipogranulomatosis"
"farmer's lung"
"filarial elephantiasis"
"focal segmental glomerulosclerosis"
"folate deficiency"
"Frasier syndrome"
"fungal infection of the central nervous system"
"fungal infectious disease"
"fungal meningitis"
"gas gangrene"
"gastrointestinal anthrax"
"Gaucher's disease"
"genital herpes"
"Gerstmann-Straussler-Scheinker syndrome"
"Gitelman syndrome"
"glucocorticoid-remediable aldosteronism"
"glucose intolerance"
"glucose metabolism disease"
"glutaric aciduria type 1"
"glycogen storage disease"
"GM2 gangliosidosis"
"gonadal disease"
"gram-negative bacterial infection"
"granulomatous amebic encephalitis"
"granulosa cell tumor"
"Graves' disease"
"hand, foot and mouth disease"
"hantavirus pulmonary syndrome"
"Hartnup disease"
"Haverhill fever"
"hemorrhagic fever with renal syndrome"
"hepatic tuberculosis"
"hepatitis A"
"hepatitis B"
"hepatitis C"
"hepatitis D"
"hepatitis E"
"hereditary coproporphyria"
"Hermansky-Pudlak syndrome"
"herpes simplex"
"herpes zoster"
"HIV seropositivity"
"HIV-associated lipodystrophy"
"hospital-acquired infection"
"human granulocytic anaplasmosis"
"human monocytic ehrlichiosis"
"hyperlucent lung"
"hyperphosphatemic familial tumoral calcinosis"
"hypervitaminosis D"
"hypophosphatemic rickets"
"idiopathic pulmonary fibrosis"
"inclusion conjunctivitis"
"indeterminate leprosy"
"infectious disease"
"infectious mononucleosis"
"inhalation anthrax"
"inner ear disease"
"insulin coma"
"intermediate uveitis"
"interstitial lung disease"
"interstitial nephritis"
"intestinal infectious disease"
"intestinal schistosomiasis"
"intestinal tuberculosis"
"invasive aspergillosis"
"invasive pulmonary aspergillosis"
"iris disease"
"isovaleric acidemia"
"Japanese encephalitis"
"joint effusion"
"juvenile neuronal ceroid lipofuscinosis"
"juvenile rheumatoid arthritis"
"Kallmann syndrome"
"Kartagener syndrome"
"keratoconjunctivitis sicca"
"Keshan disease"
"kidney failure"
"Krabbe disease"
"Kyasanur forest disease"
"La Crosse encephalitis"
"lactic acidosis"
"lactose intolerance"
"Laron syndrome"
"Lassa fever"
"late yaws"
"latent syphilis"
"Leber congenital amaurosis"
"Leber hereditary optic neuropathy"
"lepromatous leprosy"
"Leydig cell tumor"
"Li-Fraumeni syndrome"
"lice infestation"
"lipid metabolism disorder"
"lipid storage disease"
"louping ill"
"louse-borne relapsing fever"
"lumbar spinal stenosis"
"lung abscess"
"lung disease"
"lung tumor"
"lupus nephritis"
"Lyme disease"
"lymph node tuberculosis"
"lymphatic abnormality"
"lymphocytic choriomeningitis"
"lymphogranuloma venereum"
"lysinuric protein intolerance"
"lysosomal storage disease"
"macular degeneration"
"macular holes"
"malignant Leydig cell tumor"
"maple syrup urine disease"
"Marburg virus disease"
"maturity-onset diabetes of the young"
"mediastinal cyst"
"Meesmann corneal dystrophy"
"membranous glomerulonephritis"
"meningococcal meningitis"
"Menkes disease"
"metabolic acidosis"
"metabolic bone disease"
"metabolic syndrome"
"metachromatic leukodystrophy"
"methylmalonic acidemia"
"mevalonic aciduria"
"miliary tuberculosis"
"mitochondrial disease"
"mitochondrial encephalomyopathy"
"mixed connective tissue disease"
"mixed hyperlipidemia"
"mixed malaria"
"molluscum contagiosum"
"mucocutaneous leishmaniasis"
"Mucolipidosis type IV"
"mucopolysaccharidosis I"
"multibacillary leprosy"
"multidrug-resistant tuberculosis"
"multiple acyl-CoA dehydrogenase deficiency"
"multiple carboxylase deficiency"
"multiple endocrine neoplasia"
"multiple symmetric lipomatosis"
"Murray Valley encephalitis"
"Mycoplasma pneumonia"
"Mycoplasma pneumoniae pneumonia"
"necrotizing fasciitis"
"necrotizing ulcerative gingivitis"
"Nelson syndrome"
"neovascular glaucoma"
"nephrogenic diabetes insipidus"
"nephropathia epidemica"
"nephrotic syndrome"
"neuroendocrine tumor"
"neurohypophyseal diabetes insipidus"
"neuronal ceroid lipofuscinosis"
"Newcastle disease"
"Niemann-Pick disease"
"Niemann-Pick disease type B"
"night blindness"
"Nijmegen breakage syndrome"
"nodular goiter"
"obstructive lung disease"
"Occipital horn syndrome"
"ocular albinism"
"ocular hypertension"
"oculocerebrorenal syndrome"
"oculocutaneous albinism"
"oculoglandular tularemia"
"Omsk hemorrhagic fever"
"open-angle glaucoma"
"Opportunistic infection"
"opportunistic mycosis"
"optic nerve disease"
"optic neuritis"
"oral candidiasis"
"oral tuberculosis"
"orbital cellulitis"
"orbital myositis"
"Oropouche fever"
"osteitis fibrosa"
"osteochondritis dissecans"
"otitis media"
"ovarian dysfunction"
"parasitic infectious diseases"
"parasitic skin disease"
"parathyroid gland disease"
"paratyphoid fever"
"pathologic fracture"
"paucibacillary leprosy"
"Pelizaeus-Merzbacher disease"
"pericardial tuberculosis"
"peripheral artery disease"
"peroxisomal disease"
"pituitary apoplexy"
"pituitary carcinoma"
"pityriasis versicolor"
"plantar wart"
"Plasmodium falciparum malaria"
"Plasmodium malariae malaria"
"Plasmodium ovale malaria"
"Plasmodium vivax malaria"
"pleural tuberculosis"
"pneumococcal pneumonia"
"pneumonic plague"
"pneumonic tularemia"
"polyarteritis nodosa"
"polycystic ovary syndrome"
"polymyalgia rheumatica"
"Pontiac fever"
"porphyria cutanea tarda"
"posterior uveitis"
"Powassan encephalitis"
"Precocious puberty"
"premature menopause"
"premature ovarian failure"
"primary amebic meningoencephalitis"
"primary ciliary dyskinesia"
"primary congenital glaucoma"
"primary effusion lymphoma"
"primary hyperoxaluria"
"primary hyperparathyroidism"
"primary syphilis"
"proliferative vitreoretinopathy"
"propionic acidemia"
"protein-energy malnutrition"
"psoriatic arthritis"
"pulmonary alveolar proteinosis"
"pulmonary cryptococcosis"
"pulmonary cyst"
"pulmonary edema"
"pulmonary embolism"
"pulmonary emphysema"
"pulmonary eosinophilia"
"pulmonary fibrosis"
"pulmonary sarcoidosis"
"pulmonary tuberculosis"
"Q fever"
"Reflux nephropathy"
"refractive error"
"renal glycosuria"
"renal osteodystrophy"
"renal tuberculosis"
"renal tubular acidosis"
"renovascular hypertension"
"respiratory failure"
"retinal degeneration"
"retinal detachment"
"retinal disease"
"retinal vascular occlusion"
"retinal vein occlusion"
"retinitis pigmentosa"
"retinopathy of prematurity"
"rheumatoid arthritis"
"Rift Valley fever"
"Rocky Mountain spotted fever"
"Ross River fever"
"rubeosis iridis"
"Sandhoff disease"
"Sanfilippo syndrome"
"scarlet fever"
"scrub typhus"
"secondary hyperparathyroidism"
"secondary syphilis"
"sensorineural hearing loss"
"septic arthritis"
"septic shock"
"Sertoli-Leydig cell tumor"
"Siberian tick typhus"
"Sjögren's syndrome"
"skeletal tuberculosis"
"sleep disorder"
"sleep paralysis"
"sleeping sickness"
"Sly syndrome"
"spinal stenosis"
"spirochetal diseases"
"splenic tuberculosis"
"spotted fever"
"St. Louis encephalitis"
"staphylococcal skin infection"
"subacute sclerosing panencephalitis"
"subacute thyroiditis"
"suppurative thyroiditis"
"sweating sickness"
"swine influenza"
"sympathetic ophthalmia"
"systemic lupus erythematosus"
"T-cell lymphoma"
"tabes dorsalis"
"Tangier disease"
"tapeworm infection"
"Tay-Sachs disease"
"Tay-Sachs disease AB variant"
"tertiary neurosyphilis"
"tertiary syphilis"
"thoracic disease"
"thyroid carcinoma"
"thyroid crisis"
"thyroid gland disease"
"thyroid hormone resistance syndrome"
"tick infestation"
"tick-borne encephalitis"
"tick-borne relapsing fever"
"tinea barbae"
"tinea capitis"
"tinea corporis"
"tinea cruris"
"tinea favosa"
"tinea manuum"
"tinea nigra"
"tinea pedis"
"toxic shock syndrome"
"transmissible spongiform encephalopathy"
"traveler's diarrhea"
"trench fever"
"tuberculoid leprosy"
"tuberculous peritonitis"
"tuberculous salpingitis"
"type 1 diabetes mellitus"
"type 2 diabetes mellitus"
"typhoid fever"
"tyrosinemia type I"
"ulceroglandular tularemia"
"urea cycle disorder"
"urinary schistosomiasis"
"variant Creutzfeldt–Jakob"
"variegate porphyria"
"variola major"
"vascular calcification"
"vascular disease"
"Venezuelan equine encephalitis"
"ventilator-associated pneumonia"
"vestibular disease"
"vestibular neuronitis"
"viral encephalitis"
"viral hepatitis"
"viral infectious disease"
"viral pneumonia"
"visceral leishmaniasis"
"vitamin B12 deficiency"
"vitamin K deficiency"
"vitreous detachment"
"Vitreous hemorrhage"
"WAGR syndrome"
"Werner syndrome"
"West Nile encephalitis"
"West Nile fever"
"Western equine encephalitis"
"Wilson disease"
"Wolman disease"
"X-linked adrenoleukodystrophy"
"X-linked hypophosphatemic rickets"
"yellow fever"
"Zika fever"
"Zollinger-Ellison syndrome"
         FILTER (lang(?label) = "en")
         FILTER (str(?label) = ?term)

Try it!

NDF-RT issue[edit]

See Wikidata talk:WikiProject Medicine#medical condition treated (P2175) matters for why NDF-RT (Q21008030) may no longer be a good reference.

#Locating P2175 statements referenced to the NDF-RT database
SELECT DISTINCT ?drug ?drugLabel ?disease ?diseaseLabel
  WHERE {?reference pr:P248 wd:Q21008030.
         ?statement prov:wasDerivedFrom ?reference.
         ?statement ps:P2175 ?disease.
         ?drug p:P2175 ?statement.
       SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

Try it!

Variant for a maintenance query:

#Locating "instance of review article" statements referenced to PubMed Central
         ?reference pr:P248 wd:Q229883.
         ?statement prov:wasDerivedFrom ?reference.
         ?statement ps:P31 wd:Q7318358.  
         SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

Try it!