query-1b15a34def151606c7805b7688749df3
Can't use aliases for labels from SERVICE wikibase:labelI want to use a query in Listeria (Magnus' tool), but that doesn't recognise mixed case labels. So I thought of creating all lowercase aliases for the labels, but that doesn't work. Then the result is empty for those fields. I can't use rdfs:label here, because that makes the query too hard and gives a timeout. My query is:
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
select distinct ?item (?itemLabel as ?itemlabel) ?person (?personLabel as ?personlabel) ?humancheck (?humancheckLabel as ?humanchecklabel) WHERE
{
?item wdt:P58 ?person .
OPTIONAL {?person wdt:P31 ?humancheck .}
FILTER(?humancheck NOT IN (wd:Q5,wd:Q159979,wd:Q2985549,wd:Q10648343,wd:Q6934877,wd:Q16017119,wd:Q61002,wd:Q3046146,wd:Q14073567,wd:Q14756018))
SERVICE wikibase:label {
bd:serviceParam wikibase:language "nl,en" .
}
} ORDER BY ?person
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?humancheck"):::projected
v6("?humanchecklabel")
v3("?item"):::projected
v4("?itemlabel")
v1("?person"):::projected
v5("?personlabel")
c16(["nl,en"]):::literal
c14(["bd:serviceParam"]):::iri
f0[["?humancheck != 'wd:Q5'?humancheck != 'wd:Q159979'?humancheck != 'wd:Q2985549'?humancheck != 'wd:Q10648343'?humancheck != 'wd:Q6934877'?humancheck != 'wd:Q16017119'?humancheck != 'wd:Q61002'?humancheck != 'wd:Q3046146'?humancheck != 'wd:Q14073567'?humancheck != 'wd:Q14756018'"]]
f0 --> v2
v3 --"wdt:P58"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P31".-> v2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c14 --"wikibase:language"--> c16
end
bind1[/"?itemLabel"/]
null --o bind1
bind1 --as--o v4
bind2[/"?personLabel"/]
null --o bind2
bind2 --as--o v5
bind3[/"?humancheckLabel"/]
null --o bind3
bind3 --as--o v6