Zum Inhalt springen

Projekt:Solarpunkindex 2024/Queries

Aus Wikiversity

SPARQL

[Bearbeiten]

BubbleCharts

[Bearbeiten]
#title:Solarpunk Categories in Wikidata
#illustrates bubblechart view, count, items from WikiProject Solarpunk (Q126087864)
#defaultView:BubbleChart
SELECT ?category ?categoryLabel ?rgb (COUNT(?item) AS ?count)
WHERE
{
  ?item wdt:P31 ?category.
  ?item wdt:P5008 wd:Q126087864.
  OPTIONAL { ?item wdt:P465 ?rgb. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?category ?categoryLabel ?rgb
ORDER BY DESC(?count)

Try it!

Solarpunk Categories with Geocoordinates in Wikidata:

#title:Solarpunk Categories with Geocoordinates in Wikidata
#illustrates bubblechart view, count
#defaultView:BubbleChart
SELECT ?category ?categoryLabel ?rgb (COUNT(?item) AS ?count)
WHERE
{
  ?item wdt:P31 ?category.
  ?item wdt:P5008 wd:Q126087864.
  ?item wdt:P625 ?coords.
  OPTIONAL { ?item wdt:P465 ?rgb. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "de". }
}
GROUP BY ?category ?categoryLabel ?rgb
ORDER BY DESC(?count)

Try it!

Solarpunk-(Farb)Index

[Bearbeiten]
#defaultView:Map
#title:Linestrings rund um die HTW mit focus list Solarpunk
SELECT ?line ?rgb
WHERE 
{
   VALUES (?squares) {
                 (wd:Q1622222)   # HTWD
                  (wd:Q19835432)  # Beutlerpark
                  (wd:Q27557512)  # Marie-Gey-Brunnen
                  (wd:Q39562035)  # Friedrich-List-Platz
                  (wd:Q126094058) # Neubau HTW
                  (wd:Q126094567) # Bike Areal
                  (wd:Q126111132) # extensive green space Wiener Str.
                 } 
  BIND(?squares as ?item) .
  ?item  p:P1333 [psv:P1333 [ wikibase:geoLongitude ?lon1; wikibase:geoLatitude ?lat1; ] ] .
  ?item  p:P1334 [psv:P1334 [ wikibase:geoLongitude ?lon2; wikibase:geoLatitude ?lat2; ] ] .
  ?item  p:P1332 [psv:P1332 [ wikibase:geoLongitude ?lon3; wikibase:geoLatitude ?lat3; ] ] .
  ?item  p:P1335 [psv:P1335 [ wikibase:geoLongitude ?lon4; wikibase:geoLatitude ?lat4; ] ] .
  ?item wdt:P465 ?rgb.
  
  BIND(CONCAT('LINESTRING (', STR(?lon1), ' ', STR(?lat1), ',', STR(?lon2), ' ', STR(?lat2), ',', STR(?lon3), ' ', STR(?lat3), ',', STR(?lon4), ' ', STR(?lat4), ',', STR(?lon1), ' ', STR(?lat1),')') AS ?str) .
  BIND(STRDT(?str, geo:wktLiteral) AS ?line) 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "de". } 
}

Try it!

#defaultView:Map
#title:Umkreissuche (800m) für die HTWD
SELECT ?image ?category ?categoryLabel ?place ?placeLabel ?website ?dist ?location (?categoryLabel as ?layer) WHERE {
      wd:Q1622222 wdt:P625 ?HTWD .
	  SERVICE wikibase:around {
		    ?place wdt:P625 ?location.
		    bd:serviceParam wikibase:center ?HTWD.
		    bd:serviceParam wikibase:radius "0.8".
		    bd:serviceParam wikibase:distance ?dist.
		}
		  ?place wdt:P31 ?category.
		  OPTIONAL {
		    ?place wdt:P18 ?image.
		}
		  OPTIONAL {
		    ?place wdt:P856 ?website.
		}
		SERVICE wikibase:label {
		    bd:serviceParam wikibase:language "de".
		    ?place rdfs:label ?placeLabel.
		    ?category rdfs:label ?categoryLabel.
		}
	}

Try it!

ImageGrids

[Bearbeiten]
#defaultView:ImageGrid
#title:einfaches ImageGrid aller Solarpunkindex-Images (ODC2024) 
SELECT ?item ?itemLabel (SAMPLE(?image) AS ?image)
WHERE
{
  ?item wdt:P5008 wd:Q126087864.
  ?item wdt:P18 ?image .
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "de" .
  }
}
GROUP BY ?item ?itemLabel

Try it!

ImageGrid mit Reference Images aller Solarpunkindex-Items:

#defaultView:ImageGrid
#title:ImageGrid mit Reference Images aller Solarpunkindex-Items (ODC2024) 
SELECT ?item ?itemLabel (SAMPLE(?image) AS ?image)
WHERE
{
  ?item wdt:P5008 wd:Q126087864.
  ?item p:P5008 [ prov:wasDerivedFrom [ pr:P10253 ?image ] ] .
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "de" .
  }
}
GROUP BY ?item ?itemLabel

Try it!

verbesserte Version der Reference Images

#defaultView:ImageGrid
#title:ImageGrid mit Reference Images aller Solarpunkindex-Items (ODC2024) 

SELECT ?item ?itemLabel ?appliedtextLabel (SAMPLE(?image) AS ?image)
WHERE
{
  ?item wdt:P5008 wd:Q126087864;
        p:P5008 [  pq:P518 ?appliedtext ].
  ?item p:P5008 [ prov:wasDerivedFrom [ pr:P10253 ?image ] ] .
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "de" .
  }
}
GROUP BY ?item ?itemLabel ?appliedtextLabel

Try it!

  • Geokoordinaten-Box
  • Kreisflächenberechnung für Stadtbäume