query-8f52a241397c0e1ab95121a359f688c2

rq turtle/ttl

title: Objekte von BiB-relevanten Klassen im Umkreis von 20 km um das Zentrum Berlins

Problem: Kategorie "Denkmal" ist sehr umfassend und wenigs präzise

SELECT DISTINCT ?obj ?objLabel ?location WiTH { #title: Klassen der Objekte mit Verweis auf Beschreibung in BiB (P1343 od. P973) SELECT DISTINCT ?class (COUNT(?class) AS ?n) WHERE { { ?place wdt:P1343 wd:Q111792585 . } UNION { ?place wdt:P973 ?url . FILTER (STRSTARTS(STR(?URL), "https://bildhauerei-in-berlin.de/") ) }

?place wdt:P31 ?class .

} GROUP BY ?class ORDER BY DESC(?n) LIMIT 5 } AS %i WHERE { INCLUDE %i wd:Q64 wdt:P625 ?berlincoords . SERVICE wikibase:around {

      ?obj wdt:P625 ?location .
        ?obj wdt:P31 ?class .

        bd:serviceParam wikibase:center ?berlincoords . 
 # Where the circle has a radius of XX km
 bd:serviceParam wikibase:radius "20" .

} .

      SERVICE wikibase:label { bd:serviceParam wikibase:language "de". }

}

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#>
#title: Objekte von BiB-relevanten Klassen im Umkreis von 20 km um das Zentrum Berlins

#Problem: Kategorie "Denkmal" ist sehr umfassend und wenigs präzise
SELECT DISTINCT ?obj ?objLabel ?location
WHERE {
   {
  #title: Klassen der Objekte mit Verweis auf Beschreibung in BiB (P1343 od. P973)
  SELECT DISTINCT ?class (COUNT(?class) AS ?n) WHERE {
  {
  ?place wdt:P1343 wd:Q111792585 .
   } UNION {
      ?place wdt:P973 ?url .
   FILTER (STRSTARTS(STR(?URL), "https://bildhauerei-in-berlin.de/") )
    }

  ?place wdt:P31 ?class .

   }
  GROUP BY ?class  ORDER BY DESC(?n) LIMIT 5
}          wd:Q64 wdt:P625 ?berlincoords .
          SERVICE wikibase:around {

          ?obj wdt:P625 ?location .
            ?obj wdt:P31 ?class .

            bd:serviceParam wikibase:center ?berlincoords . 
     # Where the circle has a radius of XX km
     bd:serviceParam wikibase:radius "20" . 
   } .

          SERVICE wikibase:label { bd:serviceParam wikibase:language "de". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?URL") v6("?berlincoords") v5("?class") v8("?location"):::projected v6("?n") v7("?obj"):::projected v2("?place") v4("?url") c15(["de"]):::literal c6(["wd:Q64"]):::iri c2(["wd:Q111792585"]):::iri c9(["bd:serviceParam"]):::iri c12(["20"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; f0[["starts-with(str(?URL),'https://bildhauerei-in-berlin.de/')"]] f0 --> v3 v2 --"wdt:P973"--> v4 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P1343"--> c2 end union0r <== or ==> union0l end v2 --"wdt:P31"--> v5 bind2[/"count(?class)"/] v5 --o bind2 bind2 --as--o v6 c6 --"wdt:P625"--> v6 subgraph s1["http://wikiba.se/ontology#around"] style s1 stroke-width:4px; v7 --"wdt:P625"--> v8 v7 --"wdt:P31"--> v5 c9 --"wikibase:center"--> v6 c9 --"wikibase:radius"--> c12 end subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c9 --"wikibase:language"--> c15 end