sparql-examples

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

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

003

rq turtle/ttl

Nobel Prize winners with a Mastodon account.

Use at

PREFIX wd: <http://wikidata.org/entity/>
PREFIX wdt: <http://wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>

SELECT ?winner ?winnerLabel ?mastodon WHERE {
  VALUES ?nobel {
    wd:Q7191
    wd:Q35637
    wd:Q37922
    wd:Q38104
    wd:Q44585
    wd:Q47170
    wd:Q80061
  }
  ?winner wdt:P166 ?nobel ; wdt:P4033 ?mastodon .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v3("?mastodon"):::projected 
  v1("?nobel")
  v2("?winner"):::projected 
  c4(["bd:serviceParam"]):::iri 
  c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal 
  bind0[/VALUES ?nobel/]
  bind0-->v1
  bind00(["wd:Q7191"])
  bind00 --> bind0
  bind01(["wd:Q35637"])
  bind01 --> bind0
  bind02(["wd:Q37922"])
  bind02 --> bind0
  bind03(["wd:Q38104"])
  bind03 --> bind0
  bind04(["wd:Q44585"])
  bind04 --> bind0
  bind05(["wd:Q47170"])
  bind05 --> bind0
  bind06(["wd:Q80061"])
  bind06 --> bind0
  v2 --"wdt:P166"-->  v1
  v2 --"wdt:P4033"-->  v3
  subgraph s1["http://wikiba.se/ontology#label"]
    style s1 stroke-width:4px;
    c4 --"wikibase:language"-->  c6
  end