Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marco-brandizi/b70c3e7d9a5544779bb2c1907ce3f1ea to your computer and use it in GitHub Desktop.
Save marco-brandizi/b70c3e7d9a5544779bb2c1907ce3f1ea to your computer and use it in GitHub Desktop.
Count the data sources

Counts the data sources used in the wheat dataset. Try it here.

PREFIX bk: <http://knetminer.org/data/rdf/terms/biokno/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bkg: <http://knetminer.org/data/rdf/resources/graphs/>

SELECT DISTINCT ?dataSource (COUNT (DISTINCT ?e) AS ?resources)
FROM bkg:wheat
{
 ?e bk:dataSource ?ds.
 ?ds rdfs:label ?dataSource
}
GROUP BY ?dataSource
ORDER BY DESC ( ?resources )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment