sparql-examples

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

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

112

rq turtle/ttl

Organization aspect: co author normalized citations

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#>
#defaultView:BarChart

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

SELECT ?year (SUM(?citations_per_author_) AS ?citations_per_author) ?researcherLabel
WITH {
  # Find researchers affiliated with the organization
  SELECT DISTINCT ?researcher WHERE {
    ?researcher wdt:P108 | wdt:P463 | wdt:P1416/wdt:P361* target: .
  }
} AS %researchers 
WITH {
  # Find works of the researchers and count the number of citations
  SELECT
    ?researcher ?work ?year (COUNT(DISTINCT ?citing_work) / COUNT(DISTINCT ?researcher_of_paper) AS ?citations_per_author_)
  WHERE {
    INCLUDE %researchers
    ?work wdt:P50 | wdt:P2093 ?researcher_of_paper .
    ?work wdt:P50 ?researcher .
    ?citing_work wdt:P2860 ?work .
    ?work wdt:P577 ?date . 
    BIND(STR(YEAR(?date)) AS ?year)
  }
  GROUP BY ?work ?researcher ?year
} AS %counts
WHERE {
  # Label the results
  INCLUDE %counts    
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" . }
}
GROUP BY ?year ?researcher ?researcherLabel
ORDER BY ?year

graph TD