User:Stefan Kühn/Postcards

Postcards as object in Wikidata edit

#-----------------------------------------------------
# Postcards as object in Wikidata
#-----------------------------------------------------
#defaultView:ImageGrid,Table
SELECT ?item ?itemLabel ?itemDescription ?image 
WHERE
{
    ?item wdt:P31 wd:Q192425 .            # instance of postcards
    OPTIONAL { ?item wdt:P18 ?image. }    # image
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de". }
}
#order by ?itemLabel
Try it!


Types of postcard edit

#-----------------------------------------------------
# Types of postcard
#-----------------------------------------------------
#defaultView:Table,ImageGrid
SELECT ?item ?itemLabel ?itemDescription ?image 
WHERE
{
    ?item wdt:P279+ wd:Q192425 .          # subclass of postcards
    OPTIONAL { ?item wdt:P18 ?image. }    # image
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de". }
}
#order by ?itemLabel
Try it!

Postcard collectors / deltiologist edit

#-----------------------------------------------------
# deltiologist / postcard collectors
#-----------------------------------------------------
PREFIX schema: <http://schema.org/>
#defaultView:Table,ImageGrid
SELECT ?item ?itemLabel ?itemDescription ?image ?article_en ?article_de 
WHERE
{
    ?item wdt:P106 wd:Q59273465 .    # subclass of postcards
   
  OPTIONAL { ?item wdt:P18 ?image. }    # image
  OPTIONAL {
    ?article_en schema:about ?item.
    ?article_en schema:isPartOf <https://en.wikipedia.org/>.
  }
  OPTIONAL {
    ?article_de schema:about ?item.
    ?article_de schema:isPartOf <https://de.wikipedia.org/>.
  }   
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de". }
}
#order by ?itemLabel
Try it!

Postcard publisher (company) edit

#-----------------------------------------------------
# Postcard publisher (company)
#-----------------------------------------------------
PREFIX schema: <http://schema.org/>
#defaultView:Table,ImageGrid
SELECT ?item ?itemLabel ?itemDescription ?headquarterLabel ?countryLabel ?image ?logo ?article_en ?article_de 
WHERE
{
  ?item wdt:P31 wd:Q81529763 .                 # is a postcard publisher
   
  OPTIONAL { ?item wdt:P18  ?image. }          # image
  OPTIONAL { ?item wdt:P154 ?logo. }           # logo
  OPTIONAL { ?item wdt:P159 ?headquarter. }    # headquarter location
  OPTIONAL { ?item wdt:P17  ?country. }        # country

  OPTIONAL {                                   # article at en.wikipedia.org 
    ?article_en schema:about ?item.
    ?article_en schema:isPartOf <https://en.wikipedia.org/>.
  }
  OPTIONAL {                                   # article at de.wikipedia.org 
    ?article_de schema:about ?item.
    ?article_de schema:isPartOf <https://de.wikipedia.org/>.
  }   
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de". }
}
order by ?itemLabel
Try it!

Postcard publisher (person) edit

#-----------------------------------------------------
# Postcard publisher (person)
#-----------------------------------------------------
PREFIX schema: <http://schema.org/>
#defaultView:Table,ImageGrid
SELECT ?item ?itemLabel ?itemDescription ?countryLabel ?image ?article_en ?article_de 
WHERE
{
  ?item wdt:P106 wd:Q84473837 .                 # is a postcard publisher (person
   
  OPTIONAL { ?item wdt:P18  ?image. }          # image
  OPTIONAL { ?item wdt:P27  ?country. }        # country
  
  OPTIONAL {                                   # article at en.wikipedia.org 
    ?article_en schema:about ?item.
    ?article_en schema:isPartOf <https://en.wikipedia.org/>.
  }
  OPTIONAL {                                   # article at de.wikipedia.org 
    ?article_de schema:about ?item.
    ?article_de schema:isPartOf <https://de.wikipedia.org/>.
  }   
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de". }
}
order by ?itemLabel
Try it!


Postcard categories in Wikidata edit

#-----------------------------------------------------
# Postcard categories in Wikidata
#-----------------------------------------------------
PREFIX schema: <http://schema.org/>
#defaultView:Table
SELECT ?item ?itemLabel ?itemDescription 
WHERE
{
  ?item wdt:P31 wd:Q4167836 .                 # is a = wikimedia Cateogrie
  ?item wdt:P971 wd:Q192425 .                 # category combines topics = postcard

  # Countries
  #?item wdt:P971 ?country.
  #?country wdt:P31  wd:Q3624078              # sovereign state

  # Cities
  #?item wdt:P971 ?city.
  #?city (wdt:P31/wdt:P279*) wd:Q3257686      # locality
  
   
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de". }
}
#order by ?itemLabel
Try it!

Postcard publishers (country, logo, commons) edit

#-----------------------------------------------------
# Postcard publishers (organisations)
#-----------------------------------------------------
PREFIX schema: <http://schema.org/>
#defaultView:Table;ImageGrid
SELECT ?item ?itemLabel ?itemDescription ?countryLabel ?logo ?commons_cat
WHERE
{
  ?item wdt:P31 wd:Q81529763. # Verlag
  #?item wdt:P31 wd:Q84473837. # Verleger
  OPTIONAL { ?item wdt:P17  ?country. }          # country
  OPTIONAL { ?item wdt:P154 ?logo. }             # image
  OPTIONAL { ?commons_cat 	schema:about ?item ;
           schema:isPartOf <https://commons.wikimedia.org/> . } 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de". }
}
order by ?itemLabel
Try it!