query-b04167dd53e5b9229846da1032fd181c

rq turtle/ttl

People whose birth place is Plovdiv

Use at

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

#ORDER BY DESC(?sites)
SELECT ?item ?statements (COUNT(DISTINCT ?sitelink) AS ?sites) ?itemLabel ?pic ?birth ?pobLabel ?VIAF ?IMDb WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  BIND(xsd:integer(STRAFTER(STR(?item), "Q")) AS ?qid)
  ?item wikibase:statements ?statements.
  OPTIONAL {
    ?sitelink schema:about ?item.
    ?sitelink schema:inLanguage ?lang.
  }
  ?item wdt:P31 wd:Q5.
  { ?item wdt:P19 wd:Q459. }
  UNION
  {
    ?item wdt:P19 ?pob.
    ?pob wdt:P131* wd:Q459.
  }
  OPTIONAL { ?item wdt:P569 ?birth. }
  OPTIONAL { ?item wdt:P19 ?pob. }
  OPTIONAL { ?item wdt:P18 ?pic. }
  OPTIONAL { ?item wdt:P214 ?VIAF. }
  OPTIONAL { ?item wdt:P345 ?IMDb. }
}
GROUP BY ?item ?statements ?itemLabel ?pic ?birth ?pobLabel ?VIAF ?IMDb
ORDER BY ?birth

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v10("?IMDb"):::projected v9("?VIAF"):::projected v1("?birth"):::projected v3("?item"):::projected v6("?lang") v8("?pic"):::projected v7("?pob") v2("?qid") v5("?sitelink"):::projected v11("?sites") v4("?statements"):::projected c2(["bd:serviceParam"]):::iri c11(["wd:Q459"]):::iri c9(["wd:Q5"]):::iri c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end bind0[/"http://www.w3.org/2001/XMLSchema#integer(substring-after(str(?item),'Q'))"/] v3 --o bind0 bind0 --as--o v2 v3 --"wikibase:statements"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."schema:about".-> v3 v5 --"schema:inLanguage"--> v6 end v3 --"wdt:P31"--> c9 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P19"--> v7 v7 --"wdt:P131"--> c11 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P19"--> c11 end union0r <== or ==> union0l end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P569".-> v1 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P19".-> v7 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P18".-> v8 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P214".-> v9 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P345".-> v10 end bind2[/"count(?sitelink)"/] v5 --o bind2 bind2 --as--o v11