query-37fd1a94fa57f643812d185444b85b46
PPP GDP per capita (P2299) 08:46, 17 June 2019 (UTC)) talk (BouzinacHello For every country (not regions etc), I'd like to get all P2299 values + their dates. This query (I'm dumb :) ) does not work ; thanks!
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?label ?PIB__PPA__par_habitant ?date ?pays ?paysLabel WHERE {
SERVICE wikibase:label {
bd:serviceParam wikibase:language "fr".
?item rdfs:label ?label.
}
?pays wdt:P31 wd:Q6256.
OPTIONAL { ?item wdt:P2299 ?PIB__PPA__par_habitant. }
OPTIONAL { ?PIB__PPA__par_habitant wdt:P585 ?date. }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?PIB__PPA__par_habitant"):::projected
v5("?date"):::projected
v1("?item"):::projected
v2("?label"):::projected
v3("?pays"):::projected
c2(["bd:serviceParam"]):::iri
c7(["wd:Q6256"]):::iri
c4(["fr"]):::literal
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
v1 --"rdfs:label"--> v2
end
v3 --"wdt:P31"--> c7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P2299".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P585".-> v5
end