WDscholia / scholia

Wikidata-based scholarly profiles
https://scholia.toolforge.org
Other
215 stars 77 forks source link

In topic aspect, add panel on co-occurring taxa #1897

Open Daniel-Mietchen opened 2 years ago

Daniel-Mietchen commented 2 years ago

What kind of panel would you like to add to which Scholia aspect?

A table listing taxa that co-occur with the target topic.

What kind of information should the panel provide, and which of the visualization options (e.g. table, bubble chart, map) should it use?

Here is a first draft for a query:

PREFIX target: <http://www.wikidata.org/entity/Q212>

SELECT ?count ?topic ?topicLabel ?example_work ?example_workLabel
WITH {
  SELECT (COUNT(?work) AS ?count) ?topic (SAMPLE(?work) AS ?example_work) WHERE {
    # Find works for the specific queried topic
      ?work wdt:P921/( wdt:P31*/wdt:P279* | wdt:P361+ | wdt:P1269+) target: .

    # Find co-occuring topics
    ?work wdt:P921 ?topic .
    ?topic wdt:P225 ?taxonname .

    # Avoid listing the queried topic
      FILTER (target: != ?topic)
  }
  GROUP BY ?topic
} AS %result
WHERE {
  # Label the results
  INCLUDE %result
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da,de,es,fr,jp,nl,no,ru,sv,zh" . } 
}
ORDER BY DESC(?count)
LIMIT 200

Screenshot 2022-03-08 at 18-09-43 Wikidata Query Service

Which Wikidata entries would be good candidates to explore such visualizations?

Most countries should work (the example above is for Ukraine), as should other rather large geographic entities, or taxa or natural products or habitats.

Anything else?

For cases when the target is a taxon, we should perhaps link to a taxon comparison (which we do not have yet).

Daniel-Mietchen commented 2 years ago

Probably good to combine this with a suitable ASK query.