Wikidata:Events/Belgium/Wikimedia Belgium/Erfgoed/Pajottenland-Zennevallei

This page is part of a Heritage project of Wikimedia Belgium to improve the presence of Pajottenland/Zennevallei on Wikipedia.

Why this project? edit

The goal of this integrated project is:

  • register all objects in Wikidata
  • write ListeriaBot queries to gather items per type (monuments, buildings, people, immaterial cultural heritage)
  • write missing Wikipedia articles
  • amend existing Wikipedia articles
  • upload images in Wikimedia Commons
  • register one image in wikidata for every item
  • use images in Wikipedia articles
  • add structured data to images (images description and inventory database)

Physical objects edit

Lijst van items per gemeente edit

Condition: the object should be registered in a municipality (gemeente).

The following query uses these:

Features: map (Q24515275)     

#defaultView:Map
# Select all items in a municipality
SELECT ?item ?itemLabel ?itemDescription ?geolocatie ?city ?cityLabel ?locatie ?locatieLabel ?instance ?instanceLabel ?layer ?article WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". }
  ?item wdt:P131 wd:Q930249, ?city;
    wikibase:sitelinks ?layer.
  OPTIONAL { ?item wdt:P276 ?locatie. }
  OPTIONAL { ?item wdt:P625 ?geolocatie. }
  OPTIONAL { ?item wdt:P31 ?instance. }
  OPTIONAL {
    ?article schema:about ?item;
      schema:inLanguage "nl";
      schema:isPartOf <https://nl.wikipedia.org/>.
  }
}
ORDER BY (?itemLabel)

Lijst van items in de omgeving edit

List of objects in a range from a certain point in latitude/longitude.

Condition: every object should have a geocoordinate.

The following query uses these:

Features: map (Q24515275)     

#defaultView:Map
# Select all items in a range
SELECT ?item ?itemLabel ?itemDescription ?instanceLabel ?cityLabel ?locationLabel ?distance ?layer ?article ?geolocation WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". }
  SERVICE wikibase:around {
    ?item wdt:P625 ?geolocation.
    bd:serviceParam wikibase:center "Point(4.180303 50.870493)"^^geo:wktLiteral;
      wikibase:radius "5";
      wikibase:distance ?distance.
  }
  ?item wikibase:sitelinks ?layer.
  OPTIONAL { ?item wdt:P31 ?instance. }
  OPTIONAL { ?item wdt:P131 ?city. }
  OPTIONAL { ?item wdt:P276 ?location. }
  OPTIONAL {
    ?article schema:about ?item;
      schema:inLanguage "nl";
      schema:isPartOf <https://nl.wikipedia.org/>.
  }
}
ORDER BY (?distance)
  • You can change the default radius of 5 km

Lijst van items per streek edit

Conditions:

  1. the object should be registered in a municipality (gemeente)
  2. the municipality should belong to a geographical region

The following query uses these:

Features: map (Q24515275)     

#defaultView:Map
# Select all items in a region
SELECT ?item ?itemLabel ?itemDescription ?city ?cityLabel ?locatie ?locatieLabel ?instance ?instanceLabel ?streekLabel ?geolocatie ?layer ?article WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". }
  ?item wdt:P131 ?city;
    wikibase:sitelinks ?layer.
  ?city wdt:P706 wd:Q640303, ?streek.
  OPTIONAL { ?item wdt:P276 ?locatie. }
  OPTIONAL { ?item wdt:P625 ?geolocatie. }
  OPTIONAL { ?item wdt:P31 ?instance. }
  OPTIONAL {
    ?article schema:about ?item;
      schema:inLanguage "nl";
      schema:isPartOf <https://nl.wikipedia.org/>.
  }
}
ORDER BY (?itemLabel)
Question
how to make the union query to include both?
By using a UNION query.

Bunkerlinies edit

Oplijsten van bunker-linies edit

Conditions: A bunker (Q91122) requires (two levels of) part of (P361) KW Line (Q2616577) (cascading relationship). Every bunker (Q91122) should only have one single part of (P361). You can add the missing bunkers with Wikidata.

The following query uses these:

Features: map (Q24515275)     

#defaultView:Map
# Select all items in a group
SELECT ?item ?itemLabel ?itemDescription ?partof ?partofLabel ?city ?cityLabel ?locatie ?locatieLabel ?instance ?instanceLabel ?groupLabel ?geolocatie ?layer ?article WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". }
  ?item wdt:P361 ?partof;
    wikibase:sitelinks ?layer.
  ?partof wdt:P361 wd:Q2616577, ?group.
  OPTIONAL { ?item wdt:P31 ?instance. }
  OPTIONAL { ?item wdt:P131 ?city. }
  OPTIONAL { ?item wdt:P276 ?locatie. }
  OPTIONAL { ?item wdt:P625 ?geolocatie. }
  OPTIONAL {
    ?article schema:about ?item;
      schema:inLanguage "nl";
      schema:isPartOf <https://nl.wikipedia.org/>.
  }
}
ORDER BY (?itemLabel)

Lijst van alle bunkers edit

All bunkers world-wide.

The following query uses these:

Features: map (Q24515275)     

#defaultView:Map
# Select all bunkers
SELECT ?item ?itemLabel ?itemDescription ?itemAlias ?partof ?partofLabel ?city ?cityLabel ?place ?placeLabel ?instance ?instanceLabel ?regionLabel ?layerLabel ?geolocation ?linkcount ?article WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". }
  ?item wdt:P31 wd:Q91122, ?instance;
    wikibase:sitelinks ?linkcount.
  OPTIONAL { ?item wdt:P17 ?country, ?layer. }
  OPTIONAL { ?item wdt:P131 ?city. }
  OPTIONAL { ?item wdt:P276 ?place. }
  OPTIONAL { ?item wdt:P361 ?partof. }
  OPTIONAL { ?item wdt:P625 ?geolocation. }
  OPTIONAL { ?item wdt:P706 ?region. }
  OPTIONAL {
    ?item skos:altLabel ?itemAlias.
    FILTER((LANG(?itemAlias)) = "nl")
  }
  OPTIONAL {
    ?article schema:about ?item;
      schema:inLanguage "nl";
      schema:isPartOf <https://nl.wikipedia.org/>.
  }
}
ORDER BY (?layerLabel)

Subklassen van fortificaties edit

The following query uses these:

  • Properties: subclass of (P279)     
    SELECT ?item ?itemLabel ?itemDescription ?itemAlias WHERE {
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". }
      ?item (wdt:P279) wd:Q57821.
      OPTIONAL { ?item skos:altLabel ?itemAlias.
            FILTER((LANG(?itemAlias)) = "nl")   }
    }
    ORDER BY (?itemLabel)
    

Subklassen van verdedigingswerken edit

The following query uses these:

  • Properties: subclass of (P279)     
    SELECT ?item ?itemLabel ?itemDescription ?itemAlias WHERE {
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". }
      ?item (wdt:P279) wd:Q2611489.
      OPTIONAL { ?item skos:altLabel ?itemAlias.
            FILTER((LANG(?itemAlias)) = "nl")   }
    }
    ORDER BY (?itemLabel)
    

Persons edit

Lijst van personen geboren in de streek edit

The following query uses these:

Lijst van personen overleden in de streek edit

The following query uses these:

Lijst van personen woonachtig in de streek edit

The following query uses these:

Lijst van personen werkzaam in de streek edit

The following query uses these:

Diverse lists edit

List of immaterial heritage edit

The following query uses these:

  • Properties: location (P276)     , instance of (P31)     , located in/on physical feature (P706)     , located in the administrative territorial entity (P131)     
    # Immaterial heritage
    SELECT ?item ?itemLabel ?itemDescription ?instanceLabel ?cityLabel ?placeLabel ?regionLabel WHERE {
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". }
      BIND(wd:Q640303 AS ?region)
      ?item wdt:P276 ?place.
    
      { ?item wdt:P31 wd:Q59544. }
      UNION
      { ?item wdt:P31 wd:Q77430579. }
      UNION
      { ?item wdt:P31 wd:Q11483816. }
    
      { ?place wdt:P706 ?region. }
      UNION
      {
        ?place wdt:P131 ?city.
        ?city wdt:P706 ?region.
      }
    
      OPTIONAL { ?item wdt:P31 ?instance. }
    }
    ORDER BY (?itemLabel)
    

List of regional products edit

The following query uses these:

  • Properties: instance of (P31)     , made from material (P186)     , country of origin (P495)     , location of creation (P1071)     
    # Alle streekproducten
    SELECT DISTINCT ?item ?itemLabel ?itemDescription ?itemAlias ?madeofLabel ?regionLabel ?countryLabel WHERE {
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". }
      ?item wdt:P31 wd:Q2185963.
      OPTIONAL { ?item wdt:P186 ?madeof. }
      OPTIONAL { ?item wdt:P495 ?country. }
      OPTIONAL { ?item wdt:P1071 ?region. }
      OPTIONAL {
        ?item skos:altLabel ?itemAlias.
        FILTER((LANG(?itemAlias)) = "nl")
      }
    }
    ORDER BY (?itemLabel)
    

List of regional products in Pajotteland-Zennevallei edit

More complex query using UNION:

The following query uses these:

  • Properties: instance of (P31)     , location of creation (P1071)     , made from material (P186)     , country of origin (P495)     , fabrication method (P2079)     
    # Streekproducten uit Pajottenland-Zennevallei
    SELECT DISTINCT ?item ?itemLabel ?itemDescription ?itemAlias ?madeofLabel ?processLabel ?regionLabel ?countryLabel WHERE {
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". }
      ?item wdt:P31 wd:Q2185963.
      { ?item wdt:P1071 wd:Q640303, ?region. }
      UNION
      { ?item wdt:P1071 wd:Q1882768, ?region. }
      OPTIONAL { ?item wdt:P186 ?madeof. }
      OPTIONAL { ?item wdt:P495 ?country. }
      OPTIONAL { ?item wdt:P2079 ?process. }
      OPTIONAL {
        ?item skos:altLabel ?itemAlias.
        FILTER((LANG(?itemAlias)) = "nl")
      }
    }
    ORDER BY (?itemLabel)
    

Simpler query using VALUES:

The following query uses these:

  • Properties: instance of (P31)     , location of creation (P1071)     , made from material (P186)     , country of origin (P495)     , fabrication method (P2079)     
    # Streekproducten uit Pajottenland-Zennevallei
    SELECT DISTINCT ?item ?itemLabel ?itemDescription ?itemAlias ?madeofLabel ?processLabel ?regionLabel ?countryLabel WHERE {
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". }
      VALUES ?region { wd:Q640303 wd:Q1882768 }
      ?item wdt:P31 wd:Q2185963;
        wdt:P1071 wd:Q640303, ?region.
      OPTIONAL { ?item wdt:P186 ?madeof. }
      OPTIONAL { ?item wdt:P495 ?country. }
      OPTIONAL { ?item wdt:P2079 ?process. }
      OPTIONAL {
        ?item skos:altLabel ?itemAlias.
        FILTER((LANG(?itemAlias)) = "nl")
      }
    }
    ORDER BY (?itemLabel)
    

Notes:

Lijst van gemeenten in een streek edit

The following query uses these:

  • Properties: located in/on physical feature (P706)     
    # Lijst van gemeenten in een streek
    SELECT DISTINCT ?city ?cityLabel WHERE {
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". }
      ?city wdt:P706 wd:Q640303.
    }
    

Maintenance queries edit

Add missing country codes edit

A located in the administrative territorial entity (P131) requires a country (P17). You can automatically add the missing country with QuickStatements.

The following query uses these:

  • Properties: located in the administrative territorial entity (P131)     , located in/on physical feature (P706)     , country (P17)     , instance of (P31)     , location (P276)     , coordinate location (P625)     
    # Select all items in a region without Country
    SELECT ?item ?itemLabel ?itemDescription ?city ?cityLabel ?locatie ?locatieLabel ?country ?countryLabel ?instance ?instanceLabel ?streekLabel ?geolocatie ?layer ?article WHERE {
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],nl,fr,de,en,es,it,no,se,fi". }
      ?item wdt:P131 ?city;
        wikibase:sitelinks ?layer.
      ?city wdt:P706 wd:Q1882768, ?streek.
      MINUS { ?item wdt:P17 ?country. }
      OPTIONAL { ?item wdt:P31 ?instance. }
      OPTIONAL { ?item wdt:P276 ?locatie. }
      OPTIONAL { ?item wdt:P625 ?geolocatie. }
      OPTIONAL {
        ?article schema:about ?item;
          schema:inLanguage "nl";
          schema:isPartOf <https://nl.wikipedia.org/>.
      }
    }
    ORDER BY (?itemLabel)
    

Add missing municipality edit

A location (P276) requires a located in the administrative territorial entity (P131). You can automatically add the missing municipality with QuickStatements.

The following query uses these:

Caveat
  • Remove illogical data
  • Filter duplicate transactions

WDFIST query: Objects in geographic region edit

The following query uses these:

Functionality edit

  • add missing items
  • identify items without Wikipedia page
  • identify items without photo's
  • correct wrong city or location (gemeente/deelgemeente: located in the administrative territorial entity (P131)/location (P276))
  • items without coordinates
  • items with duplicate or erroneous geographical coordinates
  • items without Labels
  • add missing Descriptions
  • items with multiple instances ("is an")
  • items without "is an"
  • merging duplicate items
  • add missing statements
  • remove/correct wrong statements
  • remove exclusive relationships
  • add missing relationships
  • correct wrong relationships
  • remove overlapping relationships
  • items without photo's (WDFIST/FIST)
  • unregister redundant photo's

Zie ook edit

Wikipedia
Wikidata
Wikimedia Commons
Project pages
Related projects
Wikimedia tools