sparql-examples

A set of SPARQL examples that are used in different TGX resources

View the Project on GitHub BiGCAT-UM/sparql-examples

115

rq turtle/ttl

Organization aspect: most cited papers

Use at

PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
#defaultView:BubbleChart

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

# Bubble chart of most cited works of first author associated
# with an organization
SELECT
  ?count ?work ?workLabel
WITH {
  # Find researchers associated with the organization and count
  # the number of citations.
  SELECT
    (COUNT(DISTINCT ?citing_work) AS ?count)
    ?work
  WHERE {
    ?researcher wdt:P108 | wdt:P463 | (wdt:P1416 / wdt:P361*) target: .
    ?work p:P50 ?researcher_statement .
    ?researcher_statement ps:P50 ?researcher .
    ?researcher_statement pq:P1545 "1" .
    ?citing_work wdt:P2860 ?work .
  }
  GROUP BY ?work                   
  ORDER BY DESC(?count)
  LIMIT 20
} AS %works
WHERE {
  # Label the works
  INCLUDE %works
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" .
  }
}
ORDER BY DESC(?count)

graph TD