sparql-examples

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

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

210

rq turtle/ttl

Venue aspect: Citation distribution for a venue

Use at

PREFIX p: <http://www.wikidata.org/prop/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
# title: Citation distribution for a venue

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

#defaultView:LineChart
SELECT
  ?number_of_citations (COUNT(?work) AS ?count)
WHERE {
  {
    SELECT ?work (COUNT(?citing_work) AS ?number_of_citations)
    WHERE {
      ?work wdt:P1433 target: .
      OPTIONAL { ?citing_work wdt:P2860 ?work . }
    }
    GROUP BY ?work 
  }
} 
GROUP BY ?number_of_citations
ORDER BY DESC(?number_of_citations)

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?citing_work")
  v4("?count")
  v4("?number_of_citations"):::projected 
  v2("?work"):::projected 
  c2([http://www.wikidata.org/entity/Q6294930]):::iri 
  v2 --"p:direct/P1433"-->  c2
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v3 -."p:direct/P2860".->  v2
  end
  bind1[/"count(?citing_work)"/]
  v3 --o bind1
  bind1 --as--o v4
  bind3[/"count(?work)"/]
  v2 --o bind3
  bind3 --as--o v4