query-efd3c09c1d7e97ea0088e9b011316737
Count items having / missing a property using one query ?Hello, I have the following query :
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
select ?depute ?idBnF where {
?depute p:P39 ?statement.
?statement pq:P2937 wd:Q24939798.
OPTIONAL {?depute wdt:P268 ?idBnF}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?depute"):::projected
v3("?idBnF"):::projected
v2("?statement")
c3(["wd:Q24939798"]):::iri
v1 --"p:P39"--> v2
v2 --"p:qualifier/P2937"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P268".-> v3
end