Newer
Older
DataReport / dataset-stats / size.ipynb
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Gather some statistics about the datasets, vocabularies and codelists loaded into PMD."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from SPARQLWrapper import SPARQLWrapper2\n",
    "import pandas as pd\n",
    "from IPython.display import HTML\n",
    "\n",
    "endpoint = \"https://production-drafter-ons-alpha.publishmydata.com/v1/sparql/live\"\n",
    "sparql = SPARQLWrapper2(endpoint)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Find the distinct datasets"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Label</th>\n",
       "      <th>Graph</th>\n",
       "      <th>Family</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/ons-pink-book-chapter-3</th>\n",
       "      <td>ONS Pink Book Chapter 3</td>\n",
       "      <td>http://gss-data.org.uk/graph/ons-pink-book-cha...</td>\n",
       "      <td>Trade</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/ons-bop-individual-country-data</th>\n",
       "      <td>ONS BoP Individual Country Data</td>\n",
       "      <td>http://gss-data.org.uk/graph/ons-bop-individua...</td>\n",
       "      <td>Trade</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/nisra-ni-migration-estimates</th>\n",
       "      <td>Mid-Year Population Estimates</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/migratio...</td>\n",
       "      <td>Migration</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/scotland-overseas</th>\n",
       "      <td>Migration between Scotland and Overseas</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/migratio...</td>\n",
       "      <td>Migration</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/dwp-nin-registrations-to-overseas-nationals</th>\n",
       "      <td>National Insurance number allocations to adult...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/migratio...</td>\n",
       "      <td>Migration</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-local-area-migration-indicators</th>\n",
       "      <td>Local area migration indicators, UK</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/migratio...</td>\n",
       "      <td>Migration</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-age-and-sex</th>\n",
       "      <td>Long-term international migration 2.07, age an...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/migratio...</td>\n",
       "      <td>Migration</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-uk-destination-or-origin</th>\n",
       "      <td>Long-term international migration 2.06, area o...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/migratio...</td>\n",
       "      <td>Migration</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-citizenship</th>\n",
       "      <td>Long-term international migration 2.01a, citiz...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/migratio...</td>\n",
       "      <td>Migration</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-country-of-residence</th>\n",
       "      <td>Long-term international migration 2.02, countr...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/migratio...</td>\n",
       "      <td>Migration</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-occupation</th>\n",
       "      <td>Long-term international migration 2.05, usual ...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/migratio...</td>\n",
       "      <td>Migration</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-reason-for-migration</th>\n",
       "      <td>Long-term international migration 2.04, main r...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/migratio...</td>\n",
       "      <td>Migration</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-passenger-survey-4-02</th>\n",
       "      <td>International Passenger Survey 4.02, main reas...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/migratio...</td>\n",
       "      <td>Migration</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-passenger-survey-4-04</th>\n",
       "      <td>International Passenger Survey 4.04, area of d...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/migratio...</td>\n",
       "      <td>Migration</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-passenger-survey-4-01</th>\n",
       "      <td>International Passenger Survey 4.01, citizensh...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/migratio...</td>\n",
       "      <td>Migration</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ho-entry-visas</th>\n",
       "      <td>Immigration statistics, October to December 20...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/migratio...</td>\n",
       "      <td>Migration</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/health/hmrc_alcohol_bulletin</th>\n",
       "      <td>Alcohol Duty</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/health/h...</td>\n",
       "      <td>Health</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/health/doh-ni-drug-alcohol-treatment-services</th>\n",
       "      <td>Census of drug and alcohol treatment services ...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/health/d...</td>\n",
       "      <td>Health</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons_bop</th>\n",
       "      <td>Balance of payments</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/trade/on...</td>\n",
       "      <td>Trade</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/health/ons_alcohol_deaths_uk</th>\n",
       "      <td>Alcohol-specific deaths in the UK</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/health/o...</td>\n",
       "      <td>Health</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/hmrc_trade</th>\n",
       "      <td>UK Trade in Goods by Business Characteristics ...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/trade/hm...</td>\n",
       "      <td>Trade</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons-trade-in-goods</th>\n",
       "      <td>Trade in goods: country-by-commodity imports a...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/trade/on...</td>\n",
       "      <td>Trade</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons-uk-trade-in-services</th>\n",
       "      <td>UK trade in services: service type by partner ...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/trade/on...</td>\n",
       "      <td>Trade</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons_mrets</th>\n",
       "      <td>UK trade time series</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/trade/on...</td>\n",
       "      <td>Trade</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons_abs</th>\n",
       "      <td>Annual Business Survey importers and exporters</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/trade/on...</td>\n",
       "      <td>Trade</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons-fdi</th>\n",
       "      <td>Foreign direct investment involving UK companies</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/trade/on...</td>\n",
       "      <td>Trade</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons-international-trade-in-services</th>\n",
       "      <td>International trade in services</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/trade/on...</td>\n",
       "      <td>Trade</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/hmrc_rts</th>\n",
       "      <td>UK Regional Trade Statistics (RTS</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/trade/hm...</td>\n",
       "      <td>Trade</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons_cpa</th>\n",
       "      <td>UK trade in goods by classification of product...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/trade/on...</td>\n",
       "      <td>Trade</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons-reuk-service</th>\n",
       "      <td>Regionalised estimates of UK service exports</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/trade/on...</td>\n",
       "      <td>Trade</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues-district-ua-deprivation-deciles-in-england-imd2015-419-geog</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues-district-ua-deprivation-deciles-in-england-imd2019-419-geog</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues-district-ua-pre-apr2019-deprivation-deciles-in-england-imd2015</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues-ethnic-groups</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues-health-status</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues-lsoa11-deprivation-deciles-in-england-imd2015</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues-religion-8-categories</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues-sexuality-5-categories</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues-socioeconomic-group-18-64-yrs</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/sg-homelessness-in-scotland-annual-publication/homelessness-in-scotland-applications-main-reason-for-making-an-application-for-homelenessness-to-a-local-authority</th>\n",
       "      <td>Homelessness in Scotland: Applications: Main r...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/sg-homelessness-in-scotland-annual-publication/homelessness-in-scotland-applications-reasons-for-failing-to-maintain-accommodation-prior-to-application</th>\n",
       "      <td>Homelessness in Scotland: Applications: Reason...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/sg-homelessness-in-scotland-annual-publication/homelessness-in-scotland-applications-support-need-identified-for-those-homeless-or-threatened-with-homelessness-households</th>\n",
       "      <td>Homelessness in Scotland: Applications: Suppor...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/sg-homelessness-in-scotland-annual-publication/homelessness-in-scotland-identified-support-needs-of-homeless-households</th>\n",
       "      <td>Homelessness in Scotland: Identified Support N...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/sg-homelessness-in-scotland-annual-publication/homelessness-in-scotland-reason-for-failing-to-maintain-accommodation</th>\n",
       "      <td>Homelessness in Scotland: Reason(s) for failin...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/country-of-birth</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/county-ua-deprivation-deciles-in-england-imd2010</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/county-ua-deprivation-deciles-in-england-imd2015-419-geog</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/county-ua-deprivation-deciles-in-england-imd2019-419-geog</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/county-ua-pre-apr2019-deprivation-deciles-in-england-imd2015</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-deprivation-deciles-in-england-imd2010</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-deprivation-deciles-in-england-imd2015-419-geog</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-deprivation-deciles-in-england-imd2019-419-geog</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-pre-apr2019-deprivation-deciles-in-england-imd2015</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/ethnic-groups</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/health-status</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/lsoa11-deprivation-deciles-in-england-imd2015</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/religion-8-categories</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/sexuality-5-categories</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/socioeconomic-group-18-64-yrs</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>http://gss-data.org.uk/graph/gss_data/disabili...</td>\n",
       "      <td>Disability</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>94 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                Label  \\\n",
       "http://gss-data.org.uk/data/ons-pink-book-chapt...                            ONS Pink Book Chapter 3   \n",
       "http://gss-data.org.uk/data/ons-bop-individual-...                    ONS BoP Individual Country Data   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...                      Mid-Year Population Estimates   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...            Migration between Scotland and Overseas   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  National Insurance number allocations to adult...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...                Local area migration indicators, UK   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  Long-term international migration 2.07, age an...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  Long-term international migration 2.06, area o...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  Long-term international migration 2.01a, citiz...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  Long-term international migration 2.02, countr...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  Long-term international migration 2.05, usual ...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  Long-term international migration 2.04, main r...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  International Passenger Survey 4.02, main reas...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  International Passenger Survey 4.04, area of d...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  International Passenger Survey 4.01, citizensh...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  Immigration statistics, October to December 20...   \n",
       "http://gss-data.org.uk/data/gss_data/health/hmr...                                       Alcohol Duty   \n",
       "http://gss-data.org.uk/data/gss_data/health/doh...  Census of drug and alcohol treatment services ...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_bop                                Balance of payments   \n",
       "http://gss-data.org.uk/data/gss_data/health/ons...                  Alcohol-specific deaths in the UK   \n",
       "http://gss-data.org.uk/data/gss_data/trade/hmrc...  UK Trade in Goods by Business Characteristics ...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...  Trade in goods: country-by-commodity imports a...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...  UK trade in services: service type by partner ...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_...                               UK trade time series   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_abs     Annual Business Survey importers and exporters   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-fdi   Foreign direct investment involving UK companies   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...                    International trade in services   \n",
       "http://gss-data.org.uk/data/gss_data/trade/hmrc...                  UK Regional Trade Statistics (RTS   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_cpa  UK trade in goods by classification of product...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...       Regionalised estimates of UK service exports   \n",
       "...                                                                                               ...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Homelessness in Scotland: Applications: Main r...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Homelessness in Scotland: Applications: Reason...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Homelessness in Scotland: Applications: Suppor...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Homelessness in Scotland: Identified Support N...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Homelessness in Scotland: Reason(s) for failin...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "\n",
       "                                                                                                Graph  \\\n",
       "http://gss-data.org.uk/data/ons-pink-book-chapt...  http://gss-data.org.uk/graph/ons-pink-book-cha...   \n",
       "http://gss-data.org.uk/data/ons-bop-individual-...  http://gss-data.org.uk/graph/ons-bop-individua...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  http://gss-data.org.uk/graph/gss_data/migratio...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  http://gss-data.org.uk/graph/gss_data/migratio...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  http://gss-data.org.uk/graph/gss_data/migratio...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  http://gss-data.org.uk/graph/gss_data/migratio...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  http://gss-data.org.uk/graph/gss_data/migratio...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  http://gss-data.org.uk/graph/gss_data/migratio...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  http://gss-data.org.uk/graph/gss_data/migratio...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  http://gss-data.org.uk/graph/gss_data/migratio...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  http://gss-data.org.uk/graph/gss_data/migratio...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  http://gss-data.org.uk/graph/gss_data/migratio...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  http://gss-data.org.uk/graph/gss_data/migratio...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  http://gss-data.org.uk/graph/gss_data/migratio...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  http://gss-data.org.uk/graph/gss_data/migratio...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  http://gss-data.org.uk/graph/gss_data/migratio...   \n",
       "http://gss-data.org.uk/data/gss_data/health/hmr...  http://gss-data.org.uk/graph/gss_data/health/h...   \n",
       "http://gss-data.org.uk/data/gss_data/health/doh...  http://gss-data.org.uk/graph/gss_data/health/d...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_bop  http://gss-data.org.uk/graph/gss_data/trade/on...   \n",
       "http://gss-data.org.uk/data/gss_data/health/ons...  http://gss-data.org.uk/graph/gss_data/health/o...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/hmrc...  http://gss-data.org.uk/graph/gss_data/trade/hm...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...  http://gss-data.org.uk/graph/gss_data/trade/on...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...  http://gss-data.org.uk/graph/gss_data/trade/on...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_...  http://gss-data.org.uk/graph/gss_data/trade/on...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_abs  http://gss-data.org.uk/graph/gss_data/trade/on...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-fdi  http://gss-data.org.uk/graph/gss_data/trade/on...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...  http://gss-data.org.uk/graph/gss_data/trade/on...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/hmrc...  http://gss-data.org.uk/graph/gss_data/trade/hm...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_cpa  http://gss-data.org.uk/graph/gss_data/trade/on...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...  http://gss-data.org.uk/graph/gss_data/trade/on...   \n",
       "...                                                                                               ...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  http://gss-data.org.uk/graph/gss_data/disabili...   \n",
       "\n",
       "                                                        Family  \n",
       "http://gss-data.org.uk/data/ons-pink-book-chapt...       Trade  \n",
       "http://gss-data.org.uk/data/ons-bop-individual-...       Trade  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration  \n",
       "http://gss-data.org.uk/data/gss_data/health/hmr...      Health  \n",
       "http://gss-data.org.uk/data/gss_data/health/doh...      Health  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_bop       Trade  \n",
       "http://gss-data.org.uk/data/gss_data/health/ons...      Health  \n",
       "http://gss-data.org.uk/data/gss_data/trade/hmrc...       Trade  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...       Trade  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...       Trade  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_...       Trade  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_abs       Trade  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-fdi       Trade  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...       Trade  \n",
       "http://gss-data.org.uk/data/gss_data/trade/hmrc...       Trade  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_cpa       Trade  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...       Trade  \n",
       "...                                                        ...  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability  \n",
       "\n",
       "[94 rows x 3 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sparql.setQuery(\"\"\"\n",
    "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n",
    "PREFIX qb:   <http://purl.org/linked-data/cube#>\n",
    "PREFIX pmd:  <http://publishmydata.com/def/dataset#>\n",
    "PREFIX gdp:  <http://gss-data.org.uk/def/gdp#>\n",
    "\n",
    "SELECT DISTINCT ?dataset ?datasetLabel ?graph ?family\n",
    "WHERE {\n",
    "  ?dataset a qb:DataSet ;\n",
    "         rdfs:label ?datasetLabel ;\n",
    "         pmd:graph ?graph .\n",
    "  OPTIONAL {\n",
    "    ?dataset gdp:family [rdfs:label ?family]\n",
    "  }\n",
    "}\n",
    "\"\"\")\n",
    "\n",
    "results = sparql.query().bindings\n",
    "\n",
    "table = pd.DataFrame()\n",
    "table['Label'] = pd.Series({\n",
    "    res['dataset'].value: res['datasetLabel'].value\n",
    "    for res in results\n",
    "})\n",
    "\n",
    "table['Graph'] = pd.Series({\n",
    "    res['dataset'].value: res['graph'].value\n",
    "    for res in results\n",
    "})\n",
    "\n",
    "table['Family'] = pd.Series({\n",
    "    res['dataset'].value: res['family'].value if 'family' in res else 'Trade'\n",
    "    for res in results\n",
    "})\n",
    "table"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Find the sizes of the graphs."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Triples</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>http://purl.org/dc/terms/</th>\n",
       "      <td>866</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/cpav2008-cpav21</th>\n",
       "      <td>28071</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/cpav2008</th>\n",
       "      <td>47707</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/cpav21</th>\n",
       "      <td>44275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/cpcv11</th>\n",
       "      <td>29269</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/cpcv2</th>\n",
       "      <td>44159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/cpcv21</th>\n",
       "      <td>36837</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/cpcv11-cpcv2</th>\n",
       "      <td>15202</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/cpcv2-cpcv21</th>\n",
       "      <td>14788</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/isicr31</th>\n",
       "      <td>5438</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/isicr31-cpcv11</th>\n",
       "      <td>13350</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/isicr31-isicr4</th>\n",
       "      <td>4116</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/isicr4</th>\n",
       "      <td>9249</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/isicr4-cpcv21</th>\n",
       "      <td>13320</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/isicr4-cpcv2</th>\n",
       "      <td>12305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/isicr4-nacer2</th>\n",
       "      <td>4311</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/isicr4-naics2012</th>\n",
       "      <td>7591</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/nacer11</th>\n",
       "      <td>9605</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/nacer2</th>\n",
       "      <td>12806</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/nacer2-cpav21</th>\n",
       "      <td>16066</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/nacer2-cpav2008</th>\n",
       "      <td>15716</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/nacer11-nacer2</th>\n",
       "      <td>5096</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/semstats/naics2012</th>\n",
       "      <td>17756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://xmlns.com/foaf/0.1/</th>\n",
       "      <td>631</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://publishmydata.com/graph/vocabulary/22-rdf-syntax-ns</th>\n",
       "      <td>102</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://publishmydata.com/graph/vocabulary/admingeo</th>\n",
       "      <td>3369</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://publishmydata.com/graph/vocabulary/sdmx</th>\n",
       "      <td>120</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://publishmydata.com/graph/vocabulary/skos</th>\n",
       "      <td>273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://publishmydata.com/graph/vocabulary/sdmx-subject</th>\n",
       "      <td>295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://publishmydata.com/graph/vocabulary/statistical-quality</th>\n",
       "      <td>32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/county-ua-deprivation-deciles-in-england-imd2015-419-geog/metadata</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/county-ua-deprivation-deciles-in-england-imd2015-419-geog</th>\n",
       "      <td>8964</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/county-ua-deprivation-deciles-in-england-imd2019-419-geog/metadata</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/county-ua-deprivation-deciles-in-england-imd2019-419-geog</th>\n",
       "      <td>17376</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/county-ua-pre-apr2019-deprivation-deciles-in-england-imd2015/metadata</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/county-ua-pre-apr2019-deprivation-deciles-in-england-imd2015</th>\n",
       "      <td>38862</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-deprivation-deciles-in-england-imd2010/metadata</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-deprivation-deciles-in-england-imd2010</th>\n",
       "      <td>2059</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-deprivation-deciles-in-england-imd2015-419-geog/metadata</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-deprivation-deciles-in-england-imd2015-419-geog</th>\n",
       "      <td>2783</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-deprivation-deciles-in-england-imd2019-419-geog/metadata</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-deprivation-deciles-in-england-imd2019-419-geog</th>\n",
       "      <td>11199</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-pre-apr2019-deprivation-deciles-in-england-imd2015/metadata</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-pre-apr2019-deprivation-deciles-in-england-imd2015</th>\n",
       "      <td>28329</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/ethnic-groups/metadata</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/ethnic-groups</th>\n",
       "      <td>810</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/health-status/metadata</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/health-status</th>\n",
       "      <td>270</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/lsoa11-deprivation-deciles-in-england-imd2015/metadata</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/lsoa11-deprivation-deciles-in-england-imd2015</th>\n",
       "      <td>862</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/religion-8-categories/metadata</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/religion-8-categories</th>\n",
       "      <td>810</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/sexuality-5-categories/metadata</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/sexuality-5-categories</th>\n",
       "      <td>113</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/socioeconomic-group-18-64-yrs/metadata</th>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/socioeconomic-group-18-64-yrs</th>\n",
       "      <td>62889</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/uncategorised</th>\n",
       "      <td>775784</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/uncategorised/metadata</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/dwp-frs-people</th>\n",
       "      <td>27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/graph/phe-group</th>\n",
       "      <td>51</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>540 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                    Triples\n",
       "http://purl.org/dc/terms/                               866\n",
       "http://gss-data.org.uk/graph/semstats/cpav2008-...    28071\n",
       "http://gss-data.org.uk/graph/semstats/cpav2008        47707\n",
       "http://gss-data.org.uk/graph/semstats/cpav21          44275\n",
       "http://gss-data.org.uk/graph/semstats/cpcv11          29269\n",
       "http://gss-data.org.uk/graph/semstats/cpcv2           44159\n",
       "http://gss-data.org.uk/graph/semstats/cpcv21          36837\n",
       "http://gss-data.org.uk/graph/semstats/cpcv11-cpcv2    15202\n",
       "http://gss-data.org.uk/graph/semstats/cpcv2-cpcv21    14788\n",
       "http://gss-data.org.uk/graph/semstats/isicr31          5438\n",
       "http://gss-data.org.uk/graph/semstats/isicr31-c...    13350\n",
       "http://gss-data.org.uk/graph/semstats/isicr31-i...     4116\n",
       "http://gss-data.org.uk/graph/semstats/isicr4           9249\n",
       "http://gss-data.org.uk/graph/semstats/isicr4-cp...    13320\n",
       "http://gss-data.org.uk/graph/semstats/isicr4-cpcv2    12305\n",
       "http://gss-data.org.uk/graph/semstats/isicr4-na...     4311\n",
       "http://gss-data.org.uk/graph/semstats/isicr4-na...     7591\n",
       "http://gss-data.org.uk/graph/semstats/nacer11          9605\n",
       "http://gss-data.org.uk/graph/semstats/nacer2          12806\n",
       "http://gss-data.org.uk/graph/semstats/nacer2-cp...    16066\n",
       "http://gss-data.org.uk/graph/semstats/nacer2-cp...    15716\n",
       "http://gss-data.org.uk/graph/semstats/nacer11-n...     5096\n",
       "http://gss-data.org.uk/graph/semstats/naics2012       17756\n",
       "http://xmlns.com/foaf/0.1/                              631\n",
       "http://publishmydata.com/graph/vocabulary/22-rd...      102\n",
       "http://publishmydata.com/graph/vocabulary/admingeo     3369\n",
       "http://publishmydata.com/graph/vocabulary/sdmx          120\n",
       "http://publishmydata.com/graph/vocabulary/skos          273\n",
       "http://publishmydata.com/graph/vocabulary/sdmx-...      295\n",
       "http://publishmydata.com/graph/vocabulary/stati...       32\n",
       "...                                                     ...\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...       16\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...     8964\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...       16\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...    17376\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...       16\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...    38862\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...       16\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...     2059\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...       16\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...     2783\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...       16\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...    11199\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...       16\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...    28329\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...       16\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...      810\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...       16\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...      270\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...       16\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...      862\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...       16\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...      810\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...       16\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...      113\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...       16\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...    62889\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...   775784\n",
       "http://gss-data.org.uk/graph/gss_data/disabilit...        2\n",
       "http://gss-data.org.uk/graph/dwp-frs-people              27\n",
       "http://gss-data.org.uk/graph/phe-group                   51\n",
       "\n",
       "[540 rows x 1 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sparql.setQuery(\"\"\"\n",
    "SELECT (COUNT(*) as ?size) ?graph\n",
    "WHERE {\n",
    "  GRAPH ?graph {\n",
    "    ?s ?p ?o\n",
    "  }\n",
    "} GROUP BY ?graph\n",
    "\"\"\")\n",
    "\n",
    "sizes = pd.DataFrame()\n",
    "sizes['Triples'] = pd.Series({\n",
    "    res['graph'].value : int(res['size'].value)\n",
    "    for res in sparql.query().bindings\n",
    "})\n",
    "sizes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Label</th>\n",
       "      <th>Family</th>\n",
       "      <th>Triples</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/ons-pink-book-chapter-3</th>\n",
       "      <td>ONS Pink Book Chapter 3</td>\n",
       "      <td>Trade</td>\n",
       "      <td>150770</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/ons-bop-individual-country-data</th>\n",
       "      <td>ONS BoP Individual Country Data</td>\n",
       "      <td>Trade</td>\n",
       "      <td>1777303</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/nisra-ni-migration-estimates</th>\n",
       "      <td>Mid-Year Population Estimates</td>\n",
       "      <td>Migration</td>\n",
       "      <td>194613</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/scotland-overseas</th>\n",
       "      <td>Migration between Scotland and Overseas</td>\n",
       "      <td>Migration</td>\n",
       "      <td>219560</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/dwp-nin-registrations-to-overseas-nationals</th>\n",
       "      <td>National Insurance number allocations to adult...</td>\n",
       "      <td>Migration</td>\n",
       "      <td>53874</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-local-area-migration-indicators</th>\n",
       "      <td>Local area migration indicators, UK</td>\n",
       "      <td>Migration</td>\n",
       "      <td>153643</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-age-and-sex</th>\n",
       "      <td>Long-term international migration 2.07, age an...</td>\n",
       "      <td>Migration</td>\n",
       "      <td>35264</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-uk-destination-or-origin</th>\n",
       "      <td>Long-term international migration 2.06, area o...</td>\n",
       "      <td>Migration</td>\n",
       "      <td>13223</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-citizenship</th>\n",
       "      <td>Long-term international migration 2.01a, citiz...</td>\n",
       "      <td>Migration</td>\n",
       "      <td>20269</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-country-of-residence</th>\n",
       "      <td>Long-term international migration 2.02, countr...</td>\n",
       "      <td>Migration</td>\n",
       "      <td>17579</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-occupation</th>\n",
       "      <td>Long-term international migration 2.05, usual ...</td>\n",
       "      <td>Migration</td>\n",
       "      <td>10954</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-reason-for-migration</th>\n",
       "      <td>Long-term international migration 2.04, main r...</td>\n",
       "      <td>Migration</td>\n",
       "      <td>8769</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-passenger-survey-4-02</th>\n",
       "      <td>International Passenger Survey 4.02, main reas...</td>\n",
       "      <td>Migration</td>\n",
       "      <td>13460</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-passenger-survey-4-04</th>\n",
       "      <td>International Passenger Survey 4.04, area of d...</td>\n",
       "      <td>Migration</td>\n",
       "      <td>63279</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ons-ltim-passenger-survey-4-01</th>\n",
       "      <td>International Passenger Survey 4.01, citizensh...</td>\n",
       "      <td>Migration</td>\n",
       "      <td>2661663</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/migration/ho-entry-visas</th>\n",
       "      <td>Immigration statistics, October to December 20...</td>\n",
       "      <td>Migration</td>\n",
       "      <td>279852</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/health/hmrc_alcohol_bulletin</th>\n",
       "      <td>Alcohol Duty</td>\n",
       "      <td>Health</td>\n",
       "      <td>264090</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/health/doh-ni-drug-alcohol-treatment-services</th>\n",
       "      <td>Census of drug and alcohol treatment services ...</td>\n",
       "      <td>Health</td>\n",
       "      <td>5912</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons_bop</th>\n",
       "      <td>Balance of payments</td>\n",
       "      <td>Trade</td>\n",
       "      <td>10588</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/health/ons_alcohol_deaths_uk</th>\n",
       "      <td>Alcohol-specific deaths in the UK</td>\n",
       "      <td>Health</td>\n",
       "      <td>34711</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/hmrc_trade</th>\n",
       "      <td>UK Trade in Goods by Business Characteristics ...</td>\n",
       "      <td>Trade</td>\n",
       "      <td>8903</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons-trade-in-goods</th>\n",
       "      <td>Trade in goods: country-by-commodity imports a...</td>\n",
       "      <td>Trade</td>\n",
       "      <td>147999181</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons-uk-trade-in-services</th>\n",
       "      <td>UK trade in services: service type by partner ...</td>\n",
       "      <td>Trade</td>\n",
       "      <td>1216327</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons_mrets</th>\n",
       "      <td>UK trade time series</td>\n",
       "      <td>Trade</td>\n",
       "      <td>4983049</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons_abs</th>\n",
       "      <td>Annual Business Survey importers and exporters</td>\n",
       "      <td>Trade</td>\n",
       "      <td>24402</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons-fdi</th>\n",
       "      <td>Foreign direct investment involving UK companies</td>\n",
       "      <td>Trade</td>\n",
       "      <td>224702</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons-international-trade-in-services</th>\n",
       "      <td>International trade in services</td>\n",
       "      <td>Trade</td>\n",
       "      <td>191582</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/hmrc_rts</th>\n",
       "      <td>UK Regional Trade Statistics (RTS</td>\n",
       "      <td>Trade</td>\n",
       "      <td>40633124</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons_cpa</th>\n",
       "      <td>UK trade in goods by classification of product...</td>\n",
       "      <td>Trade</td>\n",
       "      <td>5949765</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons-reuk-service</th>\n",
       "      <td>Regionalised estimates of UK service exports</td>\n",
       "      <td>Trade</td>\n",
       "      <td>9596</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/housing/scotland-housing-empty-property-and-second-home</th>\n",
       "      <td>Empty properties and second homes</td>\n",
       "      <td>Housing</td>\n",
       "      <td>17255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons-uk-trade-in-goods-by-industry-country-and-commodity</th>\n",
       "      <td>UK trade in goods by industry, country and com...</td>\n",
       "      <td>Trade</td>\n",
       "      <td>4837341</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/housing/wg-social-housing-vacancies</th>\n",
       "      <td>Social housing vacancies</td>\n",
       "      <td>Housing</td>\n",
       "      <td>2991203</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/health/nisra_alcohol_deaths</th>\n",
       "      <td>Alcohol-Specific Deaths 2007-2017</td>\n",
       "      <td>Health</td>\n",
       "      <td>1861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/housing/wg-chargeable-homes</th>\n",
       "      <td>Council tax dwellings</td>\n",
       "      <td>Housing</td>\n",
       "      <td>832568</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons-uk-total-trade</th>\n",
       "      <td>UK total trade: all countries, non-seasonally ...</td>\n",
       "      <td>Trade</td>\n",
       "      <td>442049</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/dwp-family-resources-survey-disability</th>\n",
       "      <td>Family Resources Survey: financial year 2017/18</td>\n",
       "      <td>Disability</td>\n",
       "      <td>2657</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/trade/ons-uk-sa-trade-in-goods</th>\n",
       "      <td>Trade in goods: all countries, seasonally adju...</td>\n",
       "      <td>Trade</td>\n",
       "      <td>1064823</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/ons-children-living-in-long-term-workless-households-by-disability-status</th>\n",
       "      <td>Children living in long-term workless househol...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>917</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/ons-labour-force-survey</th>\n",
       "      <td>A08: Labour market status of disabled people</td>\n",
       "      <td>Disability</td>\n",
       "      <td>61872</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/sg-homelessness-in-scotland-annual-publication/homelessness-in-scotland-applications-main-reason-for-making-an-application-for-homelenessness-to-a-local-authority</th>\n",
       "      <td>Homelessness in Scotland: Applications: Main r...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>1657</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/sg-homelessness-in-scotland-annual-publication/homelessness-in-scotland-applications-reasons-for-failing-to-maintain-accommodation-prior-to-application</th>\n",
       "      <td>Homelessness in Scotland: Applications: Reason...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>1062</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/sg-homelessness-in-scotland-annual-publication/homelessness-in-scotland-applications-support-need-identified-for-those-homeless-or-threatened-with-homelessness-households</th>\n",
       "      <td>Homelessness in Scotland: Applications: Suppor...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>807</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/sg-homelessness-in-scotland-annual-publication/homelessness-in-scotland-identified-support-needs-of-homeless-households</th>\n",
       "      <td>Homelessness in Scotland: Identified Support N...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/sg-homelessness-in-scotland-annual-publication/homelessness-in-scotland-reason-for-failing-to-maintain-accommodation</th>\n",
       "      <td>Homelessness in Scotland: Reason(s) for failin...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/country-of-birth</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>732</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/county-ua-deprivation-deciles-in-england-imd2010</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>3503</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/county-ua-deprivation-deciles-in-england-imd2015-419-geog</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>8964</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/county-ua-deprivation-deciles-in-england-imd2019-419-geog</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>17376</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/county-ua-pre-apr2019-deprivation-deciles-in-england-imd2015</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>38862</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-deprivation-deciles-in-england-imd2010</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>2059</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-deprivation-deciles-in-england-imd2015-419-geog</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>2783</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-deprivation-deciles-in-england-imd2019-419-geog</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>11199</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/district-ua-pre-apr2019-deprivation-deciles-in-england-imd2015</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>28329</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/ethnic-groups</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>810</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/health-status</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>270</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/lsoa11-deprivation-deciles-in-england-imd2015</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>862</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/religion-8-categories</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>810</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/sexuality-5-categories</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>113</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>http://gss-data.org.uk/data/gss_data/disability/phe-co-occurring-substance-misuse-and-mental-health-issues/socioeconomic-group-18-64-yrs</th>\n",
       "      <td>Co-occurring substance misuse and mental healt...</td>\n",
       "      <td>Disability</td>\n",
       "      <td>62889</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>77 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                Label  \\\n",
       "http://gss-data.org.uk/data/ons-pink-book-chapt...                            ONS Pink Book Chapter 3   \n",
       "http://gss-data.org.uk/data/ons-bop-individual-...                    ONS BoP Individual Country Data   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...                      Mid-Year Population Estimates   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...            Migration between Scotland and Overseas   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  National Insurance number allocations to adult...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...                Local area migration indicators, UK   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  Long-term international migration 2.07, age an...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  Long-term international migration 2.06, area o...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  Long-term international migration 2.01a, citiz...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  Long-term international migration 2.02, countr...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  Long-term international migration 2.05, usual ...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  Long-term international migration 2.04, main r...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  International Passenger Survey 4.02, main reas...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  International Passenger Survey 4.04, area of d...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  International Passenger Survey 4.01, citizensh...   \n",
       "http://gss-data.org.uk/data/gss_data/migration/...  Immigration statistics, October to December 20...   \n",
       "http://gss-data.org.uk/data/gss_data/health/hmr...                                       Alcohol Duty   \n",
       "http://gss-data.org.uk/data/gss_data/health/doh...  Census of drug and alcohol treatment services ...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_bop                                Balance of payments   \n",
       "http://gss-data.org.uk/data/gss_data/health/ons...                  Alcohol-specific deaths in the UK   \n",
       "http://gss-data.org.uk/data/gss_data/trade/hmrc...  UK Trade in Goods by Business Characteristics ...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...  Trade in goods: country-by-commodity imports a...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...  UK trade in services: service type by partner ...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_...                               UK trade time series   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_abs     Annual Business Survey importers and exporters   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-fdi   Foreign direct investment involving UK companies   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...                    International trade in services   \n",
       "http://gss-data.org.uk/data/gss_data/trade/hmrc...                  UK Regional Trade Statistics (RTS   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_cpa  UK trade in goods by classification of product...   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...       Regionalised estimates of UK service exports   \n",
       "...                                                                                               ...   \n",
       "http://gss-data.org.uk/data/gss_data/housing/sc...                  Empty properties and second homes   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...  UK trade in goods by industry, country and com...   \n",
       "http://gss-data.org.uk/data/gss_data/housing/wg...                           Social housing vacancies   \n",
       "http://gss-data.org.uk/data/gss_data/health/nis...                  Alcohol-Specific Deaths 2007-2017   \n",
       "http://gss-data.org.uk/data/gss_data/housing/wg...                              Council tax dwellings   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...  UK total trade: all countries, non-seasonally ...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...    Family Resources Survey: financial year 2017/18   \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...  Trade in goods: all countries, seasonally adju...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Children living in long-term workless househol...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...       A08: Labour market status of disabled people   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Homelessness in Scotland: Applications: Main r...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Homelessness in Scotland: Applications: Reason...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Homelessness in Scotland: Applications: Suppor...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Homelessness in Scotland: Identified Support N...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Homelessness in Scotland: Reason(s) for failin...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Co-occurring substance misuse and mental healt...   \n",
       "\n",
       "                                                        Family    Triples  \n",
       "http://gss-data.org.uk/data/ons-pink-book-chapt...       Trade     150770  \n",
       "http://gss-data.org.uk/data/ons-bop-individual-...       Trade    1777303  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration     194613  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration     219560  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration      53874  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration     153643  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration      35264  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration      13223  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration      20269  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration      17579  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration      10954  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration       8769  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration      13460  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration      63279  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration    2661663  \n",
       "http://gss-data.org.uk/data/gss_data/migration/...   Migration     279852  \n",
       "http://gss-data.org.uk/data/gss_data/health/hmr...      Health     264090  \n",
       "http://gss-data.org.uk/data/gss_data/health/doh...      Health       5912  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_bop       Trade      10588  \n",
       "http://gss-data.org.uk/data/gss_data/health/ons...      Health      34711  \n",
       "http://gss-data.org.uk/data/gss_data/trade/hmrc...       Trade       8903  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...       Trade  147999181  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...       Trade    1216327  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_...       Trade    4983049  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_abs       Trade      24402  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-fdi       Trade     224702  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...       Trade     191582  \n",
       "http://gss-data.org.uk/data/gss_data/trade/hmrc...       Trade   40633124  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons_cpa       Trade    5949765  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...       Trade       9596  \n",
       "...                                                        ...        ...  \n",
       "http://gss-data.org.uk/data/gss_data/housing/sc...     Housing      17255  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...       Trade    4837341  \n",
       "http://gss-data.org.uk/data/gss_data/housing/wg...     Housing    2991203  \n",
       "http://gss-data.org.uk/data/gss_data/health/nis...      Health       1861  \n",
       "http://gss-data.org.uk/data/gss_data/housing/wg...     Housing     832568  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...       Trade     442049  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability       2657  \n",
       "http://gss-data.org.uk/data/gss_data/trade/ons-...       Trade    1064823  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability        917  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability      61872  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability       1657  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability       1062  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability        807  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability         87  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability        182  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability        732  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability       3503  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability       8964  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability      17376  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability      38862  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability       2059  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability       2783  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability      11199  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability      28329  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability        810  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability        270  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability        862  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability        810  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability        113  \n",
       "http://gss-data.org.uk/data/gss_data/disability...  Disability      62889  \n",
       "\n",
       "[77 rows x 3 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "table = table.merge(sizes, left_on='Graph', right_index=True)\n",
    "table.drop(columns=['Graph'], inplace=True)\n",
    "table"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>Triples</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Family</th>\n",
       "      <th>Dataset</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"23\" valign=\"top\">Disability</th>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fdwp-family-resources-survey-disability\">Family Resources Survey: financial year 2017/18</a></th>\n",
       "      <td>2657</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fons-children-living-in-long-term-workless-households-by-disability-status\">Children living in long-term workless households, by disability status (Table H)</a></th>\n",
       "      <td>917</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fons-labour-force-survey\">A08: Labour market status of disabled people</a></th>\n",
       "      <td>61872</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Fcountry-of-birth\">Co-occurring substance misuse and mental health issues: Country of birth</a></th>\n",
       "      <td>732</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Fcounty-ua-deprivation-deciles-in-england-imd2010\">Co-occurring substance misuse and mental health issues: County & UA deprivation deciles in England (IMD2010)</a></th>\n",
       "      <td>3503</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Fcounty-ua-deprivation-deciles-in-england-imd2015-419-geog\">Co-occurring substance misuse and mental health issues: County & UA deprivation deciles in England (IMD2015, 419 geog)</a></th>\n",
       "      <td>8964</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Fcounty-ua-deprivation-deciles-in-england-imd2019-419-geog\">Co-occurring substance misuse and mental health issues: County & UA deprivation deciles in England (IMD2019, 419 geog)</a></th>\n",
       "      <td>17376</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Fcounty-ua-pre-apr2019-deprivation-deciles-in-england-imd2015\">Co-occurring substance misuse and mental health issues: County & UA (pre Apr2019) deprivation deciles in England (IMD2015)</a></th>\n",
       "      <td>38862</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Fdistrict-ua-deprivation-deciles-in-england-imd2010\">Co-occurring substance misuse and mental health issues: District & UA deprivation deciles in England (IMD2010)</a></th>\n",
       "      <td>2059</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Fdistrict-ua-deprivation-deciles-in-england-imd2015-419-geog\">Co-occurring substance misuse and mental health issues: District & UA deprivation deciles in England (IMD2015, 419 geog)</a></th>\n",
       "      <td>2783</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Fdistrict-ua-deprivation-deciles-in-england-imd2019-419-geog\">Co-occurring substance misuse and mental health issues: District & UA deprivation deciles in England (IMD2019, 419 geog)</a></th>\n",
       "      <td>11199</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Fdistrict-ua-pre-apr2019-deprivation-deciles-in-england-imd2015\">Co-occurring substance misuse and mental health issues: District & UA (pre Apr2019)  deprivation deciles in England (IMD2015)</a></th>\n",
       "      <td>28329</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Fethnic-groups\">Co-occurring substance misuse and mental health issues: Ethnic groups</a></th>\n",
       "      <td>810</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Fhealth-status\">Co-occurring substance misuse and mental health issues: Health status</a></th>\n",
       "      <td>270</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Flsoa11-deprivation-deciles-in-england-imd2015\">Co-occurring substance misuse and mental health issues: LSOA11 deprivation deciles in England (IMD2015)</a></th>\n",
       "      <td>862</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Freligion-8-categories\">Co-occurring substance misuse and mental health issues: Religion - 8 categories</a></th>\n",
       "      <td>810</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Fsexuality-5-categories\">Co-occurring substance misuse and mental health issues: Sexuality - 5 categories</a></th>\n",
       "      <td>113</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fphe-co-occurring-substance-misuse-and-mental-health-issues%2Fsocioeconomic-group-18-64-yrs\">Co-occurring substance misuse and mental health issues: Socioeconomic group (18-64 yrs)</a></th>\n",
       "      <td>62889</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fsg-homelessness-in-scotland-annual-publication%2Fhomelessness-in-scotland-applications-main-reason-for-making-an-application-for-homelenessness-to-a-local-authority\">Homelessness in Scotland: Applications: Main reason for making an application for homelenessness to a Local Authority</a></th>\n",
       "      <td>1657</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fsg-homelessness-in-scotland-annual-publication%2Fhomelessness-in-scotland-applications-reasons-for-failing-to-maintain-accommodation-prior-to-application\">Homelessness in Scotland: Applications: Reasons for failing to maintain accommodation prior to application</a></th>\n",
       "      <td>1062</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fsg-homelessness-in-scotland-annual-publication%2Fhomelessness-in-scotland-applications-support-need-identified-for-those-homeless-or-threatened-with-homelessness-households\">Homelessness in Scotland: Applications: Support need identified for those homeless (or threatened with homelessness) households</a></th>\n",
       "      <td>807</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fsg-homelessness-in-scotland-annual-publication%2Fhomelessness-in-scotland-identified-support-needs-of-homeless-households\">Homelessness in Scotland: Identified Support Needs of Homeless Households</a></th>\n",
       "      <td>87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fdisability%2Fsg-homelessness-in-scotland-annual-publication%2Fhomelessness-in-scotland-reason-for-failing-to-maintain-accommodation\">Homelessness in Scotland: Reason(s) for failing to maintain accommodation</a></th>\n",
       "      <td>182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"11\" valign=\"top\">Health</th>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhealth%2Fdft-alcohol-ras51001\">Reported drinking and driving (RAS51)</a></th>\n",
       "      <td>2276</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhealth%2Fdoh-ni-drug-alcohol-treatment-services\">Census of drug and alcohol treatment services in Northern Ireland 2017</a></th>\n",
       "      <td>5912</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhealth%2Fhmrc_alcohol_bulletin\">Alcohol Duty</a></th>\n",
       "      <td>264090</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhealth%2Fnhs-statistics-on-alcohol-england%2Falcohol-affordability\">Alcohol Affordability</a></th>\n",
       "      <td>1611</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhealth%2Fnhs-statistics-on-alcohol-england%2Falcohol-specific-deaths\">Alcohol Specific Deaths</a></th>\n",
       "      <td>439</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhealth%2Fnhs-statistics-on-alcohol-england%2Fhousehold-expenditure-alcohol\">Household Expenditure Alcohol</a></th>\n",
       "      <td>716</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhealth%2Fnhs-statistics-on-alcohol-england%2Fprescription-items-community\">Prescription Items Community</a></th>\n",
       "      <td>1946</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhealth%2Fnhs-statistics-on-alcohol-england%2Fprescription-items-region\">Prescription Items Region</a></th>\n",
       "      <td>16545</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhealth%2Fnisra_alcohol_deaths\">Alcohol-Specific Deaths 2007-2017</a></th>\n",
       "      <td>1861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhealth%2Fons_alcohol_deaths_uk\">Alcohol-specific deaths in the UK</a></th>\n",
       "      <td>34711</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhealth%2Fphe-local-alcohol-profiles-for-england\">Local Alcohol Profiles for England: August 2019 data update</a></th>\n",
       "      <td>1271161</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"6\" valign=\"top\">Housing</th>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhousing%2Fscotland-housing-empty-property-and-second-home\">Empty properties and second homes</a></th>\n",
       "      <td>17255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhousing%2Fscotland-housing-public-sector-vacant-stock\">Housing Statistics for Scotland - Public sector vacant stock</a></th>\n",
       "      <td>234891</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhousing%2Fscotland-housing-stock-by-tenure\">Stock by tenure</a></th>\n",
       "      <td>4023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhousing%2Fwg-chargeable-homes\">Council tax dwellings</a></th>\n",
       "      <td>832568</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhousing%2Fwg-dwelling-stock-estimates\">Dwelling Stock Estimates</a></th>\n",
       "      <td>15283</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fhousing%2Fwg-social-housing-vacancies\">Social housing vacancies</a></th>\n",
       "      <td>2991203</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"19\" valign=\"top\">Migration</th>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fmigration%2Fdwp-nin-registrations-to-overseas-nationals\">National Insurance number allocations to adult overseas nationals to March 2018</a></th>\n",
       "      <td>53874</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fmigration%2Fho-entry-visas\">Immigration statistics, October to December 2017: data tables second edition</a></th>\n",
       "      <td>279852</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fmigration%2Fnisra-ni-migration-estimates\">Mid-Year Population Estimates</a></th>\n",
       "      <td>194613</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fmigration%2Fons-local-area-migration-indicators\">Local area migration indicators, UK</a></th>\n",
       "      <td>153643</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fmigration%2Fons-ltim-age-and-sex\">Long-term international migration 2.07, age and sex, UK and England and Wales</a></th>\n",
       "      <td>35264</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fmigration%2Fons-ltim-citizenship\">Long-term international migration 2.01a, citizenship, UK and England and Wales</a></th>\n",
       "      <td>20269</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fmigration%2Fons-ltim-country-of-residence\">Long-term international migration 2.02, country of last or next residence, UK and England and Wales</a></th>\n",
       "      <td>17579</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fmigration%2Fons-ltim-occupation\">Long-term international migration 2.05, usual occupation prior to migration, UK and England and Wales</a></th>\n",
       "      <td>10954</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fmigration%2Fons-ltim-passenger-survey-4-01\">International Passenger Survey 4.01, citizenship group by sex by age by country of last or next residence</a></th>\n",
       "      <td>2661663</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fmigration%2Fons-ltim-passenger-survey-4-02\">International Passenger Survey 4.02, main reason for migration by citizenship</a></th>\n",
       "      <td>13460</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fmigration%2Fons-ltim-passenger-survey-4-04\">International Passenger Survey 4.04, area of destination or origin within the UK by citizenship</a></th>\n",
       "      <td>63279</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fmigration%2Fons-ltim-reason-for-migration\">Long-term international migration 2.04, main reason for migration, UK and England and Wales</a></th>\n",
       "      <td>8769</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fmigration%2Fons-ltim-uk-destination-or-origin\">Long-term international migration 2.06, area of destination or origin within the UK</a></th>\n",
       "      <td>13223</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Fmigration%2Fscotland-overseas\">Migration between Scotland and Overseas</a></th>\n",
       "      <td>219560</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fmigration%2Fho-asylum%2Fas_01_q\">Asylum applications and initial decisions for main applicants, by country of nationality</a></th>\n",
       "      <td>2492510</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fmigration%2Fho-asylum%2Fas_04\">Asylum applications from main applicants and dependants, by age, sex and country of nationality</a></th>\n",
       "      <td>719126</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fmigration%2Fho-asylum%2Fas_16_q\">Asylum seekers in receipt of Section 95 support, by local authority, as at end of quarter</a></th>\n",
       "      <td>676899</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fmigration%2Fho-asylum%2Fas_19_q\">Refugees (and others) resettled, including dependants, by country of nationality</a></th>\n",
       "      <td>4508</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fmigration%2Fho-asylum%2Fas_22_q\">Arrivals, and requests for transfer into the UK under the Dublin Regulation, by article and country of transfer</a></th>\n",
       "      <td>96869</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"18\" valign=\"top\">Trade</th>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fhmrc-rts-small-area\">Regional trade in goods statistics disaggregated by smaller geographical areas: 2017</a></th>\n",
       "      <td>210513</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fhmrc_ots_cn8\">HMRC Overseas Trade Statistics</a></th>\n",
       "      <td>13543677</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fhmrc_rts\">UK Regional Trade Statistics (RTS</a></th>\n",
       "      <td>40633124</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fhmrc_trade\">UK Trade in Goods by Business Characteristics - Experimental Statistics</a></th>\n",
       "      <td>8903</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fons-fdi\">Foreign direct investment involving UK companies</a></th>\n",
       "      <td>224702</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fons-international-trade-in-services\">International trade in services</a></th>\n",
       "      <td>191582</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fons-reuk-service\">Regionalised estimates of UK service exports</a></th>\n",
       "      <td>9596</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fons-trade-in-goods\">Trade in goods: country-by-commodity imports and exports</a></th>\n",
       "      <td>147999181</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fons-uk-sa-trade-in-goods\">Trade in goods: all countries, seasonally adjusted</a></th>\n",
       "      <td>1064823</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fons-uk-total-trade\">UK total trade: all countries, non-seasonally adjusted</a></th>\n",
       "      <td>442049</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fons-uk-trade-in-goods-by-industry-country-and-commodity\">UK trade in goods by industry, country and commodity, imports and exports</a></th>\n",
       "      <td>4837341</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fons-uk-trade-in-services\">UK trade in services: service type by partner country, non-seasonally adjusted</a></th>\n",
       "      <td>1216327</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fons_abs\">Annual Business Survey importers and exporters</a></th>\n",
       "      <td>24402</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fons_bop\">Balance of payments</a></th>\n",
       "      <td>10588</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fons_cpa\">UK trade in goods by classification of product by activity time series</a></th>\n",
       "      <td>5949765</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fgss_data%2Ftrade%2Fons_mrets\">UK trade time series</a></th>\n",
       "      <td>4983049</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fons-bop-individual-country-data\">ONS BoP Individual Country Data</a></th>\n",
       "      <td>1777303</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th><a href=\"http://gss-data.org.uk/resource?uri=http%3A%2F%2Fgss-data.org.uk%2Fdata%2Fons-pink-book-chapter-3\">ONS Pink Book Chapter 3</a></th>\n",
       "      <td>150770</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from urllib.parse import urlencode\n",
    "def gss_url(uri):\n",
    "    return 'http://gss-data.org.uk/resource?' + urlencode({\n",
    "        'uri': uri\n",
    "    })\n",
    "\n",
    "table['Dataset'] = table.apply(lambda x: f'<a href=\"{gss_url(x.name)}\">{x.Label}</a>', axis=1)\n",
    "table.drop(columns=['Label'], inplace=True)\n",
    "table = table[['Dataset', 'Family', 'Triples']]\n",
    "table = table.sort_values(by=['Family', 'Dataset'])\n",
    "table = table.set_index(['Family', 'Dataset'])\n",
    "pd.set_option('max_colwidth', -1)\n",
    "with open('dataset-stats.html', 'w') as f:\n",
    "    f.write(table.to_html(escape=False, index=True))\n",
    "HTML(table.to_html(escape=False, index=True))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}