WDscholia / scholia

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

citation by year for topic #794

Open egonw opened 5 years ago

egonw commented 5 years ago

I created a query for this, which also reports on citing articles being about the same topic:

#defaultView:BarChart
SELECT ?year (count(distinct ?citing_work) as ?count) ?kind WITH {
  SELECT DISTINCT ?work WHERE {
    ?work wdt:P921 / (wdt:P361+ | wdt:P1269+ | (wdt:P31* / wdt:P279*) ) wd:Q2383032 .
  }
} AS %works
WITH {
  SELECT DISTINCT ?citing_same_topic WHERE {
    INCLUDE %works
    ?citing_same_topic wdt:P2860 ?work ;
                  wdt:P921 / (wdt:P361+ | wdt:P1269+ | (wdt:P31* / wdt:P279*) ) wd:Q2383032 .
  }
} AS %citingworks
WHERE {
  INCLUDE %works
  INCLUDE %citingworks
  ?citing_work wdt:P2860 ?work .
  bind(if (?citing_work = ?citing_same_topic, "citations on same topic", "citations about other topics") as ?kind)
  ?citing_work wdt:P577 ?date .
  BIND(str(YEAR(?date)) AS ?year)
} group by ?year ?kind
  order by desc(?year)

Shall I make a patch for this for the /topic/ aspect?

fnielsen commented 5 years ago

It is an expensive query. "machine learning" abd "biophysics" do not complete.

I am wondering whether there is a possibility to optimize the query.

egonw commented 5 years ago

Maybe if we catch the topics first?

egonw commented 5 years ago

nope. that doesn't seem to help