User:TweetsFactsAndQueries/Queries/editorial cartoons

From Wikidata
Jump to navigation Jump to search

Originally posted on Twitter and on Mastodon.

SELECT ?cartoon ?cartoonLabel (SAMPLE(?image_) AS ?image) (MAX(?date_) AS ?date) WHERE {
  ?cartoon wdt:P31/wdt:P279* wd:Q2916094.
  OPTIONAL { ?cartoon wdt:P18 ?image_. }
  OPTIONAL { ?cartoon wdt:P571|wdt:P577 ?date_. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?cartoon ?cartoonLabel
ORDER BY ?date

Try it!