Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wjwillemse/66437705f673f935cc84ff2c971a8a2d to your computer and use it in GitHub Desktop.
Save wjwillemse/66437705f673f935cc84ff2c971a8a2d to your computer and use it in GitHub Desktop.
Retrieving DPM data from the taxonomy - Solvency 2
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from rdflib import Graph as RDFGraph\n",
"from rdflib.extras.external_graph_libs import rdflib_to_networkx_graph\n",
"import networkx as nx\n",
"from networkx import Graph as NXGraph\n",
"import matplotlib.pyplot as plt\n",
"import statistics\n",
"import collections\n",
"import pandas as pd\n",
"from six.moves.urllib.parse import urldefrag"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"rdflib Graph loaded successfully with 1203744 triples\n"
]
}
],
"source": [
"# RDF graph loading\n",
"path = \"../data/rdf/qrs_240_instance.ttl\"\n",
"\n",
"g = RDFGraph()\n",
"g.parse(path, format='turtle')\n",
"\n",
"print(\"rdflib Graph loaded successfully with {} triples\".format(len(g)))"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['http://eiopa.europa.eu/xbrl/s2md/fws/solvency/solvency2/2019-07-15/tab/S.01.01.02.01#s2md_tS.01.01.02.01',\n",
" 'http://eiopa.europa.eu/xbrl/s2md/fws/solvency/solvency2/2019-07-15/tab/S.01.02.01.01#s2md_tS.01.02.01.01',\n",
" 'http://eiopa.europa.eu/xbrl/s2md/fws/solvency/solvency2/2019-07-15/tab/S.02.01.02.01#s2md_tS.02.01.02.01',\n",
" 'http://eiopa.europa.eu/xbrl/s2md/fws/solvency/solvency2/2019-07-15/tab/S.05.01.02.01#s2md_tS.05.01.02.01',\n",
" 'http://eiopa.europa.eu/xbrl/s2md/fws/solvency/solvency2/2019-07-15/tab/S.05.01.02.02#s2md_tS.05.01.02.02']"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"q = \"\"\"\n",
" SELECT ?a\n",
" WHERE {\n",
" ?a xl:type table:table .\n",
" }\"\"\"\n",
"tables = [str(row[0]) for row in g.query(q)]\n",
"tables.sort()\n",
"tables[0:5]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Concept labels"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"q = \"\"\"\n",
" SELECT ?t ?label\n",
" WHERE {\n",
" ?x1 arcrole3:concept-label [xl:from ?t ;\n",
" xl:to [rdf:value ?label]] .\n",
" }\"\"\"\n",
"concept_labels = {row[0]: row[1] for row in g.query(q)}"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## DPM explicit domains"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"# A domain is a set of elements/values sharing a specified semantic nature. \n",
"# Domain can be of one of two kinds: explicit and typed. \n",
"# An explicit domain has its elements enumerated in the model while a typed domain values \n",
"# are assigned in the reports based on a specified format (data type)."
]
},
{
"cell_type": "code",
"execution_count": 6,
"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>Domain uri</th>\n",
" <th>Domain label</th>\n",
" <th>period Type</th>\n",
" <th>creation Date</th>\n",
" <th>nillable</th>\n",
" <th>abstract</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#MC</td>\n",
" <td>Main categories</td>\n",
" <td>instant</td>\n",
" <td>2014-07-07</td>\n",
" <td>true</td>\n",
" <td>true</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#TL</td>\n",
" <td>Types of URI</td>\n",
" <td>instant</td>\n",
" <td>2014-07-07</td>\n",
" <td>true</td>\n",
" <td>true</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#SE</td>\n",
" <td>Sectors</td>\n",
" <td>instant</td>\n",
" <td>2014-07-07</td>\n",
" <td>true</td>\n",
" <td>true</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#AO</td>\n",
" <td>Article 112 and 167</td>\n",
" <td>instant</td>\n",
" <td>2014-07-07</td>\n",
" <td>true</td>\n",
" <td>true</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#PI</td>\n",
" <td>Percentage intervals</td>\n",
" <td>instant</td>\n",
" <td>2014-07-07</td>\n",
" <td>true</td>\n",
" <td>true</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Domain uri Domain label \\\n",
"0 http://eiopa.europa.eu/xbrl/s2c/dict/exp#MC Main categories \n",
"1 http://eiopa.europa.eu/xbrl/s2c/dict/exp#TL Types of URI \n",
"2 http://eiopa.europa.eu/xbrl/s2c/dict/exp#SE Sectors \n",
"3 http://eiopa.europa.eu/xbrl/s2c/dict/exp#AO Article 112 and 167 \n",
"4 http://eiopa.europa.eu/xbrl/s2c/dict/exp#PI Percentage intervals \n",
"\n",
" period Type creation Date nillable abstract \n",
"0 instant 2014-07-07 true true \n",
"1 instant 2014-07-07 true true \n",
"2 instant 2014-07-07 true true \n",
"3 instant 2014-07-07 true true \n",
"4 instant 2014-07-07 true true "
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"q = \"\"\"\n",
" SELECT DISTINCT ?t ?x1 ?x2 ?x4 ?x5\n",
" WHERE {\n",
" ?t rdf:type model:explicitDomainType .\n",
" ?t xbrli:periodType ?x1 .\n",
" ?t model:creationDate ?x2 .\n",
" ?t xbrli:nillable ?x4 .\n",
" ?t xbrli:abstract ?x5 .\n",
" }\"\"\"\n",
"\n",
"data = [[row[0], concept_labels[row[0]]]+list(row[1:]) for row in g.query(q)]\n",
"columns = ['Domain uri', \n",
" 'Domain label', \n",
" 'period Type', \n",
" 'creation Date', \n",
" 'nillable', \n",
" 'abstract']\n",
"df_domains = pd.DataFrame(data=data,\n",
" columns=columns)\n",
"df_domains.iloc[0:5]"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"41"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(df_domains)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## DPM Dimensions"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"# In order to be used in description of information requirements a domain member \n",
"# or a typed domain value requires a dimensionthat provides a context of its application. \n",
"# In other words dimensions contextualise domain members when applied to a data point\n",
"# i.e. they contribute to the semantics of a member which, without a dimension,\n",
"# may be insufficient to represent the full meaning of a property."
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"scrolled": true
},
"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>Dimension uri</th>\n",
" <th>Dimension label</th>\n",
" <th>Applicable domain code</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/dim#DC</td>\n",
" <td>Types of decimal</td>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#DC</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/dim#AE</td>\n",
" <td>Article 304</td>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#AP</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/dim#DI</td>\n",
" <td>Instant or duration</td>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#DI</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/dim#IG</td>\n",
" <td>Treatment of intra-group transactions</td>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#VM</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/dim#OF</td>\n",
" <td>Own funds</td>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#MC</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>173</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/dim#PS</td>\n",
" <td>Purpose</td>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#PU</td>\n",
" </tr>\n",
" <tr>\n",
" <th>174</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/dim#TE</td>\n",
" <td>Types of income/expenses</td>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#CE</td>\n",
" </tr>\n",
" <tr>\n",
" <th>175</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/dim#TT</td>\n",
" <td>Type of transaction</td>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#MC</td>\n",
" </tr>\n",
" <tr>\n",
" <th>176</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/dim#RO</td>\n",
" <td>Relation to group</td>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#CS</td>\n",
" </tr>\n",
" <tr>\n",
" <th>177</th>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/dim#FF</td>\n",
" <td>SPV sufficiently collateralised or not</td>\n",
" <td>http://eiopa.europa.eu/xbrl/s2c/dict/exp#CG</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>178 rows × 3 columns</p>\n",
"</div>"
],
"text/plain": [
" Dimension uri \\\n",
"0 http://eiopa.europa.eu/xbrl/s2c/dict/dim#DC \n",
"1 http://eiopa.europa.eu/xbrl/s2c/dict/dim#AE \n",
"2 http://eiopa.europa.eu/xbrl/s2c/dict/dim#DI \n",
"3 http://eiopa.europa.eu/xbrl/s2c/dict/dim#IG \n",
"4 http://eiopa.europa.eu/xbrl/s2c/dict/dim#OF \n",
".. ... \n",
"173 http://eiopa.europa.eu/xbrl/s2c/dict/dim#PS \n",
"174 http://eiopa.europa.eu/xbrl/s2c/dict/dim#TE \n",
"175 http://eiopa.europa.eu/xbrl/s2c/dict/dim#TT \n",
"176 http://eiopa.europa.eu/xbrl/s2c/dict/dim#RO \n",
"177 http://eiopa.europa.eu/xbrl/s2c/dict/dim#FF \n",
"\n",
" Dimension label \\\n",
"0 Types of decimal \n",
"1 Article 304 \n",
"2 Instant or duration \n",
"3 Treatment of intra-group transactions \n",
"4 Own funds \n",
".. ... \n",
"173 Purpose \n",
"174 Types of income/expenses \n",
"175 Type of transaction \n",
"176 Relation to group \n",
"177 SPV sufficiently collateralised or not \n",
"\n",
" Applicable domain code \n",
"0 http://eiopa.europa.eu/xbrl/s2c/dict/exp#DC \n",
"1 http://eiopa.europa.eu/xbrl/s2c/dict/exp#AP \n",
"2 http://eiopa.europa.eu/xbrl/s2c/dict/exp#DI \n",
"3 http://eiopa.europa.eu/xbrl/s2c/dict/exp#VM \n",
"4 http://eiopa.europa.eu/xbrl/s2c/dict/exp#MC \n",
".. ... \n",
"173 http://eiopa.europa.eu/xbrl/s2c/dict/exp#PU \n",
"174 http://eiopa.europa.eu/xbrl/s2c/dict/exp#CE \n",
"175 http://eiopa.europa.eu/xbrl/s2c/dict/exp#MC \n",
"176 http://eiopa.europa.eu/xbrl/s2c/dict/exp#CS \n",
"177 http://eiopa.europa.eu/xbrl/s2c/dict/exp#CG \n",
"\n",
"[178 rows x 3 columns]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"q = \"\"\"\n",
" SELECT DISTINCT ?t ?domain\n",
" WHERE {\n",
" ?x2 arcrole7:dimension-domain [ xl:from ?t ;\n",
" xl:to ?domain ] .\n",
" }\"\"\"\n",
"data = [[row[0], concept_labels[row[0]]]+list(row[1:]) for row in g.query(q)]\n",
"columns=['Dimension uri', \n",
" 'Dimension label', \n",
" 'Applicable domain code']\n",
"df_dimensions = pd.DataFrame(data=data, \n",
" columns=columns)\n",
"df_dimensions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## All domain members of all domains"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"# Elements of an explicit domain are called domain members. \n",
"# A domain member (or simply a member) is enumerated element of an explicit domain.\n",
"# All members from a domain share a certain common nature defined subjectively\n",
"# but applied consistently by the model’s author."
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"def members(domain):\n",
" q = \"\"\"\n",
" SELECT DISTINCT ?t ?label\n",
" WHERE {\n",
" ?l arcrole7:domain-member [ xl:from <\"\"\"+str(domain)+\"\"\"> ;\n",
" xl:to ?t ] .\n",
" ?t rdf:type nonnum:domainItemType .\n",
" ?x arcrole3:concept-label [ xl:from ?t ;\n",
" xl:to [rdf:value ?label ] ] .\n",
" }\"\"\"\n",
" return g.query(q)\n",
"\n",
"df_members = pd.DataFrame()\n",
"for domain in df_domains.iloc[:, 0]:\n",
" data = [[urldefrag(domain)[1]]+[urldefrag(row[0])[1]]+list(row[1:]) for row in members(domain)]\n",
" columns = ['Domain',\n",
" 'Member',\n",
" 'Member label']\n",
" df_members = df_members.append(pd.DataFrame(data=data,\n",
" columns=columns))"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"4879"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(df_members)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Template structures"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"def get_children(parent):\n",
" q = '''\n",
" SELECT DISTINCT ?t\n",
" WHERE {\n",
" ?s xl:from <'''+str(parent)+'''> .\n",
" ?s xl:to ?t .\n",
" ?l xl:from ?t .\n",
" }'''\n",
" return list(g.query(q))\n",
"\n",
"def get_label(element, role):\n",
" q = '''\n",
" SELECT DISTINCT ?label\n",
" WHERE {\n",
" ?l arcrole1:element-label ?s .\n",
" ?s xl:from <'''+str(element)+'''> .\n",
" ?s xl:to [xlink:role '''+role+''' ;\n",
" rdf:value ?label] .\n",
" }'''\n",
" r = list(g.query(q))\n",
" if r != []:\n",
" return r[0][0]\n",
" else:\n",
" return \"\"\n",
"\n",
"def search_tree(c, depth, axis, data):\n",
" if c != []:\n",
" for r in get_children(c):\n",
" rccode = get_label(r[0], 'eurofiling:rc-code')\n",
" label = get_label(r[0], 'role1:label')\n",
" data.append([str(axis), depth, str(rccode), str(label)])\n",
" search_tree(r[0], depth + 1, axis, data)\n",
" return data\n",
"\n",
"url = \"<http://eiopa.europa.eu/xbrl/s2md/fws/solvency/solvency2/2019-07-15/tab/S.02.01.02.01#s2md_tS.02.01.02.01>\"\n",
" \n",
"qres = g.query(\n",
" \"\"\"SELECT DISTINCT ?t ?axis\n",
" WHERE {\n",
" ?s xl:from \"\"\"+url+\"\"\" .\n",
" ?s xl:axis ?axis .\n",
" ?s xl:to ?t .\n",
" }\"\"\")\n",
"data = list()\n",
"\n",
"for row in qres:\n",
" data = search_tree(row[0], 0, row[1], data)\n",
"columns = ['axis', 'depth', 'rc-code', 'label']\n",
"df_tables = pd.DataFrame(data=data,\n",
" columns=columns)\n",
"df_tables = df_tables.sort_values(['axis', 'rc-code']).reset_index(drop=True)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"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>axis</th>\n",
" <th>depth</th>\n",
" <th>rc-code</th>\n",
" <th>label</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>x</td>\n",
" <td>0</td>\n",
" <td></td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>x</td>\n",
" <td>1</td>\n",
" <td>C0010</td>\n",
" <td>Solvency II value</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>y</td>\n",
" <td>0</td>\n",
" <td></td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>y</td>\n",
" <td>1</td>\n",
" <td></td>\n",
" <td>Liabilities</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>y</td>\n",
" <td>1</td>\n",
" <td></td>\n",
" <td>Assets</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>y</td>\n",
" <td>2</td>\n",
" <td>R0010</td>\n",
" <td>Goodwill</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>y</td>\n",
" <td>2</td>\n",
" <td>R0020</td>\n",
" <td>Deferred acquisition costs</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>y</td>\n",
" <td>2</td>\n",
" <td>R0030</td>\n",
" <td>Intangible assets</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>y</td>\n",
" <td>2</td>\n",
" <td>R0040</td>\n",
" <td>Deferred tax assets</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>y</td>\n",
" <td>2</td>\n",
" <td>R0050</td>\n",
" <td>Pension benefit surplus</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>y</td>\n",
" <td>2</td>\n",
" <td>R0060</td>\n",
" <td>Property, plant &amp; equipment held for own use</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>y</td>\n",
" <td>2</td>\n",
" <td>R0070</td>\n",
" <td>Investments (other than assets held for index-...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>y</td>\n",
" <td>3</td>\n",
" <td>R0080</td>\n",
" <td>Property (other than for own use)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>y</td>\n",
" <td>3</td>\n",
" <td>R0090</td>\n",
" <td>Holdings in related undertakings, including pa...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>y</td>\n",
" <td>3</td>\n",
" <td>R0100</td>\n",
" <td>Equities</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>y</td>\n",
" <td>4</td>\n",
" <td>R0110</td>\n",
" <td>Equities - listed</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>y</td>\n",
" <td>4</td>\n",
" <td>R0120</td>\n",
" <td>Equities - unlisted</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>y</td>\n",
" <td>3</td>\n",
" <td>R0130</td>\n",
" <td>Bonds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>y</td>\n",
" <td>4</td>\n",
" <td>R0140</td>\n",
" <td>Government Bonds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>y</td>\n",
" <td>4</td>\n",
" <td>R0150</td>\n",
" <td>Corporate Bonds</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>y</td>\n",
" <td>4</td>\n",
" <td>R0160</td>\n",
" <td>Structured notes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>y</td>\n",
" <td>4</td>\n",
" <td>R0170</td>\n",
" <td>Collateralised securities</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>y</td>\n",
" <td>3</td>\n",
" <td>R0180</td>\n",
" <td>Collective Investments Undertakings</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>y</td>\n",
" <td>3</td>\n",
" <td>R0190</td>\n",
" <td>Derivatives</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>y</td>\n",
" <td>3</td>\n",
" <td>R0200</td>\n",
" <td>Deposits other than cash equivalents</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" axis depth rc-code label\n",
"0 x 0 \n",
"1 x 1 C0010 Solvency II value\n",
"2 y 0 \n",
"3 y 1 Liabilities\n",
"4 y 1 Assets\n",
"5 y 2 R0010 Goodwill\n",
"6 y 2 R0020 Deferred acquisition costs\n",
"7 y 2 R0030 Intangible assets\n",
"8 y 2 R0040 Deferred tax assets\n",
"9 y 2 R0050 Pension benefit surplus\n",
"10 y 2 R0060 Property, plant & equipment held for own use\n",
"11 y 2 R0070 Investments (other than assets held for index-...\n",
"12 y 3 R0080 Property (other than for own use)\n",
"13 y 3 R0090 Holdings in related undertakings, including pa...\n",
"14 y 3 R0100 Equities\n",
"15 y 4 R0110 Equities - listed\n",
"16 y 4 R0120 Equities - unlisted\n",
"17 y 3 R0130 Bonds\n",
"18 y 4 R0140 Government Bonds\n",
"19 y 4 R0150 Corporate Bonds\n",
"20 y 4 R0160 Structured notes\n",
"21 y 4 R0170 Collateralised securities\n",
"22 y 3 R0180 Collective Investments Undertakings\n",
"23 y 3 R0190 Derivatives\n",
"24 y 3 R0200 Deposits other than cash equivalents"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_tables[0:25]"
]
},
{
"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.4"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment