Wikidata:WikiProject COVID-19/Queries/SPARQL Study

From Wikidata
Jump to navigation Jump to search

SPARQL is a query language and protocol that allows you to find, add, modify or delete RDF data available across the Internet. Currently, SPARQL can be used to query Wikidata thanks to the query service available at https://query.wikidata.org. This page introduces several SPARQL queries to visualize various aspects of COVID-19 information including clinical and biological knowledge, epidemiological data, metadata of research outputs, online resources and social impacts. Throughout this Wikidata page, COVID stands to any subset of the collection of the three main Wikidata items related to the COVID-19 pandemic: COVID-19 (Q84263196), SARS-CoV-2 (Q82069695), and COVID-19 pandemic (Q81068910).

These queries have been developed to analyze the landscape of the COVID-19 knowledge in Wikidata and show it in Representing COVID-19 information in collaborative knowledge graphs: a study of Wikidata (Turki, et al., 2020).

Data Model[edit]

Classes and properties linked to COVID-19 as an object[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID
    SELECT ?p ?proplabel ?c ?classlabel (COUNT(*) AS ?count) WHERE {
      ?x ?prop wd:Q84263196.
      ?x wdt:P31 ?c.
      ?c rdfs:label ?classlabel.
      FILTER(LANG(?classlabel)="en")
      ?p wikibase:directClaim ?prop.
      ?p rdfs:label ?proplabel.
      FILTER(LANG(?proplabel)="en")
      }
    GROUP BY ?p ?proplabel ?c ?classlabel
    ORDER BY DESC(?count)
    

Classes and properties linked to SARS-CoV-2 as an object[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID
    SELECT ?p ?proplabel ?c ?classlabel (COUNT(*) AS ?count) WHERE {
      ?x ?prop wd:Q82069695.
      ?x wdt:P31 ?c.
      ?c rdfs:label ?classlabel.
      FILTER(LANG(?classlabel)="en")
      ?p wikibase:directClaim ?prop.
      ?p rdfs:label ?proplabel.
      FILTER(LANG(?proplabel)="en")
      }
    GROUP BY ?p ?proplabel ?c ?classlabel
    ORDER BY DESC(?count)
    

Classes and properties linked to the COVID-19 pandemic as an object[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID
    SELECT ?p ?proplabel ?c ?classlabel (COUNT(*) AS ?count) WHERE {
      ?x ?prop wd:Q81068910.
      ?x wdt:P31 ?c.
      ?c rdfs:label ?classlabel.
      FILTER(LANG(?classlabel)="en")
      ?p wikibase:directClaim ?prop.
      ?p rdfs:label ?proplabel.
      FILTER(LANG(?proplabel)="en")
      }
    GROUP BY ?p ?proplabel ?c ?classlabel
    ORDER BY DESC(?count)
    

Classes and properties linked to COVID-19 as a subject[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID
    SELECT ?p ?proplabel ?c ?classlabel (COUNT(*) AS ?count) WHERE {
      wd:Q84263196 ?prop ?x.
      ?x wdt:P31 ?c.
      ?c rdfs:label ?classlabel.
      FILTER(LANG(?classlabel)="en")
      ?p wikibase:directClaim ?prop.
      ?p rdfs:label ?proplabel.
      FILTER(LANG(?proplabel)="en")
      }
    GROUP BY ?p ?proplabel ?c ?classlabel
    ORDER BY DESC(?count)
    

Classes and properties linked to SARS-CoV-2 as a subject[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID
    SELECT ?p ?proplabel ?c ?classlabel (COUNT(*) AS ?count) WHERE {
      wd:Q82069695 ?prop ?x.
      ?x wdt:P31 ?c.
      ?c rdfs:label ?classlabel.
      FILTER(LANG(?classlabel)="en")
      ?p wikibase:directClaim ?prop.
      ?p rdfs:label ?proplabel.
      FILTER(LANG(?proplabel)="en")
      }
    GROUP BY ?p ?proplabel ?c ?classlabel
    ORDER BY DESC(?count)
    

Classes and properties linked to the COVID-19 pandemic as a subject[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID
    SELECT ?p ?proplabel ?c ?classlabel (COUNT(*) AS ?count) WHERE {
      wd:Q81068910 ?prop ?x.
      ?x wdt:P31 ?c.
      ?c rdfs:label ?classlabel.
      FILTER(LANG(?classlabel)="en")
      ?p wikibase:directClaim ?prop.
      ?p rdfs:label ?proplabel.
      FILTER(LANG(?proplabel)="en")
      }
    GROUP BY ?p ?proplabel ?c ?classlabel
    ORDER BY DESC(?count)
    

Language Representation[edit]

Language Representation of the subjects of the semantic relations having COVID as an object[edit]

The following query uses these:

Language Representation of the predicates of the semantic relations having COVID as an object[edit]

The following query uses these:

Language Representation of the objects of the semantic relations having COVID as a subject[edit]

The following query uses these:

Language Representation of the predicates of the semantic relations having COVID as a subject[edit]

The following query uses these:

Representation of diseases in language editions of Wikipedia[edit]

The following query uses these:

  • Properties: Disease Ontology ID (P699)  View with Reasonator View with SQID, instance of (P31)  View with Reasonator View with SQID, subclass of (P279)  View with Reasonator View with SQID
    SELECT ?language (COUNT (?page) AS ?count) 
    WITH {
      SELECT DISTINCT ?item WHERE {
        { ?item wdt:P699 ?DO_ID .}
        UNION
        { ?item wdt:P31*/wdt:P279* wd:Q11190 }
        UNION  {
          ?item wdt:P31*/wdt:P279* wd:Q12136 .
        }
        UNION {
          ?item wdt:P31*/wdt:P279* wd:Q796194 .
        }
        UNION {
          ?item wdt:P31*/wdt:P279* wd:Q12140 .
        }
      }
      LIMIT 100000
    }
    AS %items
    WHERE {
      INCLUDE %items
      ?wikipedia wikibase:wikiGroup "wikipedia".
      ?page  	schema:about ?item ;
    			schema:isPartOf ?wikipedia .
      ?page schema:inLanguage ?language
    }
    GROUP BY ?language
    ORDER BY DESC(?count)
    

Language Representation of medical items in Wikidata[edit]

The following query uses these:

  • Properties: Disease Ontology ID (P699)  View with Reasonator View with SQID, MeSH descriptor ID (P486)  View with Reasonator View with SQID, instance of (P31)  View with Reasonator View with SQID, subclass of (P279)  View with Reasonator View with SQID
    SELECT ?language (COUNT (?label) AS ?count) 
    WITH {
      SELECT DISTINCT ?item WHERE {
        { ?item wdt:P699 ?DO_ID .}
        UNION
        { ?item wdt:P486 ?MeSH_Descriptor_ID .}
        UNION
        { ?item wdt:P31*/wdt:P279* wd:Q11190 }
        UNION  {
          ?item wdt:P31*/wdt:P279* wd:Q12136 .
        }
        UNION {
          ?item wdt:P31*/wdt:P279* wd:Q796194 .
        }
        UNION {
          ?item wdt:P31*/wdt:P279* wd:Q12140 .
        }
      }
      LIMIT 100000
    }
    AS %items
    WHERE {
      INCLUDE %items
      ?item rdfs:label ?label.
      BIND(LANG(?label) AS ?language)
    }
    GROUP BY ?language
    ORDER BY DESC(?count)
    

Language Representation of COVID-19-related items in Wikidata[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID
    SELECT ?language (COUNT (?label) AS ?count) 
    WITH {
    SELECT DISTINCT ?item ?itemLabel ?property ?propertyLabel ?claim WHERE {
      VALUES ?COVID { wd:Q81068910 wd:Q84263196 wd:Q82069695 } 
      { ?COVID ?predicate1 ?item . }
      UNION
      { ?item ?predicate2 ?COVID . } 
      FILTER NOT EXISTS {?item wdt:P31 wd:Q5 . }
      FILTER NOT EXISTS {?item wdt:P31 wd:Q13442814 . }
    }  LIMIT 100000
    }
    AS %items
    WHERE {
      INCLUDE %items
      ?item rdfs:label ?label.
      BIND(LANG(?label) AS ?language)
    }
    GROUP BY ?language
    ORDER BY DESC(?count)
    

Representation of COVID-19-related items in language editions of Wikipedia[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID
    SELECT ?language (COUNT (?page) AS ?count) 
    WITH {
    SELECT DISTINCT ?item ?itemLabel ?property ?propertyLabel ?claim WHERE {
      VALUES ?COVID { wd:Q81068910 wd:Q84263196 wd:Q82069695 } 
      { ?COVID ?predicate1 ?item . }
      UNION
      { ?item ?predicate2 ?COVID . } 
      FILTER NOT EXISTS {?item wdt:P31 wd:Q5 . }
      FILTER NOT EXISTS {?item wdt:P31 wd:Q13442814 . }
    }  LIMIT 100000
    }
    AS %items
    WHERE {
      INCLUDE %items
      ?wikipedia wikibase:wikiGroup "wikipedia".
      ?page  	schema:about ?item ;
    			schema:isPartOf ?wikipedia .
      ?page schema:inLanguage ?language
    }
    GROUP BY ?language
    ORDER BY DESC(?count)
    

Database alignment for COVID-19-related items[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID
    SELECT ?class ?classLabel ?ExternalID ?ExternalIDLabel (COUNT(*) AS ?count) WITH
    {
    SELECT DISTINCT ?x WHERE {
        VALUES ?c {wd:Q84263196 wd:Q81068910 wd:Q82069695}
        {?c ?p ?x} UNION {?x ?p ?c}
      }
    }
    AS %items
    WHERE {
      INCLUDE %items.
      ?x wdt:P31 ?class.
      ?x ?p1 ?y.
      ?ExternalID wikibase:directClaim ?p1.
      ?ExternalID wikibase:propertyType wikibase:ExternalId.
      ?class rdfs:label ?classLabel.
      FILTER(LANG(?classLabel)="en")
      ?ExternalID rdfs:label ?ExternalIDLabel.
      FILTER(LANG(?ExternalIDLabel)="en")
    }
    GROUP BY ?class ?classLabel ?ExternalID ?ExternalIDLabel
    ORDER BY DESC(?count)
    

Visualizing facets of COVID-19 via SPARQL[edit]

SARS-CoV-2 interactions with the human proteome[edit]

The following query uses these:

Currently listed symptoms of COVID-19, with qualifiers indicating their frequency[edit]

The following query uses these:

Features: Graph (Q24515287)  View with Reasonator View with SQID

#defaultView:Graph
SELECT ?item ?itemLabel ?pic ?linkTo
WHERE
{
  SERVICE gas:service {
    gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.SSSP" ;
                gas:in wd:Q84263196;
                gas:out ?item ;
                gas:out1 ?depth ;
                gas:maxIterations 3 ;
                gas:linkType wdt:P780 .
  }
  OPTIONAL { ?item wdt:P780 ?linkTo }
  OPTIONAL { ?item wdt:P18 ?pic }
  SERVICE wikibase:label {bd:serviceParam wikibase:language "en" }
}

Other medical conditions sorted by the number of shared symptoms with COVID-19[edit]

The following query uses these:

  • Properties: symptoms and signs (P780)  View with Reasonator View with SQID
    SELECT
          ?disease ?diseaseLabel (COUNT(?symptom) AS ?symptom_count) (GROUP_CONCAT(?symptom_label; separator=" // ") AS ?symptoms) 
    WHERE
    {
          wd:Q84263196 wdt:P780 ?symptom .
          ?disease wdt:P780 ?symptom . 
          FILTER (wd:Q84263196 != ?disease)
          ?symptom rdfs:label ?symptom_label . FILTER(lang(?symptom_label) = "en")
          SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
    }
    GROUP BY ?disease ?diseaseLabel
    ORDER BY DESC(?symptom_count)
    

Correlation between the current number of cases and mortality rates in every country, calculated from numeric summary data for each region[edit]

The following query uses these:

  • Properties: part of (P361)  View with Reasonator View with SQID, location (P276)  View with Reasonator View with SQID, case fatality rate (P3457)  View with Reasonator View with SQID, number of cases (P1603)  View with Reasonator View with SQID, point in time (P585)  View with Reasonator View with SQID
    #defaultView:BarChart
    SELECT ?cases ?mortality_rate ?country WITH {
    SELECT ?x (MAX(?d) AS ?date) WHERE {
      ?x p:P3457 [ps:P3457 ?m; pq:P585 ?d].
      ?x wdt:P361 wd:Q83741704.
    }
    GROUP BY ?x
    }
    AS %dates
    WHERE {
      INCLUDE %dates.
      ?x p:P1603 [ps:P1603 ?cases; pq:P585 ?date].
      ?x p:P3457 [ps:P3457 ?mortality_rate; pq:P585 ?date].
      FILTER(?cases < 50000)
      FILTER(?mortality_rate < 1)
      ?x wdt:P276 ?c.
      ?c rdfs:label ?country.
      FILTER(LANG(?country)="en")
    }
    

Age distribution of notable persons who have died of COVID-19[edit]

The following query uses these:

  • Properties: cause of death (P509)  View with Reasonator View with SQID, instance of (P31)  View with Reasonator View with SQID, date of death (P570)  View with Reasonator View with SQID, date of birth (P569)  View with Reasonator View with SQID
    #defaultView:LineChart
    SELECT ?age (COUNT(?person) AS ?count) WHERE {
    {
    SELECT ?person (SAMPLE(?age) AS ?age)  WHERE {
        ?person wdt:P509 wd:Q84263196 ; wdt:P31 wd:Q5 
        OPTIONAL { ?person wdt:P570 ?d }
        ?person wdt:P569 ?dob ; wdt:P570 ?dod . BIND(YEAR(?dod)-YEAR(?dob) as ?age) 
      
       SERVICE wikibase:label {
        bd:serviceParam wikibase:language "en" .
       }
     }
    GROUP BY ?person
    }
    }
    GROUP BY ?age
    

Death age distribution for people who were born after 1901[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID, date of death (P570)  View with Reasonator View with SQID, date of birth (P569)  View with Reasonator View with SQID
    #defaultView:LineChart
    SELECT ?age (COUNT(?person) AS ?count) WITH
    {
      SELECT DISTINCT * WHERE {
        ?person wdt:P31 wd:Q5.
        ?person wdt:P570 ?dod.
        ?person wdt:P569 ?dob.
        FILTER(YEAR(?dod) > 1900)
        FILTER(?dod > ?dob)
        }
      LIMIT 100000
      }
    AS %d
    WHERE {
      INCLUDE %d.
      BIND(YEAR(?dod)-YEAR(?dob) as ?age)
      FILTER(?age <= 120)
      }
    GROUP BY ?age
    ORDER BY DESC(?count)
    

Common words and word combinations (ngrams) in the titles of the COVID-19-related scholarly publications[edit]

The following query uses these:

Features: BubbleChart (Q24515280)  View with Reasonator View with SQID

#defaultView:BubbleChart
# Most frequent n-grams from a random set of 1000 COVID-19 publications
SELECT DISTINCT ?Ngram ?Score

WITH
{ # Generating a list of entities to be analyzed
  SELECT ?Publication
   { 
      SERVICE bd:sample { ?Publication wdt:P921 wd:Q84263196 . bd:serviceParam bd:sample.limit 1000 }   
   }
} AS %items 
WITH
{ # Preprocessing the titles
  SELECT ?Title ?Publication ?Seeds ?ClearTitleLength
   { 
      INCLUDE %items
      ?Publication wdt:P1476 ?Title.
      BIND (REPLACE(STR(?Title),"[\\.:,;\\[\\]\\?()$]","") AS ?ClearTitle) # remove some frequent special characters, including colons and semicolons
      BIND(STRLEN(?ClearTitle) AS ?ClearTitleLength) 
      FILTER(LANG(?Title)="en") 
      # Basic processing of the titles
      BIND ("::: ::: ::: ::: ::: ::: ::: ::: " AS ?StartCodon)
      BIND (" ;;; ;;; ;;; ;;; ;;; ;;; ;;; ;;;" AS ?StopCodon)
      BIND (LCASE(CONCAT(?StartCodon , # add start codon of colons to assist with processing of n-grams at beginning of title
                            ?ClearTitle, 
                            ?StopCodon)) # add stop codon of semicolons to assist with processing of n-grams at end of title
                     AS ?Seeds )
   }
} AS %titles 
WITH
{ # Generating a list of regexes to look for the NumericValue-th word in a string     
  # Based on https://w.wiki/KG$ by Jura1
  SELECT ?Regex1 ?Regex2 ?Regex3 ?Regex4 ?NumericValue 
    { 
      ?NumberItem wdt:P5176 []; wdt:P1181 ?NumericValue . 
      FILTER( ?NumericValue > 0 ) 
      FILTER( ?NumericValue < 151)
      BIND("^([^ ]+ ){" AS ?RegexStart)
      BIND("}([^ ]+) .*" AS ?RegexEnd)
      BIND( CONCAT( ?RegexStart , STR( ?NumericValue - 1 ), ?RegexEnd ) AS ?Regex1)
      BIND( CONCAT( ?RegexStart , STR( ?NumericValue + 1 ), ?RegexEnd ) AS ?Regex2) 
      BIND( CONCAT( ?RegexStart , STR( ?NumericValue + 3 ), ?RegexEnd ) AS ?Regex3) 
      BIND( CONCAT( ?RegexStart , STR( ?NumericValue + 5 ), ?RegexEnd ) AS ?Regex4) 
    }
} AS %regexes 
WITH
{ # Applying the regexes to the titles to extract ngrams (for n <= 8), and counting occurrences of the ngrams across titles
  SELECT 
    DISTINCT ?Ngram 
    (COUNT(DISTINCT ?Title) AS ?Count)
    ?Length
    (( ?Count * ?Length ) AS ?Score)
    (SAMPLE(DISTINCT ?Publication) AS ?ExamplePub)
      { 
        INCLUDE %regexes
        INCLUDE %titles
        BIND( 
          (CONCAT(
            REPLACE(?Seeds, ?Regex1, "$1"), " ", 
            REPLACE(?Seeds, ?Regex1, "$2"), " ", 
            REPLACE(?Seeds, ?Regex2, "$1"), " ", 
            REPLACE(?Seeds, ?Regex2, "$2"), " ", 
            REPLACE(?Seeds, ?Regex3, "$1"), " ", 
            REPLACE(?Seeds, ?Regex3, "$2"), " ", 
            REPLACE(?Seeds, ?Regex4, "$1"), " ", 
            REPLACE(?Seeds, ?Regex4, "$2")
          )
        ) AS ?NgramCandidate) 
                            
        BIND( 
          (REPLACE
           (REPLACE
            (REPLACE
             (REPLACE
              (STR(?NgramCandidate),"([;:])",""),
              "(^\\s+)",""),
             "(\\s+$)",""),
            "([ ]{2,})"," ")
          ) AS ?Ngram) 

        BIND(STRLEN(?Ngram) AS ?Length) 
        FILTER (?Length > 3 )  
        FILTER (?Length <= ?ClearTitleLength )  
      }
  GROUP BY ?Ngram ?Count ?Length ?Score ?ExamplePub
  HAVING(?Count > 4)
} AS %ngrams 
WHERE {
  INCLUDE %ngrams 
  # Exclude Ngrams starting or ending with any of a set of blacklisted words
  BIND("(a

Co-occurrence of research topics in scholarly publications with one of the COVID-related items as a topic[edit]

The following query uses these:

  • Properties: main subject (P921)  View with Reasonator View with SQID, publication date (P577)  View with Reasonator View with SQID, author (P50)  View with Reasonator View with SQID
    SELECT ?node1 ?node2 ?node1Label ?node2Label ?pdate ?topicLabel ?authorLabel (COUNT(?work) AS ?count)
    WHERE {
      VALUES ?nucleation_topics { wd:Q84263196 wd:Q82069695 wd:Q81068910 }
      ?work wdt:P921 ?nucleation_topics, ?node1, ?node2. # Find co-nodes
      FILTER   (?node1 != ?node2)                  # Exclude self-links
    #  OPTIONAL { ?work wdt:P577 ?pdate. }
    #  OPTIONAL { ?work wdt:P50  ?author. }
      SERVICE  wikibase:label { bd:serviceParam wikibase:language "en,fr,de,ru,es,zh,jp". }
    }
    GROUP BY ?node1 ?node2 ?node1Label ?node2Label ?pdate ?topicLabel ?authorLabel 
    ORDER BY DESC(?count)
    LIMIT 10000
    

Bankrupt publicly listed businesses due to the COVID-19 pandemic[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID, subclass of (P279)  View with Reasonator View with SQID, country (P17)  View with Reasonator View with SQID, inception (P571)  View with Reasonator View with SQID, industry (P452)  View with Reasonator View with SQID, parent organization (P749)  View with Reasonator View with SQID, has subsidiary (P355)  View with Reasonator View with SQID, significant event (P793)  View with Reasonator View with SQID, point in time (P585)  View with Reasonator View with SQID, has cause (P828)  View with Reasonator View with SQID
    SELECT ?organization ?organizationLabel ?bankruptcyDate ?countryLabel ?inception
       (GROUP_CONCAT(DISTINCT ?industryLabel; separator=", ") AS ?industries)
       (GROUP_CONCAT(DISTINCT ?parentLabel; separator=", ") AS ?parents)
       (GROUP_CONCAT(DISTINCT ?subsiduaryLabel; separator=", ") AS ?subsiduaries)
      WHERE {
      ?organization wdt:P31/wdt:P279* wd:Q43229.
      OPTIONAL { ?organization wdt:P17 ?country }.
      OPTIONAL { ?organization wdt:P571 ?inception }.
      OPTIONAL { 
                 ?organization wdt:P452 ?industry.
                 ?industry rdfs:label ?industryLabel.
                 FILTER(LANG(?industryLabel)="en")
               }.
      OPTIONAL { 
                 ?organization wdt:P749 ?parent.
                 ?parent rdfs:label ?parentLabel.
                 FILTER(LANG(?parentLabel)="en")
               }.
      OPTIONAL { 
                 ?organization wdt:P355 ?subsiduary.
                 ?subsiduary rdfs:label ?subsiduaryLabel.
                 FILTER(LANG(?subsiduaryLabel)="en")  
               }.
      ?organization p:P793 ?event.
      ?event ps:P793 wd:Q152074.
      OPTIONAL { ?event pq:P585 ?bankruptcyDate }.
      ?event pq:P828 wd:Q96175652.
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en".}
    }
    GROUP BY ?organization ?organizationLabel ?bankruptcyDate ?countryLabel ?inception
    ORDER BY DESC(?bankruptcyDate)
    

Pharmacological and non-pharmacological interventions co-occurring with COVID-19-related items in scholarly publications[edit]

The following query uses these:

  • Properties: main subject (P921)  View with Reasonator View with SQID, instance of (P31)  View with Reasonator View with SQID, subclass of (P279)  View with Reasonator View with SQID
    #defaultView:Tree
    SELECT DISTINCT ?related ?relatedLabel ?type ?typeLabel WHERE {
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
      ?COVID_19 wdt:P921 wd:Q84263196.
      ?COVID_19 wdt:P921 ?related.
      {?related wdt:P31 wd:Q12140.} UNION {?related wdt:P279 wd:Q179661.}
      OPTIONAL{?related wdt:P31 ?type.}
    }
    

Symptoms of COVID-19 disease listed by their nature of statement (P5102) or sourcing circumstances (P1480) qualifiers, with references[edit]

The following query uses these:

  • Properties: DOI (P356)  View with Reasonator View with SQID, stated in (P248)  View with Reasonator View with SQID, nature of statement (P5102)  View with Reasonator View with SQID, sourcing circumstances (P1480)  View with Reasonator View with SQID
    SELECT DISTINCT ?subjectLabel ?predicateLabel ?objectLabel ?qualifier ?source_doi WHERE {
      VALUES ?subject {wd:Q84263196 wd:Q82069695 wd:Q81068910}
      VALUES ?qual {pq:P5102 pq:P1480}
      ?subject ?p [?prop ?object; ?qual ?nos].
      ?object rdfs:label ?objectLabel.
      FILTER(LANG(?objectLabel)="en")
      FILTER(?object != ?nos)
      ?predicate wikibase:claim ?p.
      OPTIONAL {
        ?subject ?p ?statement.
        ?statement ?p1 ?object.
        ?statement (prov:wasDerivedFrom/pr:P248) ?source.
        ?source wdt:P356 ?source_doi. 
      }
      BIND(IF(?qual = pq:P5102, "Nature of statement", "Sourcing circumstances") AS ?qualifier).
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
      }
    

Extended graph of the three main COVID items and the statements for which they are the subject[edit]

The following query uses these:

Features: Graph (Q24515287)  View with Reasonator View with SQID

#PREFIX target: <http://www.wikidata.org/entity/Q40878>

#defaultView:Graph
SELECT ?node ?nodeLabel ?nodeImage ?childNode ?childNodeLabel ?childNodeImage ?rgb 
WITH {
  SELECT DISTINCT ?property WHERE {
      ?property a wikibase:Property;
                wdt:P31 wd:Q18610173 ;
                wdt:P31 wd:Q26940804 . 
    }
} AS %properties
WITH {
  SELECT DISTINCT ?node ?childNode WHERE {
      VALUES ?node { wd:Q84263196 wd:Q81068910 wd:Q82069695 } 
#      BIND(target: AS ?node)
      ?node ?p ?i.
      ?childNode ?x ?p.
      ?childNode rdf:type wikibase:Property.
      FILTER(STRSTARTS(STR(?i), "http://www.wikidata.org/entity/Q"))
      FILTER(STRSTARTS(STR(?childNode), "http://www.wikidata.org/entity/P"))
    }
  LIMIT 5000
} AS %nodes
WITH {
  SELECT DISTINCT ?childNode ?node ?rgb WHERE {
      BIND("EFFBD8" AS ?rgb)
      VALUES ?target { wd:Q84263196 wd:Q81068910 wd:Q82069695 } 
      ?target ?p ?childNode.
      ?node ?x ?p.
      ?node rdf:type wikibase:Property.
      FILTER(STRSTARTS(STR(?childNode), "http://www.wikidata.org/entity/Q"))
    }
  LIMIT 5000
} AS %childNodes
WHERE {
  {
    INCLUDE %nodes
  }
  UNION
  {
    INCLUDE %childNodes
  }

  OPTIONAL { 
    INCLUDE %properties
    ?property wikibase:directClaim ?nodeclaim.
    ?node ?nodeclaim ?nodeImage. 
  }

  OPTIONAL { 
    INCLUDE %properties
    ?property wikibase:directClaim ?childNodeclaim.
    ?childNode ?childNodeclaim ?childNodeImage. 
  }
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }        
}

Daily mortality rate from COVID-19 in Tunisia[edit]

The following query uses these:

  • Properties: number of deaths (P1120)  View with Reasonator View with SQID, number of cases (P1603)  View with Reasonator View with SQID, point in time (P585)  View with Reasonator View with SQID
    #defaultView:LineChart
    SELECT ?date ((?mort / ?cases) AS ?mortrate) WHERE {
      wd:Q87343682 wdt:P1120 ?mort.
      wd:Q87343682 p:P1120 ?stmort.
      ?stmort pq:P585 ?date.
      ?stmort ps:P1120 ?mort.
      wd:Q87343682 wdt:P1603 ?cases.
      wd:Q87343682 p:P1603 ?st.
      ?st pq:P585 ?date.
      ?st ps:P1603 ?cases.
      }
    ORDER BY ?date
    

Tunisian governorate-level cases of COVID-19[edit]

The following query uses these:

  • Properties: part of (P361)  View with Reasonator View with SQID, location (P276)  View with Reasonator View with SQID, number of cases (P1603)  View with Reasonator View with SQID
    #defaultView:BarChart
    SELECT (MAX(?cases) AS ?casenow) ?cityLabel WHERE {
      ?cd wdt:P361 wd:Q87343682.
      ?cd wdt:P276 ?city.
      ?city rdfs:label ?cityLabel.
      FILTER(LANG(?cityLabel)="en")
      ?cd wdt:P1603 ?cases.
      }
    GROUP BY ?cityLabel
    

Daily Evolution of Clinical tests by laboratory in Tunisia[edit]

The following query uses these:

COVID-19-related computer applications and their types[edit]

The following query uses these:

COVID publications[edit]

Mostly cited COVID-19-related scholarly publications[edit]

The following query uses these:

  • Properties: main subject (P921)  View with Reasonator View with SQID, instance of (P31)  View with Reasonator View with SQID, subclass of (P279)  View with Reasonator View with SQID, part of (P361)  View with Reasonator View with SQID, facet of (P1269)  View with Reasonator View with SQID, cites work (P2860)  View with Reasonator View with SQID
    #defaultView:Table
    SELECT ?count ?cited_work ?cited_workLabel
    WITH {
      SELECT (count(?work) as ?count) ?cited_work WHERE {
        VALUES ?topic { wd:Q84263196 wd:Q81068910 wd:Q82069695 } 
        
        { ?work wdt:P921/wdt:P31*/wdt:P279* ?topic . }
        union { ?work wdt:P921/wdt:P361+ ?topic . }
        union { ?work wdt:P921/wdt:P1269+ ?topic . }
        ?work wdt:P2860 ?cited_work .
      }
      GROUP BY ?cited_work
    } AS %result
    WHERE {
      INCLUDE %result
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da,de,es,fr,jp,nl,no,ru,sv,zh" . } 
    }
    ORDER BY DESC(?count)
    LIMIT 200
    

Scientists mostly cited by COVID-19-related scholarly publications[edit]

The following query uses these:

  • Properties: main subject (P921)  View with Reasonator View with SQID, part of (P361)  View with Reasonator View with SQID
    SELECT ?number_of_citations ?author ?authorLabel ?cited_work_example ?cited_work_exampleLabel
    WITH {
      # Find works about the topic
      SELECT DISTINCT ?work WHERE {
        VALUES ?topic { wd:Q84263196 wd:Q81068910 wd:Q82069695 } 
    	  ?work wdt:P921 / (wdt:P361+
    

Most common publication venues for COVID-themed papers[edit]

The following query uses these:

  • Properties: main subject (P921)  View with Reasonator View with SQID, instance of (P31)  View with Reasonator View with SQID, subclass of (P279)  View with Reasonator View with SQID, part of (P361)  View with Reasonator View with SQID, facet of (P1269)  View with Reasonator View with SQID, published in (P1433)  View with Reasonator View with SQID, part of the series (P179)  View with Reasonator View with SQID, publisher (P123)  View with Reasonator View with SQID
    #defaultView:Table
    SELECT ?count ?venue ?venueLabel ?publisherLabel
    WITH {
      SELECT (count(?work) as ?count) ?venue ?publisher WHERE {
        VALUES ?topic { wd:Q84263196 wd:Q81068910 wd:Q82069695 } 
        { ?work wdt:P921/wdt:P31*/wdt:P279* ?topic . }
        union { ?work wdt:P921/wdt:P361+ ?topic . }
        union { ?work wdt:P921/wdt:P1269+ ?topic . }
        ?work wdt:P1433/wdt:P179* ?venue .
        ?venue wdt:P123 ?publisher . 
      }
      GROUP BY ?venue ?publisher
    } AS %result
    WHERE {
      INCLUDE %result
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da,de,es,fr,jp,nl,no,ru,sv,zh" . } 
    }
    ORDER BY DESC(?count)
    

Clinical trials on interventions to treat COVID-19[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID, medical condition (P1050)  View with Reasonator View with SQID, subclass of (P279)  View with Reasonator View with SQID, start time (P580)  View with Reasonator View with SQID, research intervention (P4844)  View with Reasonator View with SQID, sponsor (P859)  View with Reasonator View with SQID
    SELECT
      DISTINCT
      ?start_date
      ?trial ?trialLabel
      ?intervention ?interventionLabel
      ?sponsor ?sponsorLabel
    WHERE {
      ?trial wdt:P31 wd:Q30612 ;
      wdt:P1050 / wdt:P279* wd:Q84263196 .
      OPTIONAL {
        ?trial wdt:P580 ?starttime
        BIND(SUBSTR(STR(?starttime), 0, 11) AS ?start_date)
      }
      OPTIONAL { ?trial wdt:P4844 ?intervention }
      OPTIONAL { ?trial wdt:P859 ?sponsor }
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da,de,es,fr,jp,nl,no,pl,ru,sv,zh". }
    }
    ORDER BY DESC(?starttime)
    

Awards most frequently received by authors of COVID papers[edit]

The following query uses these:

  • Properties: main subject (P921)  View with Reasonator View with SQID, author (P50)  View with Reasonator View with SQID, award received (P166)  View with Reasonator View with SQID
    SELECT ?count ?award ?awardLabel ?recipients ?recipientsUrl
    WITH {
      SELECT (COUNT(?researcher) AS ?count) ?award 
      (GROUP_CONCAT(DISTINCT ?researcher_label; separator=", ") AS ?recipients) 
      WHERE {
        { 
          SELECT DISTINCT ?researcher ?award WHERE {
            VALUES ?topic { wd:Q84263196 wd:Q81068910 wd:Q82069695 } 
            hint:Query hint:optimizer "None" .
            
            ?work wdt:P921 ?topic .
            ?work wdt:P50 ?researcher .
            ?researcher wdt:P166 ?award .
          } 
          LIMIT 100
        }
        ?researcher rdfs:label ?researcher_label . FILTER (LANG(?researcher_label) = 'en')
      }
      GROUP BY ?award 
    } AS %result
    WHERE {
      INCLUDE %result
        ?award rdfs:label ?awardLabel . FILTER (LANG(?awardLabel) = 'en')
    }
    GROUP BY ?count ?award ?awardLabel ?recipients ?recipientsUrl
    ORDER BY DESC(?count)
    

Map of organizations associated with works about COVID[edit]

Institutions that have published a single paper on the topic are in green, those that have published 1-10 are in orange, and those having published >10 are in blue.

The following query uses these:

Features: map (Q24515275)  View with Reasonator View with SQID

#defaultView:Map
SELECT ?organization ?organizationLabel ?geo ?count ?layer
WITH {
  SELECT DISTINCT ?work WHERE {
  # Works on the topic
    VALUES ?topic { wd:Q84263196 wd:Q81068910 wd:Q82069695 } 
    
    ?work wdt:P921 / (wdt:P361+

Online resource locations for information on COVID-19 regional outbreaks[edit]

Official websites[edit]

The following query uses these:

  • Properties: official website (P856)  View with Reasonator View with SQID, instance of (P31)  View with Reasonator View with SQID, of (P642)  View with Reasonator View with SQID
    SELECT * WHERE {
      ?outbreak p:P31 [ps:P31 wd:Q3241045; pq:P642 wd:Q84263196].
      ?outbreak rdfs:label ?label.
      FILTER(LANG(?label)="en")
      ?outbreak wdt:P856 ?URL.
      }
    

Main hashtags[edit]

The following query uses these:

  • Properties: hashtag (P2572)  View with Reasonator View with SQID, instance of (P31)  View with Reasonator View with SQID, of (P642)  View with Reasonator View with SQID
    SELECT * WHERE {
      ?item p:P31 [ps:P31 wd:Q3241045; pq:P642 wd:Q84263196].
      ?item rdfs:label ?label.
      FILTER(LANG(?label)="en")
      ?item wdt:P2572 ?hashtag.
      }
    

COVID-related images based on structured data[edit]

Images from Wikimedia Commons about COVID-19 pandemic and SARS-CoV-2 with a CC-BY license[edit]

The following query uses these:

Features: ImageGrid (Q24515278)  View with Reasonator View with SQID

#defaultView:ImageGrid
SELECT DISTINCT ?item ?image
WHERE
{
    { VALUES ?item {wd:Q82069695 wd:Q81068910 wd:Q84263196 wd:Q1134583} }
    UNION
    { ?item p:P31 [ ps:P31 wd:Q3241045 ; pq:P642 wd:Q84263196 ] .  }
  ?item wdt:P18 ?image.
  BIND(REPLACE(wikibase:decodeUri(CONCAT("File:", STRAFTER(STR(?image), "/wiki/Special:FilePath/"))), " ", "_") AS ?imageTitle)
  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Categories";
                    wikibase:endpoint "commons.wikimedia.org";
                    mwapi:titles ?imageTitle.
    ?categoryTitle wikibase:apiOutput mwapi:category.
  }
  FILTER(?categoryTitle = "Category:CC-Zero"

Images of face masks used during COVID-19 pandemic with a CC-BY license[edit]

The following query uses these:

Features: ImageGrid (Q24515278)  View with Reasonator View with SQID

#defaultView:ImageGrid
SELECT DISTINCT * WHERE {
  {?mask wdt:P31 wd:Q271779} UNION {?mask wdt:P279 wd:Q271779}.
  ?mask wdt:P5008 wd:Q87748614.
  ?mask rdfs:label ?label.
  ?mask wdt:P18 ?image.
  FILTER(LANG(?label)="en")
  BIND(REPLACE(wikibase:decodeUri(CONCAT("File:", STRAFTER(STR(?image), "/wiki/Special:FilePath/"))), " ", "_") AS ?imageTitle)
  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Categories";
                    wikibase:endpoint "commons.wikimedia.org";
                    mwapi:titles ?imageTitle.
    ?categoryTitle wikibase:apiOutput mwapi:category.
  }
  FILTER(?categoryTitle = "Category:CC-Zero"

People listed in Wikidata deceased due to COVID-19[edit]

As tabular output, ranked by date of death[edit]

The following query uses these:

  • Properties: cause of death (P509)  View with Reasonator View with SQID, occupation (P106)  View with Reasonator View with SQID, country of citizenship (P27)  View with Reasonator View with SQID, date of death (P570)  View with Reasonator View with SQID
    # COVID19 victims
    SELECT ?dateOfDeath ?name (SAMPLE(?nationality) AS ?citizenship) (SAMPLE(?occupation) AS ?profession)
    {
        ?s wdt:P509 wd:Q84263196 .
        ?s rdfs:label ?name .
        FILTER(LANG(?name)="en")
        # occupation
        OPTIONAL {
            ?s wdt:P106 ?occupationRes .
            ?occupationRes rdfs:label ?occupation .
            FILTER(LANG(?occupation)="en")
        }
        # nationality
        OPTIONAL {
            ?s wdt:P27 ?nationalityRes .
            ?nationalityRes rdfs:label ?nationality .
            FILTER(LANG(?nationality)="en")
        }
        # date of death
        OPTIONAL {
            ?s wdt:P570 ?dateOfDeath .
        }
    } GROUP BY ?name ?dateOfDeath ORDER BY DESC(?dateOfDeath)
    

With open license portrait images ranked by how well-described they are in Wikidata[edit]

The following query uses these:

Features: ImageGrid (Q24515278)  View with Reasonator View with SQID

#defaultView:ImageGrid
SELECT ?person ?date_of_death ?age ?image
WHERE {
    ?person wdt:P509 wd:Q84263196 ; wdt:P31 wd:Q5 
    OPTIONAL { ?person wdt:P570 ?date_of_death }
    OPTIONAL { ?person wikibase:statements ?statements_count ; wikibase:sitelinks ?sitelinks_count ; wikibase:identifiers ?identifiers_count . BIND(?statements_count + ?sitelinks_count + ?identifiers_count AS ?rank)}
    OPTIONAL { ?person wdt:P569 ?dob ; wdt:P570 ?dod . BIND(YEAR(?dod)-YEAR(?dob) as ?age) }
    ?person wdt:P18 ?image .
  BIND(REPLACE(wikibase:decodeUri(CONCAT("File:", STRAFTER(STR(?image), "/wiki/Special:FilePath/"))), " ", "_") AS ?imageTitle)
  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Categories";
                    wikibase:endpoint "commons.wikimedia.org";
                    mwapi:titles ?imageTitle.
    ?categoryTitle wikibase:apiOutput mwapi:category.
  }
  FILTER(?categoryTitle = "Category:CC-Zero"

As bubble diagram of professions[edit]

The following query uses these:

Features: BubbleChart (Q24515280)  View with Reasonator View with SQID

#defaultView:BubbleChart
SELECT ?occupation ?occupationLabel (COUNT(*) as ?count) WHERE {
  ?person wdt:P509 wd:Q84263196 ; wdt:P31 wd:Q5 .
  ?person wdt:P106 ?occupation .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
} 
GROUP BY ?occupation ?occupationLabel
ORDER BY DESC(?count)
LIMIT 10000