sparql-examples

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

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

211

rq turtle/ttl

Venue aspect: Cited venues from specific journal

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#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX target: <http://www.wikidata.org/entity/Q6294930>

# title: Cited venues from specific journal
SELECT
  ?count
  ?short_name
  ?cited_journal ?cited_journalLabel
WITH {
  SELECT
    (COUNT(?cited_work) AS ?count)
    ?cited_journal
    (SAMPLE(?short_name_) AS ?short_name)
  WHERE {
    ?work wdt:P1433 target: .
    ?work wdt:P2860 ?cited_work .
    ?cited_work wdt:P1433 ?cited_journal . 
    OPTIONAL {
      ?work wdt:P577 ?publication_datetime .
      BIND(xsd:date(?publication_datetime) AS ?publication_date)
    }
    OPTIONAL { ?cited_journal wdt:P1813 ?short_name_ . }
  }
  GROUP BY ?cited_journal
} AS %result
WHERE {
  INCLUDE %result
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" . } 
}
ORDER BY DESC(?count)
LIMIT 200

graph TD