Wikidata:WikiProject Datasets/Queries

From Wikidata
Jump to navigation Jump to search

Home

 

Models

 

Queries

 

Members

 

About

 

Discuss

 

Queries for datasets

[edit]
[edit]
SELECT DISTINCT ?item ?itemLabel ?sitelinks WHERE {
  ?item wdt:P31 wd:Q1172284 ;
        wikibase:sitelinks ?sitelinks .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?sitelinks)
LIMIT 200000
Try it!

List of datasets ordered by count of Wikidata properties

[edit]
SELECT DISTINCT ?property ?propertyLabel ?count
WITH {
  SELECT DISTINCT ?item WHERE {
    ?item wdt:P31*/wdt:P279* wd:Q1172284 .
  }
  LIMIT 200000
  } AS %items 
WITH {
  SELECT DISTINCT ?property (COUNT(*) AS ?count) WHERE {
  INCLUDE %items.
    ?item ?p [ ] .
    ?property a wikibase:Property;
                wikibase:claim ?p.
  }
  GROUP BY ?property
  } AS %results 
WHERE {
  INCLUDE %results.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY DESC(?count)
LIMIT 100
Try it!