Wikidata:Synia:orcid-index

From Wikidata
Jump to navigation Jump to search

Synia: ORCID

[edit]
SELECT 
  ?identifier ?identifierLabel ?identifierDescription
  ?number_of_orcids
WITH {  
  SELECT 
    (COUNT(*) AS ?number_of_orcids)
  WHERE {
    [] wdt:P496 []
  }
} AS %count
WHERE {
  INCLUDE %count
  BIND(wd:Q51044 AS ?identifier)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Try it!

Occupations (sample)

[edit]
SELECT
  (?number_of_persons / ?total AS ?fraction) 
  ?occupation ?occupationLabel ?occupationDescription
WITH {
  SELECT 
    ?person
  WHERE {
    ?person wdt:P496 [] .
  }
  LIMIT 10000
} AS %persons
WITH {
  SELECT 
    (COUNT(?person) AS ?number_of_persons)
    ?occupation
  WHERE {
    INCLUDE %persons
    ?person wdt:P106 ?occupation .
  }
  GROUP BY ?occupation
} AS %counts
WITH {
  SELECT 
    (SUM(?number_of_persons) AS ?total)
  WHERE {
    INCLUDE %counts
    BIND(1 AS ?dummy)
  }
  GROUP BY ?dummy
} AS %total
WHERE {
  INCLUDE %counts
  INCLUDE %total
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?number_of_persons)
Try it!