query-efd83d4265f7055096cf43d189c8037d

rq turtle/ttl

SPAROL 2I am using SELECT ?item WHERE { ?item wdt:P31 wd:Q476028 . ?item wdt:P571 wd:. } 11:16, 3 July 2016 (UTC)) talk (Xaris333I know its wrong at the last wd. I want to find all pages with P31 --> Q476028 that have any value in P571. (So if a pages with P31 --> Q476028 does not have P571 will not list). : If you say ANY-VALUE that means that you have to store it in a variable. This should work:Xaris333@

Use at

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 ?item ?itemLabel ?any
WHERE
{
 ?item wdt:P31 wd:Q476028 .
  ?item wdt:P571 ?any.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?any"):::projected v1("?item"):::projected c2(["wd:Q476028"]):::iri c5(["bd:serviceParam"]):::iri c7(["en"]):::literal v1 --"wdt:P31"--> c2 v1 --"wdt:P571"--> v2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end