query-414fc01e398e56a8b939f44b37b17dd8
Propertiesinstance of (P31)subclass of (P279)official website (P856)collection (P195)end time (P582)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
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#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?collection ?l (GROUP_CONCAT(DISTINCT ?officialweb) AS ?webs) (COUNT(DISTINCT ?q) AS ?mcount)
WHERE {
?q (wdt:P31/wdt:P279*) wd:Q87167.
?q p:P195 ?s. ?s ps:P195 ?collection. MINUS {?s pq:P582 []}.
MINUS { ?s ps:P195 wd:Q1322278 }
OPTIONAL{ ?collection wdt:P856 ?officialweb }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en".
?collection rdfs:label ?l
}
}
GROUP BY ?collection ?l
ORDER BY UCASE(?l)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?collection"):::projected
v1("?l"):::projected
v7("?mcount")
v5("?officialweb"):::projected
v2("?q"):::projected
v3("?s")
v6("?webs")
a2((" "))
a1((" "))
c7(["wd:Q1322278"]):::iri
c12(["en"]):::literal
c3(["wd:Q87167"]):::iri
c10(["bd:serviceParam"]):::iri
v2 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
v2 --"p:P195"--> v3
v3 --"p:statement/P195"--> v4
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v3 --"p:qualifier/P582"--> a2
end
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v3 --"p:statement/P195"--> c7
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:direct/P856".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
v4 --"rdfs:label"--> v1
end
bind4[/"?officialweb"/]
v5 --o bind4
bind4 --as--o v6
bind5[/"count(?q)"/]
v2 --o bind5
bind5 --as--o v7