query-1f0577ebe297a69c908ecfc58e9624a4

rq turtle/ttl

Propertiesinstance of (P31)publication date (P577)subclass of (P279)

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?type ?typeLabel (COUNT(?ws) as ?count) (COUNT(?date) as ?have_date)
WHERE {
?article schema:about ?ws;
    schema:isPartOf <https://en.wikisource.org/>.
?ws wdt:P31 ?type
OPTIONAL {?ws wdt:P577 ?date}
MINUS {?type wdt:P279+ wd:Q17442446}
MINUS {?type wdt:P279 wd:Q14204246}
MINUS {?type wdt:P279+ wd:Q17379835}
OPTIONAL {?type rdfs:label ?typeLabel filter(lang(?typeLabel) = "en") }
} GROUP BY ?type ?typeLabel
ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?article") v7("?count") v6("?date"):::projected v7("?have_date") v5("?type"):::projected v2("?typeLabel"):::projected v4("?ws"):::projected c10(["wd:Q17379835"]):::iri c9(["wd:Q14204246"]):::iri c8(["wd:Q17442446"]):::iri c4([https://en.wikisource.org/]):::iri v3 --"schema:about"--> v4 v3 --"schema:isPartOf"--> c4 v4 --"wdt:P31"--> v5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P577".-> v6 end subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v5 --"wdt:P279"--> c8 end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v5 --"wdt:P279"--> c9 end subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v5 --"wdt:P279"--> c10 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."rdfs:label".-> v2 end bind5[/"count(?ws)"/] v4 --o bind5 bind5 --as--o v7 bind6[/"count(?date)"/] v6 --o bind6 bind6 --as--o v7