query-9064556f26f399119c9fb638284eda01
14:23, 20 January 2016 (UTC)) talk (Mbch331 stays empty. I checked the first item in the list and it has a value for P1686. What am I doing wrong? werkThe column : a qualifier connects from a statement as its subject, not an item, so you need something like this:Mbch331@
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
SELECT ?item ?itemLabel ?nom ?nomLabel ?werk
{
?item wdt:P1411 ?nom .
FILTER NOT EXISTS { ?nom pq:P585 ?x } .
OPTIONAL {?item p:P1411 ?nom_stmt . ?nom_stmt pq:P1686 ?werk} .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "nl,en" .
}
} ORDER BY ASC(?item)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v2("?nom"):::projected
v4("?nom_stmt")
v5("?werk"):::projected
v3("?x")
c6(["bd:serviceParam"]):::iri
c8(["nl,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:qualifier/P585"--> e0v2
e0v1("?nom"):::projected
e0v2("?x"):::projected
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c1
f0 --> v3
v2 --"p:qualifier/P585"--> v3
v1 --"p:direct/P1411"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:P1411".-> v4
v4 --"p:qualifier/P1686"--> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end