Analysis of EOL license file, missing content and some missing licenses.
Browse files- notebooks/ToL_license_check.ipynb +523 -0
- notebooks/ToL_license_check.py +54 -0
notebooks/ToL_license_check.ipynb
CHANGED
|
@@ -681,6 +681,529 @@
|
|
| 681 |
"eol_license_df.to_csv(\"../data/eol_licenses.csv\", index = False)"
|
| 682 |
]
|
| 683 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 684 |
{
|
| 685 |
"cell_type": "code",
|
| 686 |
"execution_count": null,
|
|
|
|
| 681 |
"eol_license_df.to_csv(\"../data/eol_licenses.csv\", index = False)"
|
| 682 |
]
|
| 683 |
},
|
| 684 |
+
{
|
| 685 |
+
"cell_type": "markdown",
|
| 686 |
+
"metadata": {},
|
| 687 |
+
"source": [
|
| 688 |
+
"## Check EOL License file(s) \n",
|
| 689 |
+
"\n",
|
| 690 |
+
"First we'll look at `eol_licenses.csv` from Sam, which only covers `catalog.csv`, so load both these in to make sure we've got full coverage for all included images (Matt's first match attempt from file created above couldn't find ~113K based on `eol_content_id`)."
|
| 691 |
+
]
|
| 692 |
+
},
|
| 693 |
+
{
|
| 694 |
+
"cell_type": "code",
|
| 695 |
+
"execution_count": 3,
|
| 696 |
+
"metadata": {},
|
| 697 |
+
"outputs": [],
|
| 698 |
+
"source": [
|
| 699 |
+
"cat_df = pd.read_csv(\"../data/catalog.csv\", low_memory = False)\n",
|
| 700 |
+
"license_df = pd.read_csv(\"../data/eol_licenses.csv\", low_memory = False)"
|
| 701 |
+
]
|
| 702 |
+
},
|
| 703 |
+
{
|
| 704 |
+
"cell_type": "code",
|
| 705 |
+
"execution_count": 4,
|
| 706 |
+
"metadata": {},
|
| 707 |
+
"outputs": [],
|
| 708 |
+
"source": [
|
| 709 |
+
"# Add data_source column for easier slicing\n",
|
| 710 |
+
"cat_df.loc[cat_df['inat21_filename'].notna(), 'data_source'] = 'iNat21'\n",
|
| 711 |
+
"cat_df.loc[cat_df['bioscan_filename'].notna(), 'data_source'] = 'BIOSCAN'\n",
|
| 712 |
+
"cat_df.loc[cat_df['eol_content_id'].notna(), 'data_source'] = 'EOL'"
|
| 713 |
+
]
|
| 714 |
+
},
|
| 715 |
+
{
|
| 716 |
+
"cell_type": "code",
|
| 717 |
+
"execution_count": 5,
|
| 718 |
+
"metadata": {},
|
| 719 |
+
"outputs": [],
|
| 720 |
+
"source": [
|
| 721 |
+
"eol_df = cat_df.loc[cat_df.data_source == \"EOL\"]"
|
| 722 |
+
]
|
| 723 |
+
},
|
| 724 |
+
{
|
| 725 |
+
"cell_type": "code",
|
| 726 |
+
"execution_count": 6,
|
| 727 |
+
"metadata": {},
|
| 728 |
+
"outputs": [
|
| 729 |
+
{
|
| 730 |
+
"data": {
|
| 731 |
+
"text/html": [
|
| 732 |
+
"<div>\n",
|
| 733 |
+
"<style scoped>\n",
|
| 734 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 735 |
+
" vertical-align: middle;\n",
|
| 736 |
+
" }\n",
|
| 737 |
+
"\n",
|
| 738 |
+
" .dataframe tbody tr th {\n",
|
| 739 |
+
" vertical-align: top;\n",
|
| 740 |
+
" }\n",
|
| 741 |
+
"\n",
|
| 742 |
+
" .dataframe thead th {\n",
|
| 743 |
+
" text-align: right;\n",
|
| 744 |
+
" }\n",
|
| 745 |
+
"</style>\n",
|
| 746 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 747 |
+
" <thead>\n",
|
| 748 |
+
" <tr style=\"text-align: right;\">\n",
|
| 749 |
+
" <th></th>\n",
|
| 750 |
+
" <th>treeoflife10m_id</th>\n",
|
| 751 |
+
" <th>eol_content_id</th>\n",
|
| 752 |
+
" <th>eol_page_id</th>\n",
|
| 753 |
+
" <th>license</th>\n",
|
| 754 |
+
" <th>owner</th>\n",
|
| 755 |
+
" </tr>\n",
|
| 756 |
+
" </thead>\n",
|
| 757 |
+
" <tbody>\n",
|
| 758 |
+
" <tr>\n",
|
| 759 |
+
" <th>0</th>\n",
|
| 760 |
+
" <td>5a1daf92-60b2-4d23-9916-4c45ec796167</td>\n",
|
| 761 |
+
" <td>5470022</td>\n",
|
| 762 |
+
" <td>500901</td>\n",
|
| 763 |
+
" <td>cc-by-nc-sa-3.0</td>\n",
|
| 764 |
+
" <td>Susan A. Wineriter/Singing Insects of North Am...</td>\n",
|
| 765 |
+
" </tr>\n",
|
| 766 |
+
" <tr>\n",
|
| 767 |
+
" <th>1</th>\n",
|
| 768 |
+
" <td>de10bc79-c46c-4b5b-bc75-64d569b9bf4a</td>\n",
|
| 769 |
+
" <td>5470023</td>\n",
|
| 770 |
+
" <td>858799</td>\n",
|
| 771 |
+
" <td>cc-by-nc-sa-3.0</td>\n",
|
| 772 |
+
" <td>Thomas J. Walker/Singing Insects of North America</td>\n",
|
| 773 |
+
" </tr>\n",
|
| 774 |
+
" <tr>\n",
|
| 775 |
+
" <th>2</th>\n",
|
| 776 |
+
" <td>b68e1a7b-b294-4cfd-b423-1eed359f7c94</td>\n",
|
| 777 |
+
" <td>5470024</td>\n",
|
| 778 |
+
" <td>598702</td>\n",
|
| 779 |
+
" <td>cc-by-nc-sa-3.0</td>\n",
|
| 780 |
+
" <td>Thomas J. Walker/Singing Insects of North America</td>\n",
|
| 781 |
+
" </tr>\n",
|
| 782 |
+
" <tr>\n",
|
| 783 |
+
" <th>3</th>\n",
|
| 784 |
+
" <td>dcc46822-ffa6-46de-a639-bc5e296f50cf</td>\n",
|
| 785 |
+
" <td>5470025</td>\n",
|
| 786 |
+
" <td>598703</td>\n",
|
| 787 |
+
" <td>cc-by-nc-sa-3.0</td>\n",
|
| 788 |
+
" <td>Thomas J. Walker/Singing Insects of North America</td>\n",
|
| 789 |
+
" </tr>\n",
|
| 790 |
+
" <tr>\n",
|
| 791 |
+
" <th>4</th>\n",
|
| 792 |
+
" <td>112d0571-c2dc-442b-9b2e-6665226b0942</td>\n",
|
| 793 |
+
" <td>5470026</td>\n",
|
| 794 |
+
" <td>598703</td>\n",
|
| 795 |
+
" <td>cc-by-nc-sa-3.0</td>\n",
|
| 796 |
+
" <td>Thomas J. Walker/Singing Insects of North America</td>\n",
|
| 797 |
+
" </tr>\n",
|
| 798 |
+
" </tbody>\n",
|
| 799 |
+
"</table>\n",
|
| 800 |
+
"</div>"
|
| 801 |
+
],
|
| 802 |
+
"text/plain": [
|
| 803 |
+
" treeoflife10m_id eol_content_id eol_page_id \n",
|
| 804 |
+
"0 5a1daf92-60b2-4d23-9916-4c45ec796167 5470022 500901 \\\n",
|
| 805 |
+
"1 de10bc79-c46c-4b5b-bc75-64d569b9bf4a 5470023 858799 \n",
|
| 806 |
+
"2 b68e1a7b-b294-4cfd-b423-1eed359f7c94 5470024 598702 \n",
|
| 807 |
+
"3 dcc46822-ffa6-46de-a639-bc5e296f50cf 5470025 598703 \n",
|
| 808 |
+
"4 112d0571-c2dc-442b-9b2e-6665226b0942 5470026 598703 \n",
|
| 809 |
+
"\n",
|
| 810 |
+
" license owner \n",
|
| 811 |
+
"0 cc-by-nc-sa-3.0 Susan A. Wineriter/Singing Insects of North Am... \n",
|
| 812 |
+
"1 cc-by-nc-sa-3.0 Thomas J. Walker/Singing Insects of North America \n",
|
| 813 |
+
"2 cc-by-nc-sa-3.0 Thomas J. Walker/Singing Insects of North America \n",
|
| 814 |
+
"3 cc-by-nc-sa-3.0 Thomas J. Walker/Singing Insects of North America \n",
|
| 815 |
+
"4 cc-by-nc-sa-3.0 Thomas J. Walker/Singing Insects of North America "
|
| 816 |
+
]
|
| 817 |
+
},
|
| 818 |
+
"execution_count": 6,
|
| 819 |
+
"metadata": {},
|
| 820 |
+
"output_type": "execute_result"
|
| 821 |
+
}
|
| 822 |
+
],
|
| 823 |
+
"source": [
|
| 824 |
+
"license_df.head()"
|
| 825 |
+
]
|
| 826 |
+
},
|
| 827 |
+
{
|
| 828 |
+
"cell_type": "code",
|
| 829 |
+
"execution_count": 8,
|
| 830 |
+
"metadata": {},
|
| 831 |
+
"outputs": [
|
| 832 |
+
{
|
| 833 |
+
"data": {
|
| 834 |
+
"text/plain": [
|
| 835 |
+
"(6020135, 5)"
|
| 836 |
+
]
|
| 837 |
+
},
|
| 838 |
+
"execution_count": 8,
|
| 839 |
+
"metadata": {},
|
| 840 |
+
"output_type": "execute_result"
|
| 841 |
+
}
|
| 842 |
+
],
|
| 843 |
+
"source": [
|
| 844 |
+
"license_df.shape"
|
| 845 |
+
]
|
| 846 |
+
},
|
| 847 |
+
{
|
| 848 |
+
"cell_type": "code",
|
| 849 |
+
"execution_count": 9,
|
| 850 |
+
"metadata": {},
|
| 851 |
+
"outputs": [
|
| 852 |
+
{
|
| 853 |
+
"data": {
|
| 854 |
+
"text/plain": [
|
| 855 |
+
"(6844184, 18)"
|
| 856 |
+
]
|
| 857 |
+
},
|
| 858 |
+
"execution_count": 9,
|
| 859 |
+
"metadata": {},
|
| 860 |
+
"output_type": "execute_result"
|
| 861 |
+
}
|
| 862 |
+
],
|
| 863 |
+
"source": [
|
| 864 |
+
"eol_df.shape"
|
| 865 |
+
]
|
| 866 |
+
},
|
| 867 |
+
{
|
| 868 |
+
"cell_type": "markdown",
|
| 869 |
+
"metadata": {},
|
| 870 |
+
"source": [
|
| 871 |
+
"Yeah, we're missing about 82K images in the license file."
|
| 872 |
+
]
|
| 873 |
+
},
|
| 874 |
+
{
|
| 875 |
+
"cell_type": "code",
|
| 876 |
+
"execution_count": 10,
|
| 877 |
+
"metadata": {},
|
| 878 |
+
"outputs": [
|
| 879 |
+
{
|
| 880 |
+
"name": "stdout",
|
| 881 |
+
"output_type": "stream",
|
| 882 |
+
"text": [
|
| 883 |
+
"<class 'pandas.core.frame.DataFrame'>\n",
|
| 884 |
+
"RangeIndex: 6020135 entries, 0 to 6020134\n",
|
| 885 |
+
"Data columns (total 5 columns):\n",
|
| 886 |
+
" # Column Non-Null Count Dtype \n",
|
| 887 |
+
"--- ------ -------------- ----- \n",
|
| 888 |
+
" 0 treeoflife10m_id 6020135 non-null object\n",
|
| 889 |
+
" 1 eol_content_id 6020135 non-null int64 \n",
|
| 890 |
+
" 2 eol_page_id 6020135 non-null int64 \n",
|
| 891 |
+
" 3 license 6020135 non-null object\n",
|
| 892 |
+
" 4 owner 5402786 non-null object\n",
|
| 893 |
+
"dtypes: int64(2), object(3)\n",
|
| 894 |
+
"memory usage: 229.7+ MB\n"
|
| 895 |
+
]
|
| 896 |
+
}
|
| 897 |
+
],
|
| 898 |
+
"source": [
|
| 899 |
+
"license_df.info(show_counts = True)"
|
| 900 |
+
]
|
| 901 |
+
},
|
| 902 |
+
{
|
| 903 |
+
"cell_type": "code",
|
| 904 |
+
"execution_count": 11,
|
| 905 |
+
"metadata": {},
|
| 906 |
+
"outputs": [
|
| 907 |
+
{
|
| 908 |
+
"data": {
|
| 909 |
+
"text/plain": [
|
| 910 |
+
"license\n",
|
| 911 |
+
"cc-0-1.0 282812\n",
|
| 912 |
+
"cc-publicdomain 172641\n",
|
| 913 |
+
"cc-by-nc-sa-3.0 130678\n",
|
| 914 |
+
"cc-by-nc 14160\n",
|
| 915 |
+
"cc-by-sa-3.0 11622\n",
|
| 916 |
+
"cc-by-3.0 5430\n",
|
| 917 |
+
"cc-by-nc-2.0 2\n",
|
| 918 |
+
"No known copyright restrictions 2\n",
|
| 919 |
+
"cc-by-nc-sa 1\n",
|
| 920 |
+
"cc-by 1\n",
|
| 921 |
+
"Name: count, dtype: int64"
|
| 922 |
+
]
|
| 923 |
+
},
|
| 924 |
+
"execution_count": 11,
|
| 925 |
+
"metadata": {},
|
| 926 |
+
"output_type": "execute_result"
|
| 927 |
+
}
|
| 928 |
+
],
|
| 929 |
+
"source": [
|
| 930 |
+
"license_df.loc[license_df[\"owner\"].isna(), \"license\"].value_counts()"
|
| 931 |
+
]
|
| 932 |
+
},
|
| 933 |
+
{
|
| 934 |
+
"cell_type": "markdown",
|
| 935 |
+
"metadata": {},
|
| 936 |
+
"source": [
|
| 937 |
+
"CC BY licenses without `owner` indicated is rather problematic."
|
| 938 |
+
]
|
| 939 |
+
},
|
| 940 |
+
{
|
| 941 |
+
"cell_type": "code",
|
| 942 |
+
"execution_count": 14,
|
| 943 |
+
"metadata": {},
|
| 944 |
+
"outputs": [
|
| 945 |
+
{
|
| 946 |
+
"data": {
|
| 947 |
+
"text/html": [
|
| 948 |
+
"<div>\n",
|
| 949 |
+
"<style scoped>\n",
|
| 950 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 951 |
+
" vertical-align: middle;\n",
|
| 952 |
+
" }\n",
|
| 953 |
+
"\n",
|
| 954 |
+
" .dataframe tbody tr th {\n",
|
| 955 |
+
" vertical-align: top;\n",
|
| 956 |
+
" }\n",
|
| 957 |
+
"\n",
|
| 958 |
+
" .dataframe thead th {\n",
|
| 959 |
+
" text-align: right;\n",
|
| 960 |
+
" }\n",
|
| 961 |
+
"</style>\n",
|
| 962 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 963 |
+
" <thead>\n",
|
| 964 |
+
" <tr style=\"text-align: right;\">\n",
|
| 965 |
+
" <th></th>\n",
|
| 966 |
+
" <th>treeoflife10m_id</th>\n",
|
| 967 |
+
" <th>eol_content_id</th>\n",
|
| 968 |
+
" <th>eol_page_id</th>\n",
|
| 969 |
+
" <th>license</th>\n",
|
| 970 |
+
" <th>owner</th>\n",
|
| 971 |
+
" </tr>\n",
|
| 972 |
+
" </thead>\n",
|
| 973 |
+
" <tbody>\n",
|
| 974 |
+
" <tr>\n",
|
| 975 |
+
" <th>4396225</th>\n",
|
| 976 |
+
" <td>f86dbf9d-8402-471f-9772-ccb418b6f8fe</td>\n",
|
| 977 |
+
" <td>28351223</td>\n",
|
| 978 |
+
" <td>51902011</td>\n",
|
| 979 |
+
" <td>cc-0-1.0</td>\n",
|
| 980 |
+
" <td>NaN</td>\n",
|
| 981 |
+
" </tr>\n",
|
| 982 |
+
" <tr>\n",
|
| 983 |
+
" <th>1072047</th>\n",
|
| 984 |
+
" <td>2cd83c40-1fd8-44f8-867b-57aef25ff281</td>\n",
|
| 985 |
+
" <td>14796160</td>\n",
|
| 986 |
+
" <td>160017</td>\n",
|
| 987 |
+
" <td>cc-by-nc-sa-3.0</td>\n",
|
| 988 |
+
" <td>NaN</td>\n",
|
| 989 |
+
" </tr>\n",
|
| 990 |
+
" <tr>\n",
|
| 991 |
+
" <th>4356765</th>\n",
|
| 992 |
+
" <td>3df036ca-631d-4795-9079-d85b8fcef3c1</td>\n",
|
| 993 |
+
" <td>28311652</td>\n",
|
| 994 |
+
" <td>1249103</td>\n",
|
| 995 |
+
" <td>cc-0-1.0</td>\n",
|
| 996 |
+
" <td>NaN</td>\n",
|
| 997 |
+
" </tr>\n",
|
| 998 |
+
" <tr>\n",
|
| 999 |
+
" <th>1162697</th>\n",
|
| 1000 |
+
" <td>883e002f-fa75-4e96-9b78-7dce34a3a4e1</td>\n",
|
| 1001 |
+
" <td>14888539</td>\n",
|
| 1002 |
+
" <td>11486400</td>\n",
|
| 1003 |
+
" <td>cc-by-nc-sa-3.0</td>\n",
|
| 1004 |
+
" <td>NaN</td>\n",
|
| 1005 |
+
" </tr>\n",
|
| 1006 |
+
" <tr>\n",
|
| 1007 |
+
" <th>377813</th>\n",
|
| 1008 |
+
" <td>5babc816-d142-434b-b505-997de27a87b2</td>\n",
|
| 1009 |
+
" <td>10646391</td>\n",
|
| 1010 |
+
" <td>52251608</td>\n",
|
| 1011 |
+
" <td>cc-by-nc</td>\n",
|
| 1012 |
+
" <td>NaN</td>\n",
|
| 1013 |
+
" </tr>\n",
|
| 1014 |
+
" </tbody>\n",
|
| 1015 |
+
"</table>\n",
|
| 1016 |
+
"</div>"
|
| 1017 |
+
],
|
| 1018 |
+
"text/plain": [
|
| 1019 |
+
" treeoflife10m_id eol_content_id eol_page_id \n",
|
| 1020 |
+
"4396225 f86dbf9d-8402-471f-9772-ccb418b6f8fe 28351223 51902011 \\\n",
|
| 1021 |
+
"1072047 2cd83c40-1fd8-44f8-867b-57aef25ff281 14796160 160017 \n",
|
| 1022 |
+
"4356765 3df036ca-631d-4795-9079-d85b8fcef3c1 28311652 1249103 \n",
|
| 1023 |
+
"1162697 883e002f-fa75-4e96-9b78-7dce34a3a4e1 14888539 11486400 \n",
|
| 1024 |
+
"377813 5babc816-d142-434b-b505-997de27a87b2 10646391 52251608 \n",
|
| 1025 |
+
"\n",
|
| 1026 |
+
" license owner \n",
|
| 1027 |
+
"4396225 cc-0-1.0 NaN \n",
|
| 1028 |
+
"1072047 cc-by-nc-sa-3.0 NaN \n",
|
| 1029 |
+
"4356765 cc-0-1.0 NaN \n",
|
| 1030 |
+
"1162697 cc-by-nc-sa-3.0 NaN \n",
|
| 1031 |
+
"377813 cc-by-nc NaN "
|
| 1032 |
+
]
|
| 1033 |
+
},
|
| 1034 |
+
"execution_count": 14,
|
| 1035 |
+
"metadata": {},
|
| 1036 |
+
"output_type": "execute_result"
|
| 1037 |
+
}
|
| 1038 |
+
],
|
| 1039 |
+
"source": [
|
| 1040 |
+
"license_df.loc[license_df[\"owner\"].isna()].sample(5)"
|
| 1041 |
+
]
|
| 1042 |
+
},
|
| 1043 |
+
{
|
| 1044 |
+
"cell_type": "markdown",
|
| 1045 |
+
"metadata": {},
|
| 1046 |
+
"source": [
|
| 1047 |
+
"Tracked down `eol_content_id` [14796160](https://eol.org/media/14796160), original source is [BioImages](https://www.bioimages.org.uk/image.php?id=79950) with copyright Malcolm Storey (like 99% of the images on the site (see their [conditions of use](https://www.bioimages.org.uk/cright.htm))). He is listed as \"compiler\" on the EOL media page."
|
| 1048 |
+
]
|
| 1049 |
+
},
|
| 1050 |
+
{
|
| 1051 |
+
"cell_type": "code",
|
| 1052 |
+
"execution_count": 12,
|
| 1053 |
+
"metadata": {},
|
| 1054 |
+
"outputs": [
|
| 1055 |
+
{
|
| 1056 |
+
"data": {
|
| 1057 |
+
"text/plain": [
|
| 1058 |
+
"license\n",
|
| 1059 |
+
"cc-by-nc-4.0 2431101\n",
|
| 1060 |
+
"cc-by-sa-3.0 776696\n",
|
| 1061 |
+
"cc-by-nc-sa-3.0 559160\n",
|
| 1062 |
+
"cc-by-3.0 428137\n",
|
| 1063 |
+
"cc-by-4.0 379862\n",
|
| 1064 |
+
"cc-by-nc 327467\n",
|
| 1065 |
+
"cc-publicdomain 299235\n",
|
| 1066 |
+
"cc-0-1.0 299119\n",
|
| 1067 |
+
"cc-by-nc-sa-4.0 191967\n",
|
| 1068 |
+
"cc-by-nc-sa 153033\n",
|
| 1069 |
+
"cc-by-sa-4.0 66743\n",
|
| 1070 |
+
"cc-by 47300\n",
|
| 1071 |
+
"cc-by-sa-2.0 31019\n",
|
| 1072 |
+
"cc-by-nc-2.0 28175\n",
|
| 1073 |
+
"No known copyright restrictions 801\n",
|
| 1074 |
+
"cc-by-nc-sa-2.5 315\n",
|
| 1075 |
+
"public domain 5\n",
|
| 1076 |
+
"Name: count, dtype: int64"
|
| 1077 |
+
]
|
| 1078 |
+
},
|
| 1079 |
+
"execution_count": 12,
|
| 1080 |
+
"metadata": {},
|
| 1081 |
+
"output_type": "execute_result"
|
| 1082 |
+
}
|
| 1083 |
+
],
|
| 1084 |
+
"source": [
|
| 1085 |
+
"license_df.license.value_counts()"
|
| 1086 |
+
]
|
| 1087 |
+
},
|
| 1088 |
+
{
|
| 1089 |
+
"cell_type": "code",
|
| 1090 |
+
"execution_count": 15,
|
| 1091 |
+
"metadata": {},
|
| 1092 |
+
"outputs": [
|
| 1093 |
+
{
|
| 1094 |
+
"data": {
|
| 1095 |
+
"text/html": [
|
| 1096 |
+
"<div>\n",
|
| 1097 |
+
"<style scoped>\n",
|
| 1098 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 1099 |
+
" vertical-align: middle;\n",
|
| 1100 |
+
" }\n",
|
| 1101 |
+
"\n",
|
| 1102 |
+
" .dataframe tbody tr th {\n",
|
| 1103 |
+
" vertical-align: top;\n",
|
| 1104 |
+
" }\n",
|
| 1105 |
+
"\n",
|
| 1106 |
+
" .dataframe thead th {\n",
|
| 1107 |
+
" text-align: right;\n",
|
| 1108 |
+
" }\n",
|
| 1109 |
+
"</style>\n",
|
| 1110 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 1111 |
+
" <thead>\n",
|
| 1112 |
+
" <tr style=\"text-align: right;\">\n",
|
| 1113 |
+
" <th></th>\n",
|
| 1114 |
+
" <th>treeoflife10m_id</th>\n",
|
| 1115 |
+
" <th>eol_content_id</th>\n",
|
| 1116 |
+
" <th>eol_page_id</th>\n",
|
| 1117 |
+
" <th>license</th>\n",
|
| 1118 |
+
" <th>owner</th>\n",
|
| 1119 |
+
" </tr>\n",
|
| 1120 |
+
" </thead>\n",
|
| 1121 |
+
" <tbody>\n",
|
| 1122 |
+
" <tr>\n",
|
| 1123 |
+
" <th>4937687</th>\n",
|
| 1124 |
+
" <td>a19281ef-3c49-4bec-b7b0-b7b4027d6237</td>\n",
|
| 1125 |
+
" <td>29043581</td>\n",
|
| 1126 |
+
" <td>46576133</td>\n",
|
| 1127 |
+
" <td>No known copyright restrictions</td>\n",
|
| 1128 |
+
" <td>Smithsonian Institution</td>\n",
|
| 1129 |
+
" </tr>\n",
|
| 1130 |
+
" <tr>\n",
|
| 1131 |
+
" <th>5298480</th>\n",
|
| 1132 |
+
" <td>4d4c7538-9cbd-4ac6-9f4c-fc73bf0c260f</td>\n",
|
| 1133 |
+
" <td>29405472</td>\n",
|
| 1134 |
+
" <td>1178661</td>\n",
|
| 1135 |
+
" <td>No known copyright restrictions</td>\n",
|
| 1136 |
+
" <td>Internet Archive Book Images</td>\n",
|
| 1137 |
+
" </tr>\n",
|
| 1138 |
+
" <tr>\n",
|
| 1139 |
+
" <th>5452574</th>\n",
|
| 1140 |
+
" <td>74a636d7-b681-47be-bed7-5a726de5c9d1</td>\n",
|
| 1141 |
+
" <td>29560411</td>\n",
|
| 1142 |
+
" <td>964204</td>\n",
|
| 1143 |
+
" <td>No known copyright restrictions</td>\n",
|
| 1144 |
+
" <td>current</td>\n",
|
| 1145 |
+
" </tr>\n",
|
| 1146 |
+
" <tr>\n",
|
| 1147 |
+
" <th>4959929</th>\n",
|
| 1148 |
+
" <td>b012b50b-04c2-4ca9-9078-18351897e3b9</td>\n",
|
| 1149 |
+
" <td>29065898</td>\n",
|
| 1150 |
+
" <td>126217</td>\n",
|
| 1151 |
+
" <td>No known copyright restrictions</td>\n",
|
| 1152 |
+
" <td>Biologicheskii institut (Akademiia nauk SSSR);...</td>\n",
|
| 1153 |
+
" </tr>\n",
|
| 1154 |
+
" <tr>\n",
|
| 1155 |
+
" <th>5073633</th>\n",
|
| 1156 |
+
" <td>4a2c6dd6-1dd4-4a0c-9a9d-0f219f3a4069</td>\n",
|
| 1157 |
+
" <td>29179854</td>\n",
|
| 1158 |
+
" <td>65417018</td>\n",
|
| 1159 |
+
" <td>No known copyright restrictions</td>\n",
|
| 1160 |
+
" <td>OSU Special Collections & Archives : Commons</td>\n",
|
| 1161 |
+
" </tr>\n",
|
| 1162 |
+
" </tbody>\n",
|
| 1163 |
+
"</table>\n",
|
| 1164 |
+
"</div>"
|
| 1165 |
+
],
|
| 1166 |
+
"text/plain": [
|
| 1167 |
+
" treeoflife10m_id eol_content_id eol_page_id \n",
|
| 1168 |
+
"4937687 a19281ef-3c49-4bec-b7b0-b7b4027d6237 29043581 46576133 \\\n",
|
| 1169 |
+
"5298480 4d4c7538-9cbd-4ac6-9f4c-fc73bf0c260f 29405472 1178661 \n",
|
| 1170 |
+
"5452574 74a636d7-b681-47be-bed7-5a726de5c9d1 29560411 964204 \n",
|
| 1171 |
+
"4959929 b012b50b-04c2-4ca9-9078-18351897e3b9 29065898 126217 \n",
|
| 1172 |
+
"5073633 4a2c6dd6-1dd4-4a0c-9a9d-0f219f3a4069 29179854 65417018 \n",
|
| 1173 |
+
"\n",
|
| 1174 |
+
" license \n",
|
| 1175 |
+
"4937687 No known copyright restrictions \\\n",
|
| 1176 |
+
"5298480 No known copyright restrictions \n",
|
| 1177 |
+
"5452574 No known copyright restrictions \n",
|
| 1178 |
+
"4959929 No known copyright restrictions \n",
|
| 1179 |
+
"5073633 No known copyright restrictions \n",
|
| 1180 |
+
"\n",
|
| 1181 |
+
" owner \n",
|
| 1182 |
+
"4937687 Smithsonian Institution \n",
|
| 1183 |
+
"5298480 Internet Archive Book Images \n",
|
| 1184 |
+
"5452574 current \n",
|
| 1185 |
+
"4959929 Biologicheskii institut (Akademiia nauk SSSR);... \n",
|
| 1186 |
+
"5073633 OSU Special Collections & Archives : Commons "
|
| 1187 |
+
]
|
| 1188 |
+
},
|
| 1189 |
+
"execution_count": 15,
|
| 1190 |
+
"metadata": {},
|
| 1191 |
+
"output_type": "execute_result"
|
| 1192 |
+
}
|
| 1193 |
+
],
|
| 1194 |
+
"source": [
|
| 1195 |
+
"license_df.loc[license_df[\"license\"] == \"No known copyright restrictions\"].sample(5)"
|
| 1196 |
+
]
|
| 1197 |
+
},
|
| 1198 |
+
{
|
| 1199 |
+
"cell_type": "code",
|
| 1200 |
+
"execution_count": 16,
|
| 1201 |
+
"metadata": {},
|
| 1202 |
+
"outputs": [],
|
| 1203 |
+
"source": [
|
| 1204 |
+
"license_df.loc[license_df[\"owner\"].isna()].to_csv(\"../data/eol_licenses_missing_owner.csv\", index = False)"
|
| 1205 |
+
]
|
| 1206 |
+
},
|
| 1207 |
{
|
| 1208 |
"cell_type": "code",
|
| 1209 |
"execution_count": null,
|
notebooks/ToL_license_check.py
CHANGED
|
@@ -73,4 +73,58 @@ eol_license_df.head()
|
|
| 73 |
# %%
|
| 74 |
eol_license_df.to_csv("../data/eol_licenses.csv", index = False)
|
| 75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
# %%
|
|
|
|
| 73 |
# %%
|
| 74 |
eol_license_df.to_csv("../data/eol_licenses.csv", index = False)
|
| 75 |
|
| 76 |
+
# %% [markdown]
|
| 77 |
+
# ## Check EOL License file(s)
|
| 78 |
+
#
|
| 79 |
+
# First we'll look at `eol_licenses.csv` from Sam, which only covers `catalog.csv`, so load both these in to make sure we've got full coverage for all included images (Matt's first match attempt from file created above couldn't find ~113K based on `eol_content_id`).
|
| 80 |
+
|
| 81 |
+
# %%
|
| 82 |
+
cat_df = pd.read_csv("../data/catalog.csv", low_memory = False)
|
| 83 |
+
license_df = pd.read_csv("../data/eol_licenses.csv", low_memory = False)
|
| 84 |
+
|
| 85 |
+
# %%
|
| 86 |
+
# Add data_source column for easier slicing
|
| 87 |
+
cat_df.loc[cat_df['inat21_filename'].notna(), 'data_source'] = 'iNat21'
|
| 88 |
+
cat_df.loc[cat_df['bioscan_filename'].notna(), 'data_source'] = 'BIOSCAN'
|
| 89 |
+
cat_df.loc[cat_df['eol_content_id'].notna(), 'data_source'] = 'EOL'
|
| 90 |
+
|
| 91 |
+
# %%
|
| 92 |
+
eol_df = cat_df.loc[cat_df.data_source == "EOL"]
|
| 93 |
+
|
| 94 |
+
# %%
|
| 95 |
+
license_df.head()
|
| 96 |
+
|
| 97 |
+
# %%
|
| 98 |
+
license_df.shape
|
| 99 |
+
|
| 100 |
+
# %%
|
| 101 |
+
eol_df.shape
|
| 102 |
+
|
| 103 |
+
# %% [markdown]
|
| 104 |
+
# Yeah, we're missing about 82K images in the license file.
|
| 105 |
+
|
| 106 |
+
# %%
|
| 107 |
+
license_df.info(show_counts = True)
|
| 108 |
+
|
| 109 |
+
# %%
|
| 110 |
+
license_df.loc[license_df["owner"].isna(), "license"].value_counts()
|
| 111 |
+
|
| 112 |
+
# %% [markdown]
|
| 113 |
+
# CC BY licenses without `owner` indicated is rather problematic.
|
| 114 |
+
|
| 115 |
+
# %%
|
| 116 |
+
license_df.loc[license_df["owner"].isna()].sample(5)
|
| 117 |
+
|
| 118 |
+
# %% [markdown]
|
| 119 |
+
# Tracked down `eol_content_id` [14796160](https://eol.org/media/14796160), original source is [BioImages](https://www.bioimages.org.uk/image.php?id=79950) with copyright Malcolm Storey (like 99% of the images on the site (see their [conditions of use](https://www.bioimages.org.uk/cright.htm))). He is listed as "compiler" on the EOL media page.
|
| 120 |
+
|
| 121 |
+
# %%
|
| 122 |
+
license_df.license.value_counts()
|
| 123 |
+
|
| 124 |
+
# %%
|
| 125 |
+
license_df.loc[license_df["license"] == "No known copyright restrictions"].sample(5)
|
| 126 |
+
|
| 127 |
+
# %%
|
| 128 |
+
license_df.loc[license_df["owner"].isna()].to_csv("../data/eol_licenses_missing_owner.csv", index = False)
|
| 129 |
+
|
| 130 |
# %%
|