sparql-examples

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

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

218

rq turtle/ttl

Venue aspect: most reused articles

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/Q6294930>

SELECT ?citedArticle ?citedArticleLabel (CONCAT("/work/", SUBSTR(STR(?citedArticle), 32), "#cito") AS ?citedArticleUrl)
(COUNT(DISTINCT ?citingArticle) AS ?count) WHERE {
  VALUES ?JOURNAL { target: }
  VALUES ?INTENTION { wd:Q96472102 wd:Q96471820 wd:Q101149476 }
  ?citingArticle p:P2860 ?citationStatement .
  ?citationStatement pq:P3712 ?INTENTION ;
                     ps:P2860 ?citedArticle .
  ?citedArticle wdt:P1433 ?JOURNAL .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
} GROUP BY ?citedArticle ?citedArticleLabel
  ORDER BY DESC(?count)

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?INTENTION")
  v2("?JOURNAL")
  v5("?citationStatement")
  v6("?citedArticle"):::projected 
  v7("?citedArticleUrl")
  v4("?citingArticle"):::projected 
  v8("?count")
  c6([http://www.bigdata.com/rdf#serviceParam]):::iri 
  c8(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal 
  bind0[/VALUES ?JOURNAL/]
  bind0-->v2
  bind00(["wd:Q6294930"])
  bind00 --> bind0
  bind1[/VALUES ?INTENTION/]
  bind1-->v3
  bind10([http://wikidata.org/entity/Q96472102])
  bind10 --> bind1
  bind11([http://wikidata.org/entity/Q96471820])
  bind11 --> bind1
  bind12([http://wikidata.org/entity/Q101149476])
  bind12 --> bind1
  v4 --"p:P2860"-->  v5
  v5 --"p:qualifier/P3712"-->  v3
  v5 --"p:statement/P2860"-->  v6
  v6 --"p:direct/P1433"-->  v2
  subgraph s1["http://wikiba.se/ontology#label"]
    style s1 stroke-width:4px;
    c6 --"wikibase:language"-->  c8
  end
  bind3[/"concat('/work/',substring(str(?citedArticle),'32^^xsd:integer'),'#cito')"/]
  v6 --o bind3
  bind3 --as--o v7
  bind4[/"count(?citingArticle)"/]
  v4 --o bind4
  bind4 --as--o v8