query-a76d2258e2cc600760de23f4a509841a

rq turtle/ttl

Countries

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#>
SELECT 
  ?archaeologists
  (CONCAT("#country/", SUBSTR(STR(?country), 32), "/archaeologist") AS ?archaeologistsUrl)

  ?country ?countryLabel
  (CONCAT("#country/", SUBSTR(STR(?country), 32)) AS ?countryUrl)

  ?example_archaeologist ?example_archaeologistLabel

WHERE {
   {
  SELECT 
    (COUNT(?archaeologist) AS ?archaeologists)
    ?country
    (SAMPLE(?archaeologist) AS ?example_archaeologist)
  WHERE {
    ?archaeologist wdt:P106 wd:Q3621491 ;
                   wdt:P27 ?country .
  }
  GROUP BY ?country
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?archaeologists)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?archaeologist") v4("?archaeologists"):::projected v5("?archaeologistsUrl") v3("?country"):::projected v6("?countryUrl") v4("?example_archaeologist"):::projected c5(["bd:serviceParam"]):::iri c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal c2(["wd:Q3621491"]):::iri v2 --"wdt:P106"--> c2 v2 --"wdt:P27"--> v3 bind2[/"count(?archaeologist)"/] v2 --o bind2 bind2 --as--o v4 bind3[/"sample(?archaeologist)"/] v2 --o bind3 bind3 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end bind4[/"concat('#country/',substring(str(?country),'32^^xsd:integer'),'/archaeologist')"/] v3 --o bind4 bind4 --as--o v5 bind5[/"concat('#country/',substring(str(?country),'32^^xsd:integer'))"/] v3 --o bind5 bind5 --as--o v6