query-5c917944030ff6a57054516f446ea630

rq turtle/ttl

PropertiesHistoric Environment Scotland ID (P709)instance of (P31)coordinate location (P625)

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?item ?itemLabel ?iLabel ?hsid
WHERE 
{
  ?item wdt:P709 ?hsid.

  ?item rdfs:label ?itemLabel.
  FILTER(LANG(?itemLabel) = "en").

  FILTER ( NOT EXISTS { ?item wdt:P31 ?instance. } )
  FILTER ( EXISTS { ?item wdt:P625 ?coords. } )

  FILTER ( CONTAINS(?itemLabel, "Bridge") ).
}
LIMIT 100

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?coords") v5("?hsid"):::projected v4("?instance") v2("?item"):::projected v1("?itemLabel"):::projected f0[["contains(?itemLabel,'Bridge')"]] f0 --> v1 f1[[" "]] subgraph f1e0["Exists Clause"] e0v1 --"wdt:P625"--> e0v2 e0v2("?coords"):::projected e0v1("?item"):::projected end f1--EXISTS--> f1e0 f1 --> v2 f1 --> c2 f1 --> v3 v2 --"wdt:P625"--> v3 f2[["not "]] subgraph f2e1["Exists Clause"] e1v1 --"wdt:P31"--> e1v2 e1v2("?instance"):::projected e1v1("?item"):::projected end f2--EXISTS--> f2e1 f2 --> v2 f2 --> c3 f2 --> v4 v2 --"wdt:P31"--> v4 f3[["?itemLabel = 'en'"]] f3 --> v1 v2 --"wdt:P709"--> v5 v2 --"rdfs:label"--> v1