query-44858b31245dcf8da5242b40ea9338f5
This query finds all usages of property P6363 AS a statement.
SELECT ?item ?itemLabel ?statement ?rank ?snacktype ?value { ?item p:P6363 ?statement . ?statement wikibase:rank ?rank . OPTIONAL { ?statement ps:P6363 ?dbvalue }
BIND(COALESCE(IF(wikibase:isSomeValue(?dbvalue), "unknown", "concrete"), "novalue") AS ?snacktype) BIND(IF(wikibase:isSomeValue(?dbvalue), "", ?dbvalue) AS ?value)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } } LIMIT 1000
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# This query finds all usages of property P6363 AS a statement.
SELECT ?item ?itemLabel ?statement ?rank ?snacktype ?value
{
?item p:P6363 ?statement .
?statement wikibase:rank ?rank .
OPTIONAL { ?statement ps:P6363 ?dbvalue }
BIND(COALESCE(IF(wikibase:isSomeValue(?dbvalue), "unknown", "concrete"), "novalue") AS ?snacktype)
BIND(IF(wikibase:isSomeValue(?dbvalue), "", ?dbvalue) AS ?value)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
LIMIT 1000
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?dbvalue")
v1("?item"):::projected
v3("?rank"):::projected
v5("?snacktype"):::projected
v2("?statement"):::projected
v6("?value"):::projected
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v1 --"p:P6363"--> v2
v2 --"wikibase:rank"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:statement/P6363".-> v4
end
bind0[/"if(http://wikiba.se/ontology#isSomeValue(?dbvalue),'unknown','concrete')'novalue'"/]
v4 --o bind0
bind0 --as--o v5
bind1[/"if(http://wikiba.se/ontology#isSomeValue(?dbvalue),'',?dbvalue)"/]
v4 --o bind1
bind1 --as--o v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end