sparql-examples

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

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

127

rq turtle/ttl

Podcast-episode aspect: guests

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 target: <http://www.wikidata.org/entity/Q124268563>

SELECT DISTINCT ?guest ?guestLabel
  (CONCAT("/", SUBSTR(STR(?guest), 32)) AS ?guestUrl)
WHERE {
  BIND(target: AS ?episode)
  ?episode wdt:P5030 ?guest .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
}

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?episode")
  v2("?guest"):::projected 
  v3("?guestUrl")
  c3([http://www.bigdata.com/rdf#serviceParam]):::iri 
  c5(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal 
  bind0[/"http://www.wikidata.org/entity/Q124268563"/]
  bind0 --as--o v1
  v1 --"p:direct/P5030"-->  v2
  subgraph s1["http://wikiba.se/ontology#label"]
    style s1 stroke-width:4px;
    c3 --"wikibase:language"-->  c5
  end
  bind1[/"concat('/',substring(str(?guest),'32^^xsd:integer'))"/]
  v2 --o bind1
  bind1 --as--o v3