ckanext-advancedstats is a CKAN plugin that adds additional statistics about the CKAN instance to the landing page.
Currently, the plugin displays the following statistics:
- number of datasets
- number of organizations
- number of groups
- number of resources
- number of Jupyter notebooks
- number of RDF triples
The number of RDF triples corresponds to the number of triples in the knowledge graph serving the metadata of the CKAN instance.
Such a knowledge graph can be maintained with the extension ckanext-kgcreation (https://github.com/SDM-TIB/ckanext-kgcreation).
As usual for CKAN extensions, you can install ckanext-fedorkg as follows:
git clone [email protected]:SDM-TIB/ckanext-advancedstats.git
pip install -e ./ckanext-advancedstats
pip install -r ./ckanext-advancedstats/requirements.txtAfter installing the plugin, add advancedstats to the plugins in your ckan.ini.
If you want to include the number of RDF triples in the knowledge graph containing the metadata of your CKAN instance, set the environment variable CKANEXT__ADVANCEDSTATS__KGURL to the URL where your knowledge graph answers SPARQL queries, e.g.:
CKANEXT__ADVANCEDSTATS__KGURL=https://www.your-site.tld/kg/sparqlckanext-advancedstats stores the statistics in Redis and updates them periodically. The default interval is 30 minutes and can be configured via the environment variable CKANEXT__ADVANCEDSTATS__INTERVAL, e.g.:
CKANEXT__ADVANCEDSTATS__INTERVAL=30The connection string for Redis is read from the CKAN configuration option CKAN_REDIS_URL which should already be set in most CKAN instances.
If you are already displaying the default stats, then ckanext-advancedstats is a drop-in replacement, i.e., the plugin will work out-of-the-box and there is nothing you need to do.
In the case you are not yet displaying the stats, or you are using a customized landing page, you can add the stats by including the following code in your landing page template.
{% block stats %}
{% snippet 'home/snippets/stats.html' %}
{% endblock %}
If you are interested in what has changed, check out the changelog.
ckanext-advancedstats is licensed under AGPL-3.0, see the license file.