query-e0ef581df263618142a5178ed4a3bdc0
).contribs • [[User talk:|talk]] ([[User:|?]] comment was added byunsignedThe preceding – Remove the OPTIONAL statement, the result is the same... Spain is not in the result (Q29) 16:56, 13 June 2019 (UTC) Jura, not by ISO code. --- rankThe query is by statement with P31=Q6256 in best despite this, change the query to this:(Q29)Spain If you want to see , which has Normal rank, is not considered.(Q6256)country . And wdt will only show claims with the best rank, so in this case (Q29)Spain to Preferred rank for (Q3624078)sovereign state (P31)instance of where someone changed the rank for this edit does not appear in the query result is (Q29)Spain : The reason why Ferviri@
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?isocode WHERE {
?item p:P31 [ps:P31 wd:Q6256 ] .
OPTIONAL { ?item wdt:P299 ?isocode. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "es". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?isocode"):::projected
v1("?item"):::projected
a1((" "))
c6(["bd:serviceParam"]):::iri
c2(["wd:Q6256"]):::iri
c8(["es"]):::literal
a1 --"p:statement/P31"--> c2
v1 --"p:P31"--> a1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P299".-> v2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end