Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.2.3
rev: 1.9.1
hooks:
- id: nbqa-isort
- id: nbqa-black
Expand Down
57 changes: 31 additions & 26 deletions agencies-gannt-timeline.ipynb

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions dev-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,15 @@ isort
flake8
nbqa
pre-commit
rdflib
rocrate
giturlparse
requests
python-dotenv
jupyterlab-code-formatter
PyGithub
GitPython
beautifulsoup4
lxml
arrow

165 changes: 85 additions & 80 deletions govt-agencies-network.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 1,
"id": "6dfdf0a6-eb86-47a9-b595-0640faa16fba",
"metadata": {},
"outputs": [],
Expand All @@ -30,7 +30,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 2,
"id": "14fe492f-5528-4c63-b9c5-61ae0eefa985",
"metadata": {
"tags": [
Expand Down Expand Up @@ -68,7 +68,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 3,
"id": "600960d8-d8e1-400b-8bc8-6c68ac8c5d3e",
"metadata": {},
"outputs": [],
Expand All @@ -80,7 +80,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 4,
"id": "4bfd91b9-c1a7-45e9-a356-7f57ffbf2eb6",
"metadata": {
"tags": [
Expand Down Expand Up @@ -129,113 +129,113 @@
" <tr>\n",
" <th>0</th>\n",
" <td>uri</td>\n",
" <td>http://www.wikidata.org/entity/Q16956105</td>\n",
" <td>http://www.wikidata.org/entity/Q16956444</td>\n",
" <td>literal</td>\n",
" <td>CA 15</td>\n",
" <td>CA 1954</td>\n",
" <td>literal</td>\n",
" <td>CA 8</td>\n",
" <td>CA 1869</td>\n",
" <td>http://www.w3.org/2001/XMLSchema#dateTime</td>\n",
" <td>literal</td>\n",
" <td>1901-01-01T00:00:00Z</td>\n",
" <td>1975-04-21T00:00:00Z</td>\n",
" <td>http://www.w3.org/2001/XMLSchema#dateTime</td>\n",
" <td>literal</td>\n",
" <td>1916-11-14T00:00:00Z</td>\n",
" <td>1975-12-22T00:00:00Z</td>\n",
" <td>literal</td>\n",
" <td>Department of Home Affairs (1901-1916)</td>\n",
" <td>Department of the Environment (1975-1975)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>uri</td>\n",
" <td>http://www.wikidata.org/entity/Q16956105</td>\n",
" <td>http://www.wikidata.org/entity/Q16956444</td>\n",
" <td>literal</td>\n",
" <td>CA 14</td>\n",
" <td>CA 1957</td>\n",
" <td>literal</td>\n",
" <td>CA 8</td>\n",
" <td>CA 1869</td>\n",
" <td>http://www.w3.org/2001/XMLSchema#dateTime</td>\n",
" <td>literal</td>\n",
" <td>1901-01-01T00:00:00Z</td>\n",
" <td>1975-04-21T00:00:00Z</td>\n",
" <td>http://www.w3.org/2001/XMLSchema#dateTime</td>\n",
" <td>literal</td>\n",
" <td>1916-11-14T00:00:00Z</td>\n",
" <td>1975-12-22T00:00:00Z</td>\n",
" <td>literal</td>\n",
" <td>Department of Home Affairs (1901-1916)</td>\n",
" <td>Department of the Environment (1975-1975)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>uri</td>\n",
" <td>http://www.wikidata.org/entity/Q16956110</td>\n",
" <td>http://www.wikidata.org/entity/Q16956449</td>\n",
" <td>literal</td>\n",
" <td>CA 27</td>\n",
" <td>CA 1476</td>\n",
" <td>literal</td>\n",
" <td>CA 24</td>\n",
" <td>CA 1407</td>\n",
" <td>http://www.w3.org/2001/XMLSchema#dateTime</td>\n",
" <td>literal</td>\n",
" <td>1928-12-10T00:00:00Z</td>\n",
" <td>1971-05-31T00:00:00Z</td>\n",
" <td>http://www.w3.org/2001/XMLSchema#dateTime</td>\n",
" <td>literal</td>\n",
" <td>1932-04-12T00:00:00Z</td>\n",
" <td>1972-12-19T00:00:00Z</td>\n",
" <td>literal</td>\n",
" <td>Department of Home Affairs (1928-1932)</td>\n",
" <td>Department of the Environment, Aborigines and ...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>uri</td>\n",
" <td>http://www.wikidata.org/entity/Q16956114</td>\n",
" <td>http://www.wikidata.org/entity/Q16956449</td>\n",
" <td>literal</td>\n",
" <td>CA 3068</td>\n",
" <td>CA 1479</td>\n",
" <td>literal</td>\n",
" <td>CA 2474</td>\n",
" <td>CA 1407</td>\n",
" <td>http://www.w3.org/2001/XMLSchema#dateTime</td>\n",
" <td>literal</td>\n",
" <td>1977-12-20T00:00:00Z</td>\n",
" <td>1971-05-31T00:00:00Z</td>\n",
" <td>http://www.w3.org/2001/XMLSchema#dateTime</td>\n",
" <td>literal</td>\n",
" <td>1980-11-03T00:00:00Z</td>\n",
" <td>1972-12-19T00:00:00Z</td>\n",
" <td>literal</td>\n",
" <td>Department of Home Affairs (1977-1980)</td>\n",
" <td>Department of the Environment, Aborigines and ...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>uri</td>\n",
" <td>http://www.wikidata.org/entity/Q16956119</td>\n",
" <td>http://www.wikidata.org/entity/Q16956449</td>\n",
" <td>literal</td>\n",
" <td>CA 4131</td>\n",
" <td>CA 1486</td>\n",
" <td>literal</td>\n",
" <td>CA 3068</td>\n",
" <td>CA 1407</td>\n",
" <td>http://www.w3.org/2001/XMLSchema#dateTime</td>\n",
" <td>literal</td>\n",
" <td>1980-11-03T00:00:00Z</td>\n",
" <td>1971-05-31T00:00:00Z</td>\n",
" <td>http://www.w3.org/2001/XMLSchema#dateTime</td>\n",
" <td>literal</td>\n",
" <td>1984-12-13T00:00:00Z</td>\n",
" <td>1972-12-19T00:00:00Z</td>\n",
" <td>literal</td>\n",
" <td>Department of Home Affairs and Environment (19...</td>\n",
" <td>Department of the Environment, Aborigines and ...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" item_type item_value after_id_type \\\n",
"0 uri http://www.wikidata.org/entity/Q16956105 literal \n",
"1 uri http://www.wikidata.org/entity/Q16956105 literal \n",
"2 uri http://www.wikidata.org/entity/Q16956110 literal \n",
"3 uri http://www.wikidata.org/entity/Q16956114 literal \n",
"4 uri http://www.wikidata.org/entity/Q16956119 literal \n",
"0 uri http://www.wikidata.org/entity/Q16956444 literal \n",
"1 uri http://www.wikidata.org/entity/Q16956444 literal \n",
"2 uri http://www.wikidata.org/entity/Q16956449 literal \n",
"3 uri http://www.wikidata.org/entity/Q16956449 literal \n",
"4 uri http://www.wikidata.org/entity/Q16956449 literal \n",
"\n",
" after_id_value id_type id_value start_date_datatype \\\n",
"0 CA 15 literal CA 8 http://www.w3.org/2001/XMLSchema#dateTime \n",
"1 CA 14 literal CA 8 http://www.w3.org/2001/XMLSchema#dateTime \n",
"2 CA 27 literal CA 24 http://www.w3.org/2001/XMLSchema#dateTime \n",
"3 CA 3068 literal CA 2474 http://www.w3.org/2001/XMLSchema#dateTime \n",
"4 CA 4131 literal CA 3068 http://www.w3.org/2001/XMLSchema#dateTime \n",
"0 CA 1954 literal CA 1869 http://www.w3.org/2001/XMLSchema#dateTime \n",
"1 CA 1957 literal CA 1869 http://www.w3.org/2001/XMLSchema#dateTime \n",
"2 CA 1476 literal CA 1407 http://www.w3.org/2001/XMLSchema#dateTime \n",
"3 CA 1479 literal CA 1407 http://www.w3.org/2001/XMLSchema#dateTime \n",
"4 CA 1486 literal CA 1407 http://www.w3.org/2001/XMLSchema#dateTime \n",
"\n",
" start_date_type start_date_value \\\n",
"0 literal 1901-01-01T00:00:00Z \n",
"1 literal 1901-01-01T00:00:00Z \n",
"2 literal 1928-12-10T00:00:00Z \n",
"3 literal 1977-12-20T00:00:00Z \n",
"4 literal 1980-11-03T00:00:00Z \n",
"0 literal 1975-04-21T00:00:00Z \n",
"1 literal 1975-04-21T00:00:00Z \n",
"2 literal 1971-05-31T00:00:00Z \n",
"3 literal 1971-05-31T00:00:00Z \n",
"4 literal 1971-05-31T00:00:00Z \n",
"\n",
" end_date_datatype end_date_type \\\n",
"0 http://www.w3.org/2001/XMLSchema#dateTime literal \n",
Expand All @@ -245,21 +245,21 @@
"4 http://www.w3.org/2001/XMLSchema#dateTime literal \n",
"\n",
" end_date_value label_type \\\n",
"0 1916-11-14T00:00:00Z literal \n",
"1 1916-11-14T00:00:00Z literal \n",
"2 1932-04-12T00:00:00Z literal \n",
"3 1980-11-03T00:00:00Z literal \n",
"4 1984-12-13T00:00:00Z literal \n",
"0 1975-12-22T00:00:00Z literal \n",
"1 1975-12-22T00:00:00Z literal \n",
"2 1972-12-19T00:00:00Z literal \n",
"3 1972-12-19T00:00:00Z literal \n",
"4 1972-12-19T00:00:00Z literal \n",
"\n",
" label_value \n",
"0 Department of Home Affairs (1901-1916) \n",
"1 Department of Home Affairs (1901-1916) \n",
"2 Department of Home Affairs (1928-1932) \n",
"3 Department of Home Affairs (1977-1980) \n",
"4 Department of Home Affairs and Environment (19... "
"0 Department of the Environment (1975-1975) \n",
"1 Department of the Environment (1975-1975) \n",
"2 Department of the Environment, Aborigines and ... \n",
"3 Department of the Environment, Aborigines and ... \n",
"4 Department of the Environment, Aborigines and ... "
]
},
"execution_count": 14,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -270,7 +270,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 5,
"id": "59fc0ebf-dc52-4790-94c7-2b51c7d416cd",
"metadata": {
"tags": [
Expand Down Expand Up @@ -361,7 +361,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 6,
"id": "4ab5f05f-be42-4f3e-a280-225f1aa95232",
"metadata": {
"tags": [
Expand All @@ -375,7 +375,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 7,
"id": "88286772-5533-42e1-9d5a-3f8d0bffe593",
"metadata": {
"tags": [
Expand Down Expand Up @@ -404,7 +404,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 8,
"id": "be969744-128e-4ad6-9faf-1710b8cda1e0",
"metadata": {},
"outputs": [],
Expand All @@ -416,7 +416,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 9,
"id": "3a4de068-76fe-45b3-99f9-0def739955b3",
"metadata": {
"tags": [
Expand Down Expand Up @@ -455,7 +455,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 10,
"id": "37545bc4-f1c1-4c00-9437-9562ebfabb95",
"metadata": {},
"outputs": [
Expand All @@ -474,7 +474,7 @@
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x7f6ce6711e80>"
"<IPython.lib.display.IFrame at 0x7f451c16ea30>"
]
},
"metadata": {},
Expand Down Expand Up @@ -503,7 +503,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.12 64-bit ('3.8.12')",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -517,19 +517,24 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.12.11"
},
"vscode": {
"interpreter": {
"hash": "f54aba2de7a75230217f549a064c6555500d2132634fbcab9606dbfda34a2a1b"
}
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"version_major": 2,
"version_minor": 0
}
"rocrate": {
"author": [
{
"mainEntityOfPage": "https://timsherratt.au",
"name": "Sherratt, Tim",
"orcid": "https://orcid.org/0000-0001-7956-4498"
}
],
"description": "This notebook visualises changes in Australian government departments over time, using data from Wikidata. It creates a hierarchically-ordered network graph where each agency is represented as a node whose position and colour is determined by the decade in which the agency was created.",
"name": "Create a network graph visualisation of Australian government departments",
"workExample": [
{
"name": "View the interactive graph",
"url": "https://glam-workbench.net/wikidata/examples/govt-agencies-network.html"
}
]
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.nbqa.addopts]
flake8 = [
"--ignore=E501,W503"
"--ignore=E501,W503,E402"
]
[tool.pytest.ini_options]
addopts = "--ignore-glob=Untitled* --ignore=snippets.ipynb --ignore-glob=draft*"
3 changes: 2 additions & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ python-slugify
requests-cache
tqdm
ipywidgets
python-dotenv
python-dotenv
upsetplot
Loading