query-e035ce4b1665b5af998fb76192f71dd6
SELECT
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 ?quantity1 ?quantity2 ?quantity3 WHERE {
{
SELECT ?item ?qname ?qcount ?qlabel 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.
}
}
}
# works
BIND(CONCAT(" ",?qlabel) AS ?quantity1)
# works
BIND(CONCAT(STR(?qcount)," ",?qlabel) AS ?quantity2)
# does not work
BIND(CONCAT(STR(?qname)," ",?qlabel) AS ?quantity3)
}
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("?quantity1"):::projected
v6("?quantity2"):::projected
v7("?quantity3"):::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[/"concat(' ',?qlabel)"/]
v4 --o bind1
bind1 --as--o v5
bind2[/"concat(str(?qcount),' ',?qlabel)"/]
v3 --o bind2
v4 --o bind2
bind2 --as--o v6
bind3[/"concat(str(?qname),' ',?qlabel)"/]
v2 --o bind3
v4 --o bind3
bind3 --as--o v7