sparql-examples

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

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

168

rq turtle/ttl

Sponsor aspect: Authors on works sponsored or funded from a specific entity.

Use at

PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
# title: Authors on works sponsored or funded from a specific entity.

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

SELECT
  ?publication_count
  ?author ?authorLabel (CONCAT("/author/", SUBSTR(STR(?author), 32)) AS ?authorUrl)
  ?example_work ?example_workLabel (CONCAT("/work/", SUBSTR(STR(?example_work), 32)) AS ?example_workUrl)
WITH {
  SELECT ?author (count(?work) as ?publication_count) (SAMPLE(?work) AS ?example_work)
  WHERE {
    ?work wdt:P859+ target: .
    ?work wdt:P50 ?author .
  }
  GROUP BY ?author
} AS %result
WHERE {
  INCLUDE %result
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" }
} 
ORDER BY DESC(?publication_count)

graph TD