query-e64b64c7d886a691624de18ed6a5a34a
: indeed, this is a strange bug. Especially as it works if you do it in 2 lines :Vicarage@
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
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 DISTINCT ?item ?qcount ?qlabel ?quantity WHERE{
VALUES ?item {wd:Q17122887}
{ ?item p:P516 [ps:P516 ?qname; pq:P1114 ?qcount].
SERVICE wikibase:label {bd:serviceParam wikibase:language "en,mul".
?qname rdfs:label ?qlabel.
}
BIND(STR(?qname) AS ?qnameSTR)
BIND(CONCAT(?qnameSTR," ",?qlabel) AS ?quantity)
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v3("?qcount"):::projected
v4("?qlabel"):::projected
v2("?qname")
v5("?qnameSTR")
v6("?quantity"):::projected
a1((" "))
c5(["bd:serviceParam"]):::iri
c7(["en,mul"]):::literal
bind0[/VALUES ?item/]
bind0-->v1
bind00(["wd:Q17122887"])
bind00 --> bind0
a1 --"p:statement/P516"--> v2
a1 --"p:qualifier/P1114"--> v3
v1 --"p:P516"--> a1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
v2 --"rdfs:label"--> v4
end
bind1[/"str(?qname)"/]
v2 --o bind1
bind1 --as--o v5
bind2[/"concat(?qnameSTR,' ',?qlabel)"/]
v5 --o bind2
v4 --o bind2
bind2 --as--o v6