Skip to content

openVirus: SPARQL queries of four core dictionaries

ShweataNHegde edited this page Jan 30, 2021 · 2 revisions

Restful URL of the dictionaries

Country

Created by Ambreen H.

SPARQL query:

## Select Query was used to retrieve specific results (Country name, wiki data number, Synonyms)
SELECT ?wikidata ?wikidataLabel (?code as ?_iso3166) ?wikipedia (?wikidataAltLabel as ?alt) ?synonym ?wikidataDescription  (?wikidataLabel as ?term) { 

## Forcing particular query execution order
  hint:Query hint:optimizer "None" . 

## all ISO countries 
  ?wikidata wdt:P297 ?code.

## Optional details about the countries like links to wikipaedia pages for each country to be presented in a seperate column
  OPTIONAL { ?wikipedia schema:about ?wikidata; schema:isPartOf <https://en.wikipedia.org/> }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en".

## Selecting the prefered label 
    ?wikidata skos:altLabel ?wikidataAltLabel ; rdfs:label ?wikidataLabel; schema:description  ?wikidataDescription          
  } 

## Making sure the RGI alphabets of the flags are not rendered as flags and they appear as simple alphabets by specifying the acceptable characters. 
  BIND (REPLACE(REPLACE(?wikidataAltLabel, "(, )?[🇦-🇿]{2}", ""), "^, ", "") AS ?synonym )
}

 ORDER BY (?wikidataLabel)

Country: Restful URL

Click here to run this query on the Wikidata query service.

Disease

Created by Lakshmi Devi Priya, Dheeraj Kumar.

SPARQL query:

SELECT DISTINCT ?wikidata ?wikidataLabel ?wikipedia ?wikidataAltLabel ?wikidataDescription ?hindi ?hindiLabel ?hindialtlabel ?hindiwikipedia ?tamil ?tamilLabel ?tamilaltlabel ?tamilwikipedia ?spanish ?spanishaltlabel ?spanishLabel ?pt ?ptLabel ?ptaltlabel ?kn ?knLabel ?knaltlabel ?de ?deLabel ?dealtlabel ?sa ?saLabel ?saaltlabel ?ml ?mlLabel ?mlaltlabel ?fr ?frLabel ?fraltlabel ?zh ?zhLabel ?zhaltlabel ?ICD_10 WHERE {
  ?wikidata wdt:P31/wdt:P279* wd:Q12136.
   OPTIONAL { ?wikipedia schema:about ?wikidata; schema:isPartOf <https://en.wikipedia.org/> }
   OPTIONAL { ?hindiwikipedia schema:about ?wikidata; schema:isPartOf <https://hi.wikipedia.org/> }
   OPTIONAL { ?tamilwikipedia schema:about ?wikidata; schema:isPartOf <https://ta.wikipedia.org/> }
   OPTIONAL { ?wikidata wdt:P494 ?ICD_10. }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en".

## Selecting the prefered label 
    ?wikidata skos:altLabel ?wikidataAltLabel ; rdfs:label ?wikidataLabel; schema:description  ?wikidataDescription          
  } 
   SERVICE wikibase:label {
    bd:serviceParam wikibase:language "hi".
## Selecting the prefered label
    ?wikidata skos:altLabel ?hindialtlabel .
    ?wikidata rdfs:label ?hindiLabel .
    ?wikidata schema:description ?hindi ;
  } 
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "ta".
## Selecting the prefered label
    ?wikidata skos:altLabel ?tamilaltlabel .
    ?wikidata rdfs:label ?tamilLabel .
    ?wikidata schema:description ?tamil ;
  } 
   SERVICE wikibase:label {
    bd:serviceParam wikibase:language "es".
## Selecting the prefered label
    ?wikidata skos:altLabel ?spanishaltlabel .
    ?wikidata rdfs:label ?spanishLabel .
    ?wikidata schema:description ?spanish ;
  } 
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "pt".
## Selecting the prefered label
    ?wikidata skos:altLabel ?ptaltlabel .
    ?wikidata rdfs:label ?ptLabel .
    ?wikidata schema:description ?pt ;
  } 
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "kn".
## Selecting the prefered label
    ?wikidata skos:altLabel ?knaltlabel .
    ?wikidata rdfs:label ?knLabel .
    ?wikidata schema:description ?kn ;
  } 
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "de".
## Selecting the prefered label
    ?wikidata skos:altLabel ?dealtlabel .
    ?wikidata rdfs:label ?deLabel .
    ?wikidata schema:description ?de ;
  } 
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "sa".
## Selecting the prefered label
    ?wikidata skos:altLabel ?saaltlabel .
    ?wikidata rdfs:label ?saLabel .
    ?wikidata schema:description ?sa ;
  } 
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "ml".
##  the prefered label
    ?wikidata skos:altLabel ?mlaltlabel .
    ?wikidata rdfs:label ?mlLabel .
    ?wikidata schema:description ?ml ;
  } 
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "fr".
## Selecting the prefered label
    ?wikidata skos:altLabel ?fraltlabel .
    ?wikidata rdfs:label ?frLabel .
    ?wikidata schema:description ?fr ;
  } 
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "zh".
## Selecting the prefered label
    ?wikidata skos:altLabel ?zhaltlabel .
    ?wikidata rdfs:label ?zhLabel .
    ?wikidata schema:description ?zh ;
  } 

}

Disease: Restful URL

Click here to run this query on the Wikidata query service.

Drug

Created by Pruthivrajan, Dheeraj Kumar

SPARQL query:

SELECT ?wikidata ?wikidataLabel ?wikipedia ?wikidataAltLabel ?wikidataDescription ?wikidataformule ?wikidatapicture ?hindi ?hindiLabel ?hindialtlabel ?hindiwikipedia ?tamil ?tamilLabel ?tamilaltlabel ?tamilwikipedia ?sanskrit ?sanskritLabel ?sanskritaltLabel ?sanskritwikipedia ?spanish ?spanishLabel ?spanishaltLabel ?spanishwikipedia ?urdu ?urduLabel ?urdualtLabel ?urduwikipedia  WHERE {
  ?wikidata wdt:P31 wd:Q12140;
    wdt:P274 ?wikidataformule;
    wdt:P117 ?wikidatapicture.
   OPTIONAL { ?wikipedia schema:about ?wikidata; schema:isPartOf <https://en.wikipedia.org/> }
   OPTIONAL { ?hindiwikipedia schema:about ?wikidata; schema:isPartOf <https://hi.wikipedia.org/> }
   OPTIONAL { ?tamilwikipedia schema:about ?wikidata; schema:isPartOf <https://ta.wikipedia.org/> }
  OPTIONAL { ?sanskritwikipedia schema:about ?wikidata; schema:isPartOf <https://sa.wikipedia.org/> }
  OPTIONAL { ?spanishwikipedia schema:about ?wikidata; schema:isPartOf <https://es.wikipedia.org/> }
  OPTIONAL { ?urduwikipedia schema:about ?wikidata; schema:isPartOf <https://ur.wikipedia.org/> }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en".

## Selecting the prefered label 
    ?wikidata skos:altLabel ?wikidataAltLabel ; rdfs:label ?wikidataLabel; schema:description  ?wikidataDescription          
  } 
   SERVICE wikibase:label {
    bd:serviceParam wikibase:language "hi".
## Selecting the prefered label
    ?wikidata skos:altLabel ?hindialtlabel .
    ?wikidata rdfs:label ?hindiLabel .
    ?wikidata schema:description ?hindi ;
  } 
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "ta".
## Selecting the prefered label
    ?wikidata skos:altLabel ?tamilaltlabel .
    ?wikidata rdfs:label ?tamilLabel .
    ?wikidata schema:description ?tamil ;
  } 
SERVICE wikibase:label {
    bd:serviceParam wikibase:language "sa".
## Selecting the prefered label
    ?wikidata skos:altLabel ?sanskritaltlabel .
    ?wikidata rdfs:label ?sanskritLabel .
    ?wikidata schema:description ?sanskrit ;
  } 
SERVICE wikibase:label {
    bd:serviceParam wikibase:language "es".
## Selecting the prefered label
    ?wikidata skos:altLabel ?spanishaltlabel .
    ?wikidata rdfs:label ?spanishLabel .
    ?wikidata schema:description ?spanish ;
  } 
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "ur".
## Selecting the prefered label
    ?wikidata skos:altLabel ?urdualtlabel .
    ?wikidata rdfs:label ?urduLabel .
    ?wikidata schema:description ?urdu ;
  } 
}

Drug: Restful URL

Click here to run this query on the Wikidata query service.

Organization

Created by Vaishali Arora, Shweata N. Hegde and Dheeraj Kumar

SPARQL query:

#Funders
 SELECT DISTINCT ?Funder ?FunderLabel ?FunderDescription ?FunderAltLabel ?Country ?CountryLabel ?instanceofLabel ?crossrefid ?wikipedia WHERE {
   ?Funder wdt:P3153 ?crossrefid;
     wdt:P31 ?instanceof;
     wdt:P17 ?Country.
   OPTIONAL { ?wikipedia schema:about ?Funder; schema:isPartOf <https://en.wikipedia.org/> }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
 }
 LIMIT 20000000

Organization: Restful URL

  • Click here to run this query on the Wikidata query service.
  • Refined Organization SPARQL query. Click, here.
Clone this wiki locally