Project:SPARQL/examples: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 233: Line 233:
}
}
</sparql>
</sparql>
==== NIH grant award types ====
This query returns a bubble chart visualization of different NIH grant award types (P805). It uses the service wikibase:label to return the labels in your default language or in English.
<sparql tryit="1">PREFIX wd: <https://lgbtdb.wikibase.cloud/entity/>
PREFIX wdt: <https://lgbtdb.wikibase.cloud/prop/direct/>
#defaultView:BubbleChart
SELECT ?grantAwardTypeLabel ?count
WITH {
  SELECT DISTINCT ?grantAwardType (COUNT (?grant) as ?count) {
    ?grant wdt:P805 ?grantAwardType . # Selects an award type.
  }
  GROUP BY ?grantAwardType
  ORDER BY DESC (?count)
} AS %i
WHERE {
  INCLUDE %i
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Helps get the label in your language, if not, then en (English) language
}</sparql>


==== Co-authorship clustering ====
==== Co-authorship clustering ====

Navigation menu