Wikidata:WikiProject Slovenia/Showcase Queries

Home

 


Properties

 

Maintenance Queries

 

Showcase Queries

 



Maps

edit

All items

edit
# All coordinate-equipped items in Slovenia
# defaultView:Map
SELECT ?item ?coord ?itemLabel ?layer
WHERE
{
    ?item wdt:P17 wd:Q215 .
    ?item p:P625 [ ps:P625 ?coord; psv:P625 ?coordV ] .
    ?item wdt:P31 ?type .
    ?coordV wikibase:geoLongitude ?longitude .
    OPTIONAL { ?type rdfs:label ?layer. FILTER(LANG(?layer) = "en"). }
    SERVICE wikibase:label {
      bd:serviceParam wikibase:language "en" .
    }
}
Try it!

Cultural heritage sites

edit
# All items that have p1587 set and some other optional information. Also works as a map
#defaultView:Map
SELECT ?item ?itemLabel ?ESD ?coord ?image ?layer
WHERE
{
    ?item wdt:P1587 ?ESD .
    OPTIONAL { ?item wdt:P625 ?coord }
    OPTIONAL { ?item wdt:P18 ?image }
    OPTIONAL { ?item wdt:P1435 ?type }
    SERVICE wikibase:label { 
      bd:serviceParam wikibase:language "en" .
      ?item rdfs:label ?itemLabel .
      ?type rdfs:label ?layer .
    }
}
Try it!

Caves

edit
# All items that have p3256 set and some other optional information. Also works as a map
#defaultView:Map
SELECT ?item ?itemLabel ?Ecadastre ?coord ?image
WHERE
{
    ?item wdt:P3256 ?Ecadastre .
    OPTIONAL { ?item wdt:P625 ?coord }
    OPTIONAL { ?item wdt:P18 ?image }
    SERVICE wikibase:label { 
      bd:serviceParam wikibase:language "en" .
      ?item rdfs:label ?itemLabel .
    }
}
Try it!

People

edit

Birthplaces

edit
# Places in Slovenia by number of notable people born there.
#defaultView:BubbleChart
SELECT ?place ?placeLabel ?count
WHERE
{
    {
        SELECT ?place (count(?item) as ?count)
        WHERE
        {
            ?item wdt:P19 ?place .
            ?place wdt:P17 wd:Q215 .
        }
        GROUP BY ?place
    }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
ORDER BY DESC(?count)
Try it!

Names

edit
# Given names of notable people born in Slovenia
#defaultView:BubbleChart
SELECT ?givenName ?givenNameLabel ?count
WHERE
{
  {
    SELECT ?givenName (count(?item) as ?count)
    WHERE {
      ?item wdt:P19 ?place .
      ?place wdt:P17 wd:Q215 .
      ?item wdt:P735 ?givenName .
    }
    GROUP BY ?givenName
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
ORDER BY DESC(?count)
Try it!

Gender ratio

edit
# Gender ratio of notable people that have Slovenian citizenship
#defaultView:BubbleChart
SELECT ?gender ?genderLabel ?count
WHERE
{
      {
        SELECT ?gender (COUNT(?gender) AS ?count)
        WHERE
        {
            ?person wdt:P27 wd:Q215.
            ?person wdt:P21 ?gender.
        }
        GROUP BY ?gender
    }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
ORDER BY DESC(?count)
Try it!

Science and discovery

edit
# Things discovered by people born in Slovenia and Slovenian citiziens
SELECT DISTINCT ?item ?itemLabel ?discovererLabel ?placeLabel
WHERE
{
    {
      ?item wdt:P61 ?discoverer .
      ?discoverer wdt:P19 ?place .
      ?place wdt:P17 wd:Q215 .
    }
    UNION
    {
      ?item wdt:P61 ?discoverer .
      ?discoverer wdt:P27 wd:Q215 .
    }
    SERVICE wikibase:label {
      bd:serviceParam wikibase:language "en"
    }
}
Try it!
  NODES
Project 4