Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cites per million in projects can often be converted to a common currency #2569

Open
fnielsen opened this issue Dec 20, 2024 · 0 comments
Open
Labels
enhancement some suggestions to improve Scholia

Comments

@fnielsen
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Cites per million in panel in projects mixup currencies.

Describe the solution you'd like
Cites per million in projects can often be converted to a common currency.

# tool: scholia
SELECT
  (?cites_per_million / ?euro_price AS ?cites_per_million_euro)
  ?cites_per_million
  ?currency ?currencyLabel
  ?citations 
  ?budget 
  ?short_name
  ?project ?projectLabel
WITH {
  SELECT
    (COUNT(?citing_work) / ?budget * 1000000 AS ?cites_per_million)
    (COUNT(?citing_work) AS ?citations)
    ?budget ?currency
    ?project
  WHERE {
    ?project p:P2769 / psv:P2769 ?budget_value ;
             wdt:P17 wd:Q35 .
    ?budget_value wikibase:quantityAmount ?budget .
    ?budget_value wikibase:quantityUnit ?currency .
    ?work wdt:P859 ?project .
    ?citing_work wdt:P2860 ?work .
  } 
  GROUP BY ?project ?budget ?currency
} AS %results
WHERE { 
  INCLUDE %results
  OPTIONAL { ?project wdt:P1813 ?short_name }
  
  OPTIONAL {
    ?currency p:P2284 / psv:P2284 ?price_value .
    ?price_value wikibase:quantityAmount ?euro_price ;
                 wikibase:quantityUnit wd:Q4916 .
  }
  
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" . }
}
ORDER BY DESC(?cites_per_million_euro) DESC(?cites_per_million)

Note there may be multiple prices.

@fnielsen fnielsen added the enhancement some suggestions to improve Scholia label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement some suggestions to improve Scholia
Projects
None yet
Development

No branches or pull requests

1 participant