sparql-examples

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

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

245

rq turtle/ttl

Work aspect: cito incoming

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 wd: <http://wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX target: <http://www.wikidata.org/entity/Q28942417>

SELECT ?intention ?intentionLabel (CONCAT("/cito/", SUBSTR(STR(?intention), 32)) AS ?intentionUrl)  
?count ?example_work_for_intention ?example_work_for_intentionLabel 

WITH {
  SELECT ?intention (COUNT(DISTINCT ?citingArticle) AS ?count) (SAMPLE(?citingArticle) AS ?example_work_for_intention) {
    VALUES ?CITEDARTICLE { target: }
    ?citingArticle p:P2860 ?citationStatement .
    ?citationStatement pq:P3712 ?intention ;
                       ps:P2860 ?CITEDARTICLE .
    ?intention wdt:P31 wd:Q96471816 .
  }
  GROUP BY ?intention

} AS %intentions
WHERE {
  INCLUDE %intentions
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}
GROUP BY ?intention ?intentionLabel ?count ?example_work_for_intention ?example_work_for_intentionLabel
ORDER BY DESC(?count)

graph TD