query-4e38b3bde807883036c1e803b95a4c87

rq turtle/ttl

Propertiescoordinate location (P625)instance of (P31)

Use at

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#>
SELECT DISTINCT ?item ?itemLabel WHERE
{
  ?item wdt:P625 ?location ;
        wdt:P31 wd:Q3947 ;
        rdfs:label ?itemLabel .
  FILTER(strEnds(?itemLabel, "Public House") && !CONTAINS(?itemLabel, "Outside") && !CONTAINS(?itemLabel, "Former"))
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v1("?itemLabel"):::projected v3("?location") c6(["wd:Q3947"]):::iri f0[["ends-with(?itemLabel,'Public House')not contains(?itemLabel,'Outside')not contains(?itemLabel,'Former')"]] f0 --> v1 v2 --"wdt:P625"--> v3 v2 --"wdt:P31"--> c6 v2 --"rdfs:label"--> v1