query-694ff8431d8bae3cc09c82df8ac372c8
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT (COUNT(?item) AS ?number_of_P856) (SUM(?no_P407) as ?without_P407) {
?item p:P856 ?p856stm .
OPTIONAL { ?p856stm pq:P407 ?p407 }
BIND(IF(BOUND(?p407),0,1) AS ?no_P407 )
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v4("?no_P407"):::projected
v5("?number_of_P856")
v3("?p407")
v2("?p856stm")
v6("?without_P407")
v1 --"p:P856"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:qualifier/P407".-> v3
end
bind0[/"if(bound(?p407),'0^^xsd:integer','1^^xsd:integer')"/]
v3 --o bind0
bind0 --as--o v4
bind3[/"count(?item)"/]
v1 --o bind3
bind3 --as--o v5
bind4[/"sum(?no_P407)"/]
v4 --o bind4
bind4 --as--o v6