query-d77ac1a1337566041f6274b40aa9865b

rq turtle/ttl

TODO

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?language ?languageLabel ?count ?clabel
WHERE {
  {
    SELECT ?placeLabel ?language (COUNT(?item) AS ?count)
    WHERE {  {
  SELECT DISTINCT ?item ?place ?placeLabel ?publishing_date ?decade ?gender ?language
  WHERE {
    ?item wdt:P291 ?place ;
      wdt:P577 ?publishing_date; 
      wdt:P31 ?inst. 
    FILTER(?inst IN (wd:Q1261026, wd:Q732577))
    FILTER(?place IN (wd:Q8692, wd:Q10313, wd:Q497801, wd:Q14318, wd:Q10282, wd:Q134674))
    FILTER(?publishing_date >= "1700-01-01"^^xsd:date && ?publishing_date < "1800-01-01"^^xsd:dat)
    ?place rdfs:label ?placeLabel. FILTER(LANG(?placeLabel)="eu")
    OPTIONAL { ?item wdt:P872/wdt:P21/rdfs:label ?gender_ . FILTER(LANG(?gender_)="en") }
    OPTIONAL { ?item wdt:P407/rdfs:label ?language_ . FILTER(LANG(?language_)="eu") }
    BIND(COALESCE(?gender_, "unspecified") AS ?gender)
    BIND(COALESCE(?language_, "unspecified") AS ?language)
    BIND(CONCAT(SUBSTR(STR(?publishing_date), 1, 3), "0") AS ?decade)
  }
}}
    GROUP BY ?placeLabel ?language 
  }
BIND(CONCAT(?placeLabel, " ", STR(?count)) AS ?clabel)
}
ORDER BY ?placeLabel DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v12("?clabel"):::projected v12("?count"):::projected v11("?decade") v9("?gender") v7("?gender_") v6("?inst") v8("?item") v10("?language"):::projected v3("?language_") v5("?place") v1("?placeLabel") v4("?publishing_date") a1((" ")) a2((" ")) a3((" ")) f0[["?placeLabel = 'eu'"]] f0 --> v1 f1[["?publishing_date >= '1700-01-01^^xsd:date'?publishing_date < s1800-01-01^^<http://www.w3.org/2001/XMLSchema#dat>'"]] f1 --> v4 list0c5(["wd:Q10282"]):::iri list0c1(["wd:Q8692"]):::iri list0c3(["wd:Q497801"]):::iri list0c6(["wd:Q134674"]):::iri list0c4(["wd:Q14318"]):::iri list0c2(["wd:Q10313"]):::iri list0c1 --o f2 list0c2 --o f2 list0c3 --o f2 list0c4 --o f2 list0c5 --o f2 list0c6 --o f2 f2[[" in "]] f2 --> v5 list1c1(["wd:Q1261026"]):::iri list1c2(["wd:Q732577"]):::iri list1c1 --o f3 list1c2 --o f3 f3[[" in "]] f3 --> v6 v8 --"wdt:P291"--> v5 v8 --"wdt:P577"--> v4 v8 --"wdt:P31"--> v6 v5 --"rdfs:label"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v8 -."wdt:P872".-> a1 a1 --"wdt:P21"--> a2 a2 --"rdfs:label"--> v7 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v8 -."wdt:P407".-> a3 a3 --"rdfs:label"--> v3 end bind4[/"?gender_'unspecified'"/] v7 --o bind4 bind4 --as--o v9 bind5[/"?language_'unspecified'"/] v3 --o bind5 bind5 --as--o v10 bind6[/"concat(substring(str(?publishing_date),'1^^xsd:integer','3^^xsd:integer'),'0')"/] v4 --o bind6 bind6 --as--o v11 bind8[/"count(?item)"/] v8 --o bind8 bind8 --as--o v12 bind9[/"concat(?placeLabel,' ',str(?count))"/] v1 --o bind9 v12 --o bind9 bind9 --as--o v12