query-c2ca86d537c3209b3f4b0e2a158d84f9

rq turtle/ttl

Propertiesheritage designation (P1435)located in the administrative territorial entity (P131)Bavarian monument authority ID (P4244)coordinate location (P625)Commons category (P373)

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?denkmalid ?coords ?commonscat ?descr ?descr1
WHERE 
{
  ?item wdt:P1435 wd:Q17297633.
  #?item wdt:P131 wd:Q514223. 
  ?item wdt:P4244 ?denkmalid.
  ?item wdt:P625 ?coords. 
  OPTIONAL {?item schema:description ?descr.}.
  OPTIONAL {?item wdt:P373 ?commonscat.}. 
  FILTER(substr(?denkmalid,1,3) = "D-7").
  FILTER(lang(?descr) = "de").
  BIND(substr(?descr,1,1) as ?descr1)
  BIND(substr(?denkmalid,12) AS ?did).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en". }
}
ORDER BY xsd:integer(?did)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?commonscat"):::projected v5("?coords"):::projected v3("?denkmalid"):::projected v2("?descr"):::projected v7("?descr1"):::projected v8("?did") v4("?item"):::projected c6(["wd:Q17297633"]):::iri c12(["bd:serviceParam"]):::iri c14(["de,en"]):::literal f0[["?descr = 'de'"]] f0 --> v2 f1[["substring(?denkmalid,'1^^xsd:integer','3^^xsd:integer') = 'D-7'"]] f1 --> v3 v4 --"wdt:P1435"--> c6 v4 --"wdt:P4244"--> v3 v4 --"wdt:P625"--> v5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."schema:description".-> v2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P373".-> v6 end bind2[/"substring(?descr,'1^^xsd:integer','1^^xsd:integer')"/] v2 --o bind2 bind2 --as--o v7 bind3[/"substring(?denkmalid,'12^^xsd:integer')"/] v3 --o bind3 bind3 --as--o v8 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end