{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Edge File with DBPedia links\n", "\n", "This notebook relates to [KGTK issue 259](https://github.com/usc-isi-i2/kgtk/issues/259)\n", "\n", "Example command to run the notebook:\n", "\n", "```papermill DBPedia_links.ipynb DBPedia_output.ipynb```" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "tags": [ "parameters" ] }, "outputs": [], "source": [ "#kgtk_files_dir: Path where the KGTK files are present(specifically the sitelinks.en.tsv.gz)\n", "kgtk_files_dir = '/Users/rijulvohra/Documents/work/Novartis-ISI/global_data_folder/kgtk_edge_files/'\n", "\n", "#sitelinks_filename\n", "sitelinks_filename = 'sitelinks.tsv.gz'\n", "\n", "#Is the sitelinks file processed to extract all the wiki links\n", "sitelinks_processed = False\n", "\n", "#Name of the file generated after sitelinks file is processed or if it is already processed\n", "processed_sitelinks = 'sitelinks.wikipedia1.tsv.gz'" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "import json\n", "import gzip\n", "import glob\n", "import os\n", "import pandas as pd\n", "import time" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "os.environ[\"SITELINKS\"] = os.path.join(kgtk_files_dir, sitelinks_filename)\n", "os.environ[\"WIKIPEDIA_TEMP\"] = os.path.join(kgtk_files_dir,processed_sitelinks)\n", "os.environ['WIKIPEDIA'] = os.path.join(kgtk_files_dir,'sitelinks.wikipedia1.id.tsv.gz')\n", "output_file = os.path.join(kgtk_files_dir,'derived.dbpedia.links.wihout.id.tsv.gz')\n", "final_output_file = os.path.join(kgtk_files_dir,'derived.dbpedia.links.tsv.gz')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "if not(sitelinks_processed):\n", " !kgtk query -i $SITELINKS \\\n", " --match '(n1)-[l:`wikipedia_sitelink` {lang: language, label:lab}]->(n2)' \\\n", " --return 'n1 as node1, lab as label, n2 as node2, language as language' \\\n", " -o $WIKIPEDIA_TEMP" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
node1labelnode2language
0Q1wikipedia_sitelinkhttp://oc.wikipedia.org/wiki/Univèrsoc
1Q1wikipedia_sitelinkhttp://cdo.wikipedia.org/wiki/Ṳ̄-dêucdo
2Q1wikipedia_sitelinkhttp://ml.wikipedia.org/wiki/പ്രപഞ്ചംml
3Q1wikipedia_sitelinkhttp://si.wikipedia.org/wiki/විශ්වයsi
4Q1wikipedia_sitelinkhttp://bxr.wikipedia.org/wiki/Оршолонbxr
5Q1wikipedia_sitelinkhttp://jam.wikipedia.org/wiki/Yunivoersjam
6Q1wikipedia_sitelinkhttp://hr.wikipedia.org/wiki/Svemirhr
7Q1wikipedia_sitelinkhttp://chr.wikipedia.org/wiki/ᎦᎸᎶᎯ_ᎦᎸᎾᏗchr
8Q1wikipedia_sitelinkhttp://pfl.wikipedia.org/wiki/Weltallpfl
9Q1wikipedia_sitelinkhttp://sv.wikipedia.org/wiki/Universumsv
\n", "
" ], "text/plain": [ " node1 label node2 language\n", "0 Q1 wikipedia_sitelink http://oc.wikipedia.org/wiki/Univèrs oc\n", "1 Q1 wikipedia_sitelink http://cdo.wikipedia.org/wiki/Ṳ̄-dêu cdo\n", "2 Q1 wikipedia_sitelink http://ml.wikipedia.org/wiki/പ്രപഞ്ചം ml\n", "3 Q1 wikipedia_sitelink http://si.wikipedia.org/wiki/විශ්වය si\n", "4 Q1 wikipedia_sitelink http://bxr.wikipedia.org/wiki/Оршолон bxr\n", "5 Q1 wikipedia_sitelink http://jam.wikipedia.org/wiki/Yunivoers jam\n", "6 Q1 wikipedia_sitelink http://hr.wikipedia.org/wiki/Svemir hr\n", "7 Q1 wikipedia_sitelink http://chr.wikipedia.org/wiki/ᎦᎸᎶᎯ_ᎦᎸᎾᏗ chr\n", "8 Q1 wikipedia_sitelink http://pfl.wikipedia.org/wiki/Weltall pfl\n", "9 Q1 wikipedia_sitelink http://sv.wikipedia.org/wiki/Universum sv" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.read_csv(os.getenv(\"WIKIPEDIA_TEMP\"),sep = '\\t', nrows = 10)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "!kgtk add-id -i $WIKIPEDIA_TEMP --id-style wikidata -o $WIKIPEDIA" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
node1labelnode2languageid
0Q1wikipedia_sitelinkhttp://oc.wikipedia.org/wiki/UnivèrsocQ1-wikipedia_sitelink-017715
1Q1wikipedia_sitelinkhttp://cdo.wikipedia.org/wiki/Ṳ̄-dêucdoQ1-wikipedia_sitelink-0753b0
2Q1wikipedia_sitelinkhttp://ml.wikipedia.org/wiki/പ്രപഞ്ചംmlQ1-wikipedia_sitelink-0881b4
3Q1wikipedia_sitelinkhttp://si.wikipedia.org/wiki/විශ්වයsiQ1-wikipedia_sitelink-09275b
4Q1wikipedia_sitelinkhttp://bxr.wikipedia.org/wiki/ОршолонbxrQ1-wikipedia_sitelink-0befb2
5Q1wikipedia_sitelinkhttp://jam.wikipedia.org/wiki/YunivoersjamQ1-wikipedia_sitelink-0cf75e
6Q1wikipedia_sitelinkhttp://hr.wikipedia.org/wiki/SvemirhrQ1-wikipedia_sitelink-0d76a2
7Q1wikipedia_sitelinkhttp://chr.wikipedia.org/wiki/ᎦᎸᎶᎯ_ᎦᎸᎾᏗchrQ1-wikipedia_sitelink-0e47e2
8Q1wikipedia_sitelinkhttp://pfl.wikipedia.org/wiki/WeltallpflQ1-wikipedia_sitelink-0e9074
9Q1wikipedia_sitelinkhttp://sv.wikipedia.org/wiki/UniversumsvQ1-wikipedia_sitelink-102a19
\n", "
" ], "text/plain": [ " node1 label node2 language \\\n", "0 Q1 wikipedia_sitelink http://oc.wikipedia.org/wiki/Univèrs oc \n", "1 Q1 wikipedia_sitelink http://cdo.wikipedia.org/wiki/Ṳ̄-dêu cdo \n", "2 Q1 wikipedia_sitelink http://ml.wikipedia.org/wiki/പ്രപഞ്ചം ml \n", "3 Q1 wikipedia_sitelink http://si.wikipedia.org/wiki/විශ්වය si \n", "4 Q1 wikipedia_sitelink http://bxr.wikipedia.org/wiki/Оршолон bxr \n", "5 Q1 wikipedia_sitelink http://jam.wikipedia.org/wiki/Yunivoers jam \n", "6 Q1 wikipedia_sitelink http://hr.wikipedia.org/wiki/Svemir hr \n", "7 Q1 wikipedia_sitelink http://chr.wikipedia.org/wiki/ᎦᎸᎶᎯ_ᎦᎸᎾᏗ chr \n", "8 Q1 wikipedia_sitelink http://pfl.wikipedia.org/wiki/Weltall pfl \n", "9 Q1 wikipedia_sitelink http://sv.wikipedia.org/wiki/Universum sv \n", "\n", " id \n", "0 Q1-wikipedia_sitelink-017715 \n", "1 Q1-wikipedia_sitelink-0753b0 \n", "2 Q1-wikipedia_sitelink-0881b4 \n", "3 Q1-wikipedia_sitelink-09275b \n", "4 Q1-wikipedia_sitelink-0befb2 \n", "5 Q1-wikipedia_sitelink-0cf75e \n", "6 Q1-wikipedia_sitelink-0d76a2 \n", "7 Q1-wikipedia_sitelink-0e47e2 \n", "8 Q1-wikipedia_sitelink-0e9074 \n", "9 Q1-wikipedia_sitelink-102a19 " ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.read_csv(os.getenv(\"WIKIPEDIA\"),sep = '\\t', nrows = 10)" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['node1', 'label', 'node2', 'language', 'id']\n", "Time taken for 0 is 6.9141387939453125e-06\n", "Previous Qnode is: None\n", "Time taken for 100000 is 0.8449301719665527\n", "Previous Qnode is: None\n", "Time taken for 200000 is 2.0532779693603516\n", "Previous Qnode is: None\n", "Time taken for 300000 is 3.250784158706665\n", "Previous Qnode is: None\n", "Time taken for 400000 is 4.442262172698975\n", "Previous Qnode is: None\n", "Time taken for 500000 is 5.612215042114258\n", "Previous Qnode is: None\n", "Time taken for 600000 is 6.799299001693726\n", "Previous Qnode is: None\n", "Time taken for 700000 is 7.991290807723999\n", "Previous Qnode is: None\n", "Time taken for 800000 is 9.355199098587036\n", "Previous Qnode is: None\n", "Time taken for 900000 is 10.611602067947388\n", "Previous Qnode is: None\n", "Time taken for 1000000 is 11.871217966079712\n", "Previous Qnode is: None\n", "Time taken for 1100000 is 13.197750091552734\n", "Previous Qnode is: None\n", "Time taken for 1200000 is 14.401841878890991\n", "Previous Qnode is: None\n", "Time taken for 1300000 is 15.567928791046143\n", "Previous Qnode is: None\n", "Time taken for 1400000 is 16.80803680419922\n", "Previous Qnode is: None\n", "Time taken for 1500000 is 18.03036403656006\n", "Previous Qnode is: None\n", "Time taken for 1600000 is 19.250962018966675\n", "Previous Qnode is: None\n", "Time taken for 1700000 is 20.423606157302856\n", "Previous Qnode is: None\n", "Time taken for 1800000 is 21.577679872512817\n", "Previous Qnode is: None\n", "Time taken for 1900000 is 22.715440034866333\n", "Previous Qnode is: None\n", "Time taken for 2000000 is 23.871012926101685\n", "Previous Qnode is: None\n", "Time taken for 2100000 is 25.030676126480103\n", "Previous Qnode is: None\n", "Time taken for 2200000 is 26.261693000793457\n", "Previous Qnode is: None\n", "Time taken for 2300000 is 27.440370082855225\n", "Previous Qnode is: None\n", "Time taken for 2400000 is 28.625579118728638\n", "Previous Qnode is: None\n", "Time taken for 2500000 is 29.827733039855957\n", "Previous Qnode is: None\n", "Time taken for 2600000 is 31.09984302520752\n", "Previous Qnode is: None\n", "Time taken for 2700000 is 32.31759691238403\n", "Previous Qnode is: None\n", "Time taken for 2800000 is 33.690240144729614\n", "Previous Qnode is: None\n", "Time taken for 2900000 is 35.056572914123535\n", "Previous Qnode is: None\n", "Time taken for 3000000 is 36.3717360496521\n", "Previous Qnode is: None\n", "Time taken for 3100000 is 37.73041892051697\n", "Previous Qnode is: None\n", "Time taken for 3200000 is 39.17571687698364\n", "Previous Qnode is: None\n", "Time taken for 3300000 is 40.48246097564697\n", "Previous Qnode is: None\n", "Time taken for 3400000 is 41.86695408821106\n", "Previous Qnode is: None\n", "Time taken for 3500000 is 43.30181097984314\n", "Previous Qnode is: None\n", "Time taken for 3600000 is 44.612870931625366\n", "Previous Qnode is: None\n", "Time taken for 3700000 is 45.8720908164978\n", "Previous Qnode is: None\n", "Time taken for 3800000 is 47.19520688056946\n", "Previous Qnode is: None\n", "Time taken for 3900000 is 48.468608140945435\n", "Previous Qnode is: None\n", "Time taken for 4000000 is 49.66976809501648\n", "Previous Qnode is: None\n", "Time taken for 4100000 is 50.91034197807312\n", "Previous Qnode is: None\n", "Time taken for 4200000 is 52.10867094993591\n", "Previous Qnode is: None\n", "Time taken for 4300000 is 53.33323407173157\n", "Previous Qnode is: None\n", "Time taken for 4400000 is 54.5686399936676\n", "Previous Qnode is: None\n", "Time taken for 4500000 is 55.815256118774414\n", "Previous Qnode is: None\n", "Time taken for 4600000 is 57.11491513252258\n", "Previous Qnode is: None\n", "Time taken for 4700000 is 58.34508800506592\n", "Previous Qnode is: None\n", "Time taken for 4800000 is 59.59135603904724\n", "Previous Qnode is: None\n", "Time taken for 4900000 is 60.824110984802246\n", "Previous Qnode is: None\n", "Time taken for 5000000 is 62.05766987800598\n", "Previous Qnode is: None\n", "Time taken for 5100000 is 63.29133486747742\n", "Previous Qnode is: None\n", "Time taken for 5200000 is 64.5232241153717\n", "Previous Qnode is: None\n", "Time taken for 5300000 is 65.7951500415802\n", "Previous Qnode is: None\n", "Time taken for 5400000 is 67.01309013366699\n", "Previous Qnode is: None\n", "Time taken for 5500000 is 68.23038697242737\n", "Previous Qnode is: None\n", "Time taken for 5600000 is 69.47685503959656\n", "Previous Qnode is: None\n", "Time taken for 5700000 is 70.69284796714783\n", "Previous Qnode is: None\n", "Time taken for 5800000 is 71.97791910171509\n", "Previous Qnode is: None\n", "Time taken for 5900000 is 73.2146508693695\n", "Previous Qnode is: None\n", "Time taken for 6000000 is 74.44437599182129\n", "Previous Qnode is: None\n", "Time taken for 6100000 is 75.71804189682007\n", "Previous Qnode is: None\n", "Time taken for 6200000 is 76.93279695510864\n", "Previous Qnode is: None\n", "Time taken for 6300000 is 78.14992213249207\n", "Previous Qnode is: None\n", "Time taken for 6400000 is 79.36141800880432\n", "Previous Qnode is: None\n", "Time taken for 6500000 is 80.60917615890503\n", "Previous Qnode is: None\n", "Time taken for 6600000 is 81.80955815315247\n", "Previous Qnode is: None\n", "Time taken for 6700000 is 83.02631878852844\n", "Previous Qnode is: None\n", "Time taken for 6800000 is 84.25405597686768\n", "Previous Qnode is: None\n", "Time taken for 6900000 is 85.53069806098938\n", "Previous Qnode is: None\n", "Time taken for 7000000 is 86.73975777626038\n", "Previous Qnode is: None\n", "Time taken for 7100000 is 87.98265814781189\n", "Previous Qnode is: None\n", "Time taken for 7200000 is 89.19793200492859\n", "Previous Qnode is: None\n", "Time taken for 7300000 is 90.36710715293884\n", "Previous Qnode is: None\n", "Time taken for 7400000 is 91.56689596176147\n", "Previous Qnode is: None\n", "Time taken for 7500000 is 92.7579460144043\n", "Previous Qnode is: None\n", "Time taken for 7600000 is 93.94194483757019\n", "Previous Qnode is: None\n", "Time taken for 7700000 is 95.09788608551025\n", "Previous Qnode is: None\n", "Time taken for 7800000 is 96.29180383682251\n", "Previous Qnode is: None\n", "Time taken for 7900000 is 97.45525622367859\n", "Previous Qnode is: None\n", "Time taken for 8000000 is 98.59378099441528\n", "Previous Qnode is: None\n", "Time taken for 8100000 is 99.7306969165802\n", "Previous Qnode is: None\n", "Time taken for 8200000 is 100.89297485351562\n", "Previous Qnode is: None\n", "Time taken for 8300000 is 102.03740406036377\n", "Previous Qnode is: None\n", "Time taken for 8400000 is 103.19561195373535\n", "Previous Qnode is: None\n", "Time taken for 8500000 is 104.37251210212708\n", "Previous Qnode is: None\n", "Time taken for 8600000 is 105.56339597702026\n", "Previous Qnode is: None\n", "Time taken for 8700000 is 106.71201992034912\n", "Previous Qnode is: None\n", "Time taken for 8800000 is 107.84032392501831\n", "Previous Qnode is: None\n", "Time taken for 8900000 is 109.04249501228333\n", "Previous Qnode is: None\n", "Time taken for 9000000 is 110.2019248008728\n", "Previous Qnode is: None\n", "Time taken for 9100000 is 111.36040306091309\n", "Previous Qnode is: None\n", "Time taken for 9200000 is 112.50705599784851\n", "Previous Qnode is: None\n", "Time taken for 9300000 is 113.69250583648682\n", "Previous Qnode is: None\n", "Time taken for 9400000 is 114.8809769153595\n", "Previous Qnode is: None\n", "Time taken for 9500000 is 116.09176802635193\n", "Previous Qnode is: None\n", "Time taken for 9600000 is 117.40935707092285\n", "Previous Qnode is: None\n", "Time taken for 9700000 is 118.73286700248718\n", "Previous Qnode is: None\n", "Time taken for 9800000 is 119.90120816230774\n", "Previous Qnode is: None\n", "Time taken for 9900000 is 121.06697797775269\n", "Previous Qnode is: None\n", "Time taken for 10000000 is 122.20875406265259\n", "Previous Qnode is: None\n", "Time taken for 10100000 is 123.37070894241333\n", "Previous Qnode is: None\n", "Time taken for 10200000 is 124.55734777450562\n", "Previous Qnode is: None\n", "Time taken for 10300000 is 125.7119791507721\n", "Previous Qnode is: None\n", "Time taken for 10400000 is 126.8513548374176\n", "Previous Qnode is: None\n", "Time taken for 10500000 is 127.97990202903748\n", "Previous Qnode is: None\n", "Time taken for 10600000 is 129.14592003822327\n", "Previous Qnode is: None\n", "Time taken for 10700000 is 130.26514315605164\n", "Previous Qnode is: None\n", "Time taken for 10800000 is 131.35267090797424\n", "Previous Qnode is: None\n", "Time taken for 10900000 is 132.50122094154358\n", "Previous Qnode is: None\n", "Time taken for 11000000 is 133.61431503295898\n", "Previous Qnode is: None\n", "Time taken for 11100000 is 134.7715871334076\n", "Previous Qnode is: None\n", "Time taken for 11200000 is 135.96208214759827\n", "Previous Qnode is: None\n", "Time taken for 11300000 is 137.06673312187195\n", "Previous Qnode is: None\n", "Time taken for 11400000 is 138.1860339641571\n", "Previous Qnode is: None\n", "Time taken for 11500000 is 139.32415294647217\n", "Previous Qnode is: None\n", "Time taken for 11600000 is 140.54970407485962\n", "Previous Qnode is: None\n", "Time taken for 11700000 is 141.75414299964905\n", "Previous Qnode is: None\n", "Time taken for 11800000 is 142.9173710346222\n", "Previous Qnode is: None\n", "Time taken for 11900000 is 144.1065230369568\n", "Previous Qnode is: None\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time taken for 12000000 is 145.2825150489807\n", "Previous Qnode is: None\n", "Time taken for 12100000 is 146.4973168373108\n", "Previous Qnode is: None\n", "Time taken for 12200000 is 147.6632468700409\n", "Previous Qnode is: None\n", "Time taken for 12300000 is 148.973571062088\n", "Previous Qnode is: None\n", "Time taken for 12400000 is 150.33698415756226\n", "Previous Qnode is: None\n", "Time taken for 12500000 is 151.62766218185425\n", "Previous Qnode is: None\n", "Time taken for 12600000 is 152.8912389278412\n", "Previous Qnode is: None\n", "Time taken for 12700000 is 154.28635692596436\n", "Previous Qnode is: None\n", "Time taken for 12800000 is 155.59295105934143\n", "Previous Qnode is: None\n", "Time taken for 12900000 is 156.9116780757904\n", "Previous Qnode is: None\n", "Time taken for 13000000 is 158.2199900150299\n", "Previous Qnode is: None\n", "Time taken for 13100000 is 159.47843313217163\n", "Previous Qnode is: None\n", "Time taken for 13200000 is 160.76241207122803\n", "Previous Qnode is: None\n", "Time taken for 13300000 is 162.02077198028564\n", "Previous Qnode is: None\n", "Time taken for 13400000 is 163.31871008872986\n", "Previous Qnode is: None\n", "Time taken for 13500000 is 164.56196093559265\n", "Previous Qnode is: None\n", "Time taken for 13600000 is 165.82642889022827\n", "Previous Qnode is: None\n", "Time taken for 13700000 is 167.1293158531189\n", "Previous Qnode is: None\n", "Time taken for 13800000 is 168.41969203948975\n", "Previous Qnode is: None\n", "Time taken for 13900000 is 169.82065391540527\n", "Previous Qnode is: None\n", "Time taken for 14000000 is 171.04569292068481\n", "Previous Qnode is: None\n", "Time taken for 14100000 is 172.29077005386353\n", "Previous Qnode is: None\n", "Time taken for 14200000 is 173.64364099502563\n", "Previous Qnode is: None\n", "Time taken for 14300000 is 175.0784158706665\n", "Previous Qnode is: None\n", "Time taken for 14400000 is 176.49693608283997\n", "Previous Qnode is: None\n", "Time taken for 14500000 is 177.87049293518066\n", "Previous Qnode is: None\n", "Time taken for 14600000 is 179.22145104408264\n", "Previous Qnode is: None\n", "Time taken for 14700000 is 180.52534890174866\n", "Previous Qnode is: None\n", "Time taken for 14800000 is 181.8540060520172\n", "Previous Qnode is: None\n", "Time taken for 14900000 is 183.13299417495728\n", "Previous Qnode is: None\n", "Time taken for 15000000 is 184.53750205039978\n", "Previous Qnode is: None\n", "Time taken for 15100000 is 185.85143494606018\n", "Previous Qnode is: None\n", "Time taken for 15200000 is 187.17113304138184\n", "Previous Qnode is: None\n", "Time taken for 15300000 is 188.54747009277344\n", "Previous Qnode is: None\n", "Time taken for 15400000 is 189.89361310005188\n", "Previous Qnode is: None\n", "Time taken for 15500000 is 191.207190990448\n", "Previous Qnode is: None\n", "Time taken for 15600000 is 192.5088541507721\n", "Previous Qnode is: None\n", "Time taken for 15700000 is 193.84539699554443\n", "Previous Qnode is: None\n", "Time taken for 15800000 is 195.1621630191803\n", "Previous Qnode is: None\n", "Time taken for 15900000 is 196.45238304138184\n", "Previous Qnode is: None\n", "Time taken for 16000000 is 197.78786897659302\n", "Previous Qnode is: None\n", "Time taken for 16100000 is 199.08664989471436\n", "Previous Qnode is: None\n", "Time taken for 16200000 is 200.31818914413452\n", "Previous Qnode is: None\n", "Time taken for 16300000 is 201.5343689918518\n", "Previous Qnode is: None\n", "Time taken for 16400000 is 202.70842099189758\n", "Previous Qnode is: None\n", "Time taken for 16500000 is 203.92178106307983\n", "Previous Qnode is: None\n", "Time taken for 16600000 is 205.1510009765625\n", "Previous Qnode is: None\n", "Time taken for 16700000 is 206.4699411392212\n", "Previous Qnode is: None\n", "Time taken for 16800000 is 207.73066091537476\n", "Previous Qnode is: None\n", "Time taken for 16900000 is 209.00328493118286\n", "Previous Qnode is: None\n", "Time taken for 17000000 is 210.2412600517273\n", "Previous Qnode is: None\n", "Time taken for 17100000 is 211.45945715904236\n", "Previous Qnode is: None\n", "Time taken for 17200000 is 212.73061800003052\n", "Previous Qnode is: None\n", "Time taken for 17300000 is 213.95228505134583\n", "Previous Qnode is: None\n", "Time taken for 17400000 is 215.25627183914185\n", "Previous Qnode is: None\n", "Time taken for 17500000 is 216.55751204490662\n", "Previous Qnode is: None\n", "Time taken for 17600000 is 217.79251194000244\n", "Previous Qnode is: None\n", "Time taken for 17700000 is 219.11971306800842\n", "Previous Qnode is: None\n", "Time taken for 17800000 is 220.38633608818054\n", "Previous Qnode is: None\n", "Time taken for 17900000 is 221.69863200187683\n", "Previous Qnode is: None\n", "Time taken for 18000000 is 222.93875694274902\n", "Previous Qnode is: None\n", "Time taken for 18100000 is 224.22329998016357\n", "Previous Qnode is: None\n", "Time taken for 18200000 is 225.4581799507141\n", "Previous Qnode is: None\n", "Time taken for 18300000 is 226.74135494232178\n", "Previous Qnode is: None\n", "Time taken for 18400000 is 228.07522797584534\n", "Previous Qnode is: None\n", "Time taken for 18500000 is 229.3479199409485\n", "Previous Qnode is: None\n", "Time taken for 18600000 is 230.67752504348755\n", "Previous Qnode is: None\n", "Time taken for 18700000 is 231.9105019569397\n", "Previous Qnode is: None\n", "Time taken for 18800000 is 233.14738011360168\n", "Previous Qnode is: None\n", "Time taken for 18900000 is 234.46908903121948\n", "Previous Qnode is: None\n", "Time taken for 19000000 is 235.74061703681946\n", "Previous Qnode is: None\n", "Time taken for 19100000 is 237.0707128047943\n", "Previous Qnode is: None\n", "Time taken for 19200000 is 238.3406229019165\n", "Previous Qnode is: None\n", "Time taken for 19300000 is 239.68353009223938\n", "Previous Qnode is: None\n", "Time taken for 19400000 is 241.11689805984497\n", "Previous Qnode is: None\n", "Time taken for 19500000 is 242.42638397216797\n", "Previous Qnode is: None\n", "Time taken for 19600000 is 243.73535299301147\n", "Previous Qnode is: None\n", "Time taken for 19700000 is 245.10842490196228\n", "Previous Qnode is: None\n", "Time taken for 19800000 is 246.5431728363037\n", "Previous Qnode is: None\n", "Time taken for 19900000 is 247.81972098350525\n", "Previous Qnode is: None\n", "Time taken for 20000000 is 249.05254101753235\n", "Previous Qnode is: None\n", "Time taken for 20100000 is 250.50704312324524\n", "Previous Qnode is: None\n", "Time taken for 20200000 is 251.85854601860046\n", "Previous Qnode is: None\n", "Time taken for 20300000 is 253.19279217720032\n", "Previous Qnode is: None\n", "Time taken for 20400000 is 254.5985929965973\n", "Previous Qnode is: None\n", "Time taken for 20500000 is 255.93184304237366\n", "Previous Qnode is: None\n", "Time taken for 20600000 is 257.25582909584045\n", "Previous Qnode is: None\n", "Time taken for 20700000 is 258.6230227947235\n", "Previous Qnode is: None\n", "Time taken for 20800000 is 259.97756600379944\n", "Previous Qnode is: None\n", "Time taken for 20900000 is 261.2918150424957\n", "Previous Qnode is: None\n", "Time taken for 21000000 is 262.5921630859375\n", "Previous Qnode is: None\n", "Time taken for 21100000 is 263.8099000453949\n", "Previous Qnode is: None\n", "Time taken for 21200000 is 265.0324640274048\n", "Previous Qnode is: None\n", "Time taken for 21300000 is 266.3517310619354\n", "Previous Qnode is: None\n", "Time taken for 21400000 is 267.73724913597107\n", "Previous Qnode is: None\n", "Time taken for 21500000 is 269.1157429218292\n", "Previous Qnode is: None\n", "Time taken for 21600000 is 270.479887008667\n", "Previous Qnode is: None\n", "Time taken for 21700000 is 271.81969594955444\n", "Previous Qnode is: None\n", "Time taken for 21800000 is 273.0958368778229\n", "Previous Qnode is: None\n", "Time taken for 21900000 is 274.4298288822174\n", "Previous Qnode is: None\n", "Time taken for 22000000 is 275.7025969028473\n", "Previous Qnode is: None\n", "Time taken for 22100000 is 276.98392605781555\n", "Previous Qnode is: None\n", "Time taken for 22200000 is 278.29367208480835\n", "Previous Qnode is: None\n", "Time taken for 22300000 is 279.6874041557312\n", "Previous Qnode is: None\n", "Time taken for 22400000 is 281.05358386039734\n", "Previous Qnode is: None\n", "Time taken for 22500000 is 282.3495271205902\n", "Previous Qnode is: None\n", "Time taken for 22600000 is 283.5959508419037\n", "Previous Qnode is: None\n", "Time taken for 22700000 is 284.77122592926025\n", "Previous Qnode is: None\n", "Time taken for 22800000 is 285.977215051651\n", "Previous Qnode is: None\n", "Time taken for 22900000 is 287.15468192100525\n", "Previous Qnode is: None\n", "Time taken for 23000000 is 288.34534192085266\n", "Previous Qnode is: None\n", "Time taken for 23100000 is 289.55294013023376\n", "Previous Qnode is: None\n", "Time taken for 23200000 is 290.75966000556946\n", "Previous Qnode is: None\n", "Time taken for 23300000 is 292.02038311958313\n", "Previous Qnode is: None\n", "Time taken for 23400000 is 293.23673605918884\n", "Previous Qnode is: None\n", "Time taken for 23500000 is 294.42460012435913\n", "Previous Qnode is: None\n", "Time taken for 23600000 is 295.593230009079\n", "Previous Qnode is: None\n", "Time taken for 23700000 is 296.77920389175415\n", "Previous Qnode is: None\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time taken for 23800000 is 297.93142104148865\n", "Previous Qnode is: None\n", "Time taken for 23900000 is 299.1232249736786\n", "Previous Qnode is: None\n", "Time taken for 24000000 is 300.3963232040405\n", "Previous Qnode is: None\n", "Time taken for 24100000 is 301.71597504615784\n", "Previous Qnode is: None\n", "Time taken for 24200000 is 303.1009109020233\n", "Previous Qnode is: None\n", "Time taken for 24300000 is 304.34784483909607\n", "Previous Qnode is: None\n", "Time taken for 24400000 is 305.61386799812317\n", "Previous Qnode is: None\n", "Time taken for 24500000 is 306.89065980911255\n", "Previous Qnode is: None\n", "Time taken for 24600000 is 308.14564418792725\n", "Previous Qnode is: None\n", "Time taken for 24700000 is 309.4140338897705\n", "Previous Qnode is: None\n", "Time taken for 24800000 is 310.6506690979004\n", "Previous Qnode is: None\n", "Time taken for 24900000 is 311.87549805641174\n", "Previous Qnode is: None\n", "Time taken for 25000000 is 313.20977306365967\n", "Previous Qnode is: None\n", "Time taken for 25100000 is 314.6065537929535\n", "Previous Qnode is: None\n", "Time taken for 25200000 is 315.858943939209\n", "Previous Qnode is: None\n", "Time taken for 25300000 is 317.1403248310089\n", "Previous Qnode is: None\n", "Time taken for 25400000 is 318.5146520137787\n", "Previous Qnode is: None\n", "Time taken for 25500000 is 319.8977208137512\n", "Previous Qnode is: None\n", "Time taken for 25600000 is 321.18831396102905\n", "Previous Qnode is: None\n", "Time taken for 25700000 is 322.5186598300934\n", "Previous Qnode is: None\n", "Time taken for 25800000 is 323.78757786750793\n", "Previous Qnode is: None\n", "Time taken for 25900000 is 325.06252098083496\n", "Previous Qnode is: None\n", "Time taken for 26000000 is 326.43147802352905\n", "Previous Qnode is: None\n", "Time taken for 26100000 is 327.8012549877167\n", "Previous Qnode is: None\n", "Time taken for 26200000 is 329.1313810348511\n", "Previous Qnode is: None\n", "Time taken for 26300000 is 330.43148016929626\n", "Previous Qnode is: None\n", "Time taken for 26400000 is 331.74097895622253\n", "Previous Qnode is: None\n", "Time taken for 26500000 is 333.05068016052246\n", "Previous Qnode is: None\n", "Time taken for 26600000 is 334.2913990020752\n", "Previous Qnode is: None\n", "Time taken for 26700000 is 335.56056094169617\n", "Previous Qnode is: None\n", "Time taken for 26800000 is 336.79532384872437\n", "Previous Qnode is: None\n", "Time taken for 26900000 is 337.99517703056335\n", "Previous Qnode is: None\n", "Time taken for 27000000 is 339.1980879306793\n", "Previous Qnode is: None\n", "Time taken for 27100000 is 340.4566648006439\n", "Previous Qnode is: None\n", "Time taken for 27200000 is 341.66405415534973\n", "Previous Qnode is: None\n", "Time taken for 27300000 is 342.85802817344666\n", "Previous Qnode is: None\n", "Time taken for 27400000 is 344.0759711265564\n", "Previous Qnode is: None\n", "Time taken for 27500000 is 345.2520959377289\n", "Previous Qnode is: None\n", "Time taken for 27600000 is 346.4584770202637\n", "Previous Qnode is: None\n", "Time taken for 27700000 is 347.663302898407\n", "Previous Qnode is: None\n", "Time taken for 27800000 is 348.83902192115784\n", "Previous Qnode is: None\n", "Time taken for 27900000 is 350.0608961582184\n", "Previous Qnode is: None\n", "Time taken for 28000000 is 351.2926070690155\n", "Previous Qnode is: None\n", "Time taken for 28100000 is 352.7563500404358\n", "Previous Qnode is: None\n", "Time taken for 28200000 is 354.06871795654297\n", "Previous Qnode is: None\n", "Time taken for 28300000 is 355.2452600002289\n", "Previous Qnode is: None\n", "Time taken for 28400000 is 356.4183418750763\n", "Previous Qnode is: None\n", "Time taken for 28500000 is 357.6076512336731\n", "Previous Qnode is: None\n", "Time taken for 28600000 is 358.80252599716187\n", "Previous Qnode is: None\n", "Time taken for 28700000 is 359.97126603126526\n", "Previous Qnode is: None\n", "Time taken for 28800000 is 361.1818799972534\n", "Previous Qnode is: None\n", "Time taken for 28900000 is 362.33256816864014\n", "Previous Qnode is: None\n", "Time taken for 29000000 is 363.51729702949524\n", "Previous Qnode is: None\n", "Time taken for 29100000 is 364.70723700523376\n", "Previous Qnode is: None\n", "Time taken for 29200000 is 365.90086793899536\n", "Previous Qnode is: None\n", "Time taken for 29300000 is 367.0968861579895\n", "Previous Qnode is: None\n", "Time taken for 29400000 is 368.3391089439392\n", "Previous Qnode is: None\n", "Time taken for 29500000 is 369.7258620262146\n", "Previous Qnode is: None\n", "Time taken for 29600000 is 371.0872309207916\n", "Previous Qnode is: None\n", "Time taken for 29700000 is 372.4185528755188\n", "Previous Qnode is: None\n", "Time taken for 29800000 is 373.7984211444855\n", "Previous Qnode is: None\n", "Time taken for 29900000 is 375.0934510231018\n", "Previous Qnode is: None\n", "Time taken for 30000000 is 376.3671839237213\n", "Previous Qnode is: None\n", "Time taken for 30100000 is 377.65432500839233\n", "Previous Qnode is: None\n", "Time taken for 30200000 is 379.0601360797882\n", "Previous Qnode is: None\n", "Time taken for 30300000 is 380.39911103248596\n", "Previous Qnode is: None\n", "Time taken for 30400000 is 381.6853280067444\n", "Previous Qnode is: None\n", "Time taken for 30500000 is 382.9574110507965\n", "Previous Qnode is: None\n", "Time taken for 30600000 is 384.15703892707825\n", "Previous Qnode is: None\n", "Time taken for 30700000 is 385.4073841571808\n", "Previous Qnode is: None\n", "Time taken for 30800000 is 386.6018669605255\n", "Previous Qnode is: None\n", "Time taken for 30900000 is 387.85237407684326\n", "Previous Qnode is: None\n", "Time taken for 31000000 is 389.14794087409973\n", "Previous Qnode is: None\n", "Time taken for 31100000 is 390.3302311897278\n", "Previous Qnode is: None\n", "Time taken for 31200000 is 391.522225856781\n", "Previous Qnode is: None\n", "Time taken for 31300000 is 392.8440771102905\n", "Previous Qnode is: None\n", "Time taken for 31400000 is 394.12735390663147\n", "Previous Qnode is: None\n", "Time taken for 31500000 is 395.4867949485779\n", "Previous Qnode is: None\n", "Time taken for 31600000 is 396.7685830593109\n", "Previous Qnode is: None\n", "Time taken for 31700000 is 398.1593527793884\n", "Previous Qnode is: None\n", "Time taken for 31800000 is 399.4349660873413\n", "Previous Qnode is: None\n", "Time taken for 31900000 is 400.66747403144836\n", "Previous Qnode is: None\n", "Time taken for 32000000 is 401.8468339443207\n", "Previous Qnode is: None\n", "Time taken for 32100000 is 403.0738618373871\n", "Previous Qnode is: None\n", "Time taken for 32200000 is 404.51627492904663\n", "Previous Qnode is: None\n", "Time taken for 32300000 is 405.90253806114197\n", "Previous Qnode is: None\n", "Time taken for 32400000 is 407.19607877731323\n", "Previous Qnode is: None\n", "Time taken for 32500000 is 408.5822329521179\n", "Previous Qnode is: None\n", "Time taken for 32600000 is 409.92009806632996\n", "Previous Qnode is: None\n", "Time taken for 32700000 is 411.1734368801117\n", "Previous Qnode is: None\n", "Time taken for 32800000 is 412.4126009941101\n", "Previous Qnode is: None\n", "Time taken for 32900000 is 413.63184905052185\n", "Previous Qnode is: None\n", "Time taken for 33000000 is 414.8418161869049\n", "Previous Qnode is: None\n", "Time taken for 33100000 is 416.05449295043945\n", "Previous Qnode is: None\n", "Time taken for 33200000 is 417.3736500740051\n", "Previous Qnode is: None\n", "Time taken for 33300000 is 418.6443259716034\n", "Previous Qnode is: None\n", "Time taken for 33400000 is 419.88358783721924\n", "Previous Qnode is: None\n", "Time taken for 33500000 is 421.0956721305847\n", "Previous Qnode is: None\n", "Time taken for 33600000 is 422.3035740852356\n", "Previous Qnode is: None\n", "Time taken for 33700000 is 423.5177059173584\n", "Previous Qnode is: None\n", "Time taken for 33800000 is 424.73733615875244\n", "Previous Qnode is: None\n", "Time taken for 33900000 is 426.0220401287079\n", "Previous Qnode is: None\n", "Time taken for 34000000 is 427.2822721004486\n", "Previous Qnode is: None\n", "Time taken for 34100000 is 428.5203950405121\n", "Previous Qnode is: None\n", "Time taken for 34200000 is 429.8674650192261\n", "Previous Qnode is: None\n", "Time taken for 34300000 is 431.19978189468384\n", "Previous Qnode is: None\n", "Time taken for 34400000 is 432.4542610645294\n", "Previous Qnode is: None\n", "Time taken for 34500000 is 433.65591502189636\n", "Previous Qnode is: None\n", "Time taken for 34600000 is 434.87951397895813\n", "Previous Qnode is: None\n", "Time taken for 34700000 is 436.2472069263458\n", "Previous Qnode is: None\n", "Time taken for 34800000 is 437.5755798816681\n", "Previous Qnode is: None\n", "Time taken for 34900000 is 438.8561038970947\n", "Previous Qnode is: None\n", "Time taken for 35000000 is 440.184583902359\n", "Previous Qnode is: None\n", "Time taken for 35100000 is 441.46556401252747\n", "Previous Qnode is: None\n", "Time taken for 35200000 is 442.79458498954773\n", "Previous Qnode is: None\n", "Time taken for 35300000 is 444.1033978462219\n", "Previous Qnode is: None\n", "Time taken for 35400000 is 445.35846304893494\n", "Previous Qnode is: None\n", "Time taken for 35500000 is 446.7298262119293\n", "Previous Qnode is: None\n", "Time taken for 35600000 is 447.90270709991455\n", "Previous Qnode is: None\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time taken for 35700000 is 449.22428011894226\n", "Previous Qnode is: None\n", "Time taken for 35800000 is 450.59958600997925\n", "Previous Qnode is: None\n", "Time taken for 35900000 is 451.98899006843567\n", "Previous Qnode is: None\n", "Time taken for 36000000 is 453.32234716415405\n", "Previous Qnode is: None\n", "Time taken for 36100000 is 454.627592086792\n", "Previous Qnode is: None\n", "Time taken for 36200000 is 455.89421916007996\n", "Previous Qnode is: None\n", "Time taken for 36300000 is 457.2095561027527\n", "Previous Qnode is: None\n", "Time taken for 36400000 is 458.460568189621\n", "Previous Qnode is: None\n", "Time taken for 36500000 is 459.7277190685272\n", "Previous Qnode is: None\n", "Time taken for 36600000 is 460.9438829421997\n", "Previous Qnode is: None\n", "Time taken for 36700000 is 462.1432650089264\n", "Previous Qnode is: None\n", "Time taken for 36800000 is 463.35320496559143\n", "Previous Qnode is: None\n", "Time taken for 36900000 is 464.5342421531677\n", "Previous Qnode is: None\n", "Time taken for 37000000 is 465.72650814056396\n", "Previous Qnode is: None\n", "Time taken for 37100000 is 466.92165303230286\n", "Previous Qnode is: None\n", "Time taken for 37200000 is 468.1127061843872\n", "Previous Qnode is: None\n", "Time taken for 37300000 is 469.27298307418823\n", "Previous Qnode is: None\n", "Time taken for 37400000 is 470.462513923645\n", "Previous Qnode is: None\n", "Time taken for 37500000 is 471.6735270023346\n", "Previous Qnode is: None\n", "Time taken for 37600000 is 472.8674659729004\n", "Previous Qnode is: None\n", "Time taken for 37700000 is 474.1323239803314\n", "Previous Qnode is: None\n", "Time taken for 37800000 is 475.3310558795929\n", "Previous Qnode is: None\n", "Time taken for 37900000 is 476.5381419658661\n", "Previous Qnode is: None\n", "Time taken for 38000000 is 477.72667503356934\n", "Previous Qnode is: None\n", "Time taken for 38100000 is 478.94064497947693\n", "Previous Qnode is: None\n", "Time taken for 38200000 is 480.152263879776\n", "Previous Qnode is: None\n", "Time taken for 38300000 is 481.38595509529114\n", "Previous Qnode is: None\n", "Time taken for 38400000 is 482.58663511276245\n", "Previous Qnode is: None\n", "Time taken for 38500000 is 483.7588748931885\n", "Previous Qnode is: None\n", "Time taken for 38600000 is 484.9316999912262\n", "Previous Qnode is: None\n", "Time taken for 38700000 is 486.08009600639343\n", "Previous Qnode is: None\n", "Time taken for 38800000 is 487.2905550003052\n", "Previous Qnode is: None\n", "Time taken for 38900000 is 488.4607629776001\n", "Previous Qnode is: None\n", "Time taken for 39000000 is 489.65340089797974\n", "Previous Qnode is: None\n", "Time taken for 39100000 is 490.8354539871216\n", "Previous Qnode is: None\n", "Time taken for 39200000 is 492.0489869117737\n", "Previous Qnode is: None\n", "Time taken for 39300000 is 493.27918004989624\n", "Previous Qnode is: None\n", "Time taken for 39400000 is 494.4898509979248\n", "Previous Qnode is: None\n", "Time taken for 39500000 is 495.70270895957947\n", "Previous Qnode is: None\n", "Time taken for 39600000 is 496.90747594833374\n", "Previous Qnode is: None\n", "Time taken for 39700000 is 498.12366795539856\n", "Previous Qnode is: None\n", "Time taken for 39800000 is 499.30861020088196\n", "Previous Qnode is: None\n", "Time taken for 39900000 is 500.5088059902191\n", "Previous Qnode is: None\n", "Time taken for 40000000 is 501.7057580947876\n", "Previous Qnode is: None\n", "Time taken for 40100000 is 502.8764100074768\n", "Previous Qnode is: None\n", "Time taken for 40200000 is 504.0746371746063\n", "Previous Qnode is: None\n", "Time taken for 40300000 is 505.2467110157013\n", "Previous Qnode is: None\n", "Time taken for 40400000 is 506.46442699432373\n", "Previous Qnode is: None\n", "Time taken for 40500000 is 507.67375898361206\n", "Previous Qnode is: None\n", "Time taken for 40600000 is 508.8692638874054\n", "Previous Qnode is: None\n", "Time taken for 40700000 is 510.0697829723358\n", "Previous Qnode is: None\n", "Time taken for 40800000 is 511.30459094047546\n", "Previous Qnode is: None\n", "Time taken for 40900000 is 512.5142140388489\n", "Previous Qnode is: None\n", "Time taken for 41000000 is 513.7770681381226\n", "Previous Qnode is: None\n", "Time taken for 41100000 is 515.0551328659058\n", "Previous Qnode is: None\n", "Time taken for 41200000 is 516.2898709774017\n", "Previous Qnode is: None\n", "Time taken for 41300000 is 517.5123839378357\n", "Previous Qnode is: None\n", "Time taken for 41400000 is 518.7492868900299\n", "Previous Qnode is: None\n", "Time taken for 41500000 is 519.979010105133\n", "Previous Qnode is: None\n", "Time taken for 41600000 is 521.2094030380249\n", "Previous Qnode is: None\n", "Time taken for 41700000 is 522.4478988647461\n", "Previous Qnode is: None\n", "Time taken for 41800000 is 523.7407050132751\n", "Previous Qnode is: None\n", "Time taken for 41900000 is 524.9694311618805\n", "Previous Qnode is: None\n", "Time taken for 42000000 is 526.217826128006\n", "Previous Qnode is: None\n", "Time taken for 42100000 is 527.4904189109802\n", "Previous Qnode is: None\n", "Time taken for 42200000 is 528.8001201152802\n", "Previous Qnode is: None\n", "Time taken for 42300000 is 530.0998358726501\n", "Previous Qnode is: None\n", "Time taken for 42400000 is 531.3375718593597\n", "Previous Qnode is: None\n", "Time taken for 42500000 is 532.6083619594574\n", "Previous Qnode is: None\n", "Time taken for 42600000 is 533.844810962677\n", "Previous Qnode is: None\n", "Time taken for 42700000 is 535.0685818195343\n", "Previous Qnode is: None\n", "Time taken for 42800000 is 536.2863039970398\n", "Previous Qnode is: None\n", "Time taken for 42900000 is 537.5551509857178\n", "Previous Qnode is: None\n", "Time taken for 43000000 is 538.7741990089417\n", "Previous Qnode is: None\n", "Time taken for 43100000 is 540.0810508728027\n", "Previous Qnode is: None\n", "Time taken for 43200000 is 541.372661113739\n", "Previous Qnode is: None\n", "Time taken for 43300000 is 542.687488079071\n", "Previous Qnode is: None\n", "Time taken for 43400000 is 543.9160778522491\n", "Previous Qnode is: None\n", "Time taken for 43500000 is 545.1440708637238\n", "Previous Qnode is: None\n", "Time taken for 43600000 is 546.3499348163605\n", "Previous Qnode is: None\n", "Time taken for 43700000 is 547.6014358997345\n", "Previous Qnode is: None\n", "Time taken for 43800000 is 548.7857301235199\n", "Previous Qnode is: None\n", "Time taken for 43900000 is 549.9871230125427\n", "Previous Qnode is: None\n", "Time taken for 44000000 is 551.1727609634399\n", "Previous Qnode is: None\n", "Time taken for 44100000 is 552.3387551307678\n", "Previous Qnode is: None\n", "Time taken for 44200000 is 553.56609582901\n", "Previous Qnode is: None\n", "Time taken for 44300000 is 554.7907199859619\n", "Previous Qnode is: None\n", "Time taken for 44400000 is 556.0340049266815\n", "Previous Qnode is: None\n", "Time taken for 44500000 is 557.243353843689\n", "Previous Qnode is: None\n", "Time taken for 44600000 is 558.4606008529663\n", "Previous Qnode is: None\n", "Time taken for 44700000 is 559.6714079380035\n", "Previous Qnode is: None\n", "Time taken for 44800000 is 560.927875995636\n", "Previous Qnode is: None\n", "Time taken for 44900000 is 562.17214012146\n", "Previous Qnode is: None\n", "Time taken for 45000000 is 563.3912420272827\n", "Previous Qnode is: None\n", "Time taken for 45100000 is 564.631175994873\n", "Previous Qnode is: None\n", "Time taken for 45200000 is 565.8246560096741\n", "Previous Qnode is: None\n", "Time taken for 45300000 is 566.9736919403076\n", "Previous Qnode is: None\n", "Time taken for 45400000 is 568.1446809768677\n", "Previous Qnode is: None\n", "Time taken for 45500000 is 569.3103098869324\n", "Previous Qnode is: None\n", "Time taken for 45600000 is 570.4705080986023\n", "Previous Qnode is: None\n", "Time taken for 45700000 is 571.712760925293\n", "Previous Qnode is: None\n", "Time taken for 45800000 is 572.9388349056244\n", "Previous Qnode is: None\n", "Time taken for 45900000 is 574.1000928878784\n", "Previous Qnode is: None\n", "Time taken for 46000000 is 575.2747859954834\n", "Previous Qnode is: None\n", "Time taken for 46100000 is 576.4159319400787\n", "Previous Qnode is: None\n", "Time taken for 46200000 is 577.5902810096741\n", "Previous Qnode is: None\n", "Time taken for 46300000 is 578.7921190261841\n", "Previous Qnode is: None\n", "Time taken for 46400000 is 579.9785830974579\n", "Previous Qnode is: None\n", "Time taken for 46500000 is 581.1958930492401\n", "Previous Qnode is: None\n", "Time taken for 46600000 is 582.6043939590454\n", "Previous Qnode is: None\n", "Time taken for 46700000 is 583.8723430633545\n", "Previous Qnode is: None\n", "Time taken for 46800000 is 585.0751090049744\n", "Previous Qnode is: None\n", "Time taken for 46900000 is 586.2597079277039\n", "Previous Qnode is: None\n", "Time taken for 47000000 is 587.446713924408\n", "Previous Qnode is: None\n", "Time taken for 47100000 is 588.6441779136658\n", "Previous Qnode is: None\n", "Time taken for 47200000 is 589.9137790203094\n", "Previous Qnode is: None\n", "Time taken for 47300000 is 591.0956869125366\n", "Previous Qnode is: None\n", "Time taken for 47400000 is 592.3163871765137\n", "Previous Qnode is: None\n", "Time taken for 47500000 is 593.5164408683777\n", "Previous Qnode is: None\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time taken for 47600000 is 594.7213799953461\n", "Previous Qnode is: None\n", "Time taken for 47700000 is 595.9149131774902\n", "Previous Qnode is: None\n", "Time taken for 47800000 is 597.1261200904846\n", "Previous Qnode is: None\n", "Time taken for 47900000 is 598.3319089412689\n", "Previous Qnode is: None\n", "Time taken for 48000000 is 599.526437997818\n", "Previous Qnode is: None\n", "Time taken for 48100000 is 600.760908126831\n", "Previous Qnode is: None\n", "Time taken for 48200000 is 601.9848830699921\n", "Previous Qnode is: None\n", "Time taken for 48300000 is 603.2123260498047\n", "Previous Qnode is: None\n", "Time taken for 48400000 is 604.4257249832153\n", "Previous Qnode is: None\n", "Time taken for 48500000 is 605.6557750701904\n", "Previous Qnode is: None\n", "Time taken for 48600000 is 606.8692400455475\n", "Previous Qnode is: None\n", "Time taken for 48700000 is 608.0654320716858\n", "Previous Qnode is: None\n", "Time taken for 48800000 is 609.2737710475922\n", "Previous Qnode is: None\n", "Time taken for 48900000 is 610.5252859592438\n", "Previous Qnode is: None\n", "Time taken for 49000000 is 611.7521719932556\n", "Previous Qnode is: None\n", "Time taken for 49100000 is 613.0110621452332\n", "Previous Qnode is: None\n", "Time taken for 49200000 is 614.2010591030121\n", "Previous Qnode is: None\n", "Time taken for 49300000 is 615.4503231048584\n", "Previous Qnode is: None\n", "Time taken for 49400000 is 616.7100040912628\n", "Previous Qnode is: None\n", "Time taken for 49500000 is 617.9250020980835\n", "Previous Qnode is: None\n", "Time taken for 49600000 is 619.17844414711\n", "Previous Qnode is: None\n", "Time taken for 49700000 is 620.432009935379\n", "Previous Qnode is: None\n", "Time taken for 49800000 is 621.6652789115906\n", "Previous Qnode is: None\n", "Time taken for 49900000 is 622.9031550884247\n", "Previous Qnode is: None\n", "Time taken for 50000000 is 624.1294741630554\n", "Previous Qnode is: None\n", "Time taken for 50100000 is 625.3600420951843\n", "Previous Qnode is: None\n", "Time taken for 50200000 is 626.5818569660187\n", "Previous Qnode is: None\n", "Time taken for 50300000 is 627.8260381221771\n", "Previous Qnode is: None\n", "Time taken for 50400000 is 629.0438008308411\n", "Previous Qnode is: None\n", "Time taken for 50500000 is 630.2707190513611\n", "Previous Qnode is: None\n", "Time taken for 50600000 is 631.4979898929596\n", "Previous Qnode is: None\n", "Time taken for 50700000 is 632.7547199726105\n", "Previous Qnode is: None\n", "Time taken for 50800000 is 633.9760630130768\n", "Previous Qnode is: None\n", "Time taken for 50900000 is 635.1947150230408\n", "Previous Qnode is: None\n", "Time taken for 51000000 is 636.4162051677704\n", "Previous Qnode is: None\n", "Time taken for 51100000 is 637.6280698776245\n", "Previous Qnode is: None\n", "Time taken for 51200000 is 638.8313009738922\n", "Previous Qnode is: None\n", "Time taken for 51300000 is 640.0347621440887\n", "Previous Qnode is: None\n", "Time taken for 51400000 is 641.2192289829254\n", "Previous Qnode is: None\n", "Time taken for 51500000 is 642.4674530029297\n", "Previous Qnode is: None\n", "Time taken for 51600000 is 643.661828994751\n", "Previous Qnode is: None\n", "Time taken for 51700000 is 644.8577840328217\n", "Previous Qnode is: None\n", "Time taken for 51800000 is 646.0690879821777\n", "Previous Qnode is: None\n", "Time taken for 51900000 is 647.2716858386993\n", "Previous Qnode is: None\n", "Time taken for 52000000 is 648.5074648857117\n", "Previous Qnode is: None\n", "Time taken for 52100000 is 649.7215728759766\n", "Previous Qnode is: None\n", "Time taken for 52200000 is 650.9203798770905\n", "Previous Qnode is: None\n", "Time taken for 52300000 is 652.1450698375702\n", "Previous Qnode is: None\n", "Time taken for 52400000 is 653.3371419906616\n", "Previous Qnode is: None\n", "Time taken for 52500000 is 654.5128710269928\n", "Previous Qnode is: None\n", "Time taken for 52600000 is 655.7067511081696\n", "Previous Qnode is: None\n", "Time taken for 52700000 is 656.8955540657043\n", "Previous Qnode is: None\n", "Time taken for 52800000 is 658.0786781311035\n", "Previous Qnode is: None\n", "Time taken for 52900000 is 659.3113129138947\n", "Previous Qnode is: None\n", "Time taken for 53000000 is 660.5079030990601\n", "Previous Qnode is: None\n", "Time taken for 53100000 is 661.7105770111084\n", "Previous Qnode is: None\n", "Time taken for 53200000 is 662.9279608726501\n", "Previous Qnode is: None\n", "Time taken for 53300000 is 664.1127200126648\n", "Previous Qnode is: None\n", "Time taken for 53400000 is 665.3731000423431\n", "Previous Qnode is: None\n", "Time taken for 53500000 is 666.6151909828186\n", "Previous Qnode is: None\n", "Time taken for 53600000 is 667.8783218860626\n", "Previous Qnode is: None\n", "Time taken for 53700000 is 669.1211080551147\n", "Previous Qnode is: None\n", "Time taken for 53800000 is 670.4422500133514\n", "Previous Qnode is: None\n", "Time taken for 53900000 is 671.8398678302765\n", "Previous Qnode is: None\n", "Time taken for 54000000 is 673.1924040317535\n", "Previous Qnode is: None\n", "Time taken for 54100000 is 674.4307019710541\n", "Previous Qnode is: None\n", "Time taken for 54200000 is 675.6578929424286\n", "Previous Qnode is: None\n", "Time taken for 54300000 is 676.8681559562683\n", "Previous Qnode is: None\n", "Time taken for 54400000 is 678.0821869373322\n", "Previous Qnode is: None\n", "Time taken for 54500000 is 679.2803380489349\n", "Previous Qnode is: None\n", "Time taken for 54600000 is 680.51069688797\n", "Previous Qnode is: None\n", "Time taken for 54700000 is 681.6432020664215\n", "Previous Qnode is: None\n", "Time taken for 54800000 is 682.7619121074677\n", "Previous Qnode is: None\n", "Time taken for 54900000 is 683.9487330913544\n", "Previous Qnode is: None\n", "Time taken for 55000000 is 685.1403839588165\n", "Previous Qnode is: None\n", "Time taken for 55100000 is 686.3086190223694\n", "Previous Qnode is: None\n", "Time taken for 55200000 is 687.4120299816132\n", "Previous Qnode is: None\n", "Time taken for 55300000 is 688.6026570796967\n", "Previous Qnode is: None\n", "Time taken for 55400000 is 689.7998359203339\n", "Previous Qnode is: None\n", "Time taken for 55500000 is 691.0727980136871\n", "Previous Qnode is: None\n", "Time taken for 55600000 is 692.3126170635223\n", "Previous Qnode is: None\n", "Time taken for 55700000 is 693.5439910888672\n", "Previous Qnode is: None\n", "Time taken for 55800000 is 694.7525310516357\n", "Previous Qnode is: None\n", "Time taken for 55900000 is 695.9483439922333\n", "Previous Qnode is: None\n", "Time taken for 56000000 is 697.1404359340668\n", "Previous Qnode is: None\n", "Time taken for 56100000 is 698.3450770378113\n", "Previous Qnode is: None\n", "Time taken for 56200000 is 699.5368390083313\n", "Previous Qnode is: None\n", "Time taken for 56300000 is 700.7434749603271\n", "Previous Qnode is: None\n", "Time taken for 56400000 is 701.9318709373474\n", "Previous Qnode is: None\n", "Time taken for 56500000 is 703.10657787323\n", "Previous Qnode is: None\n", "Time taken for 56600000 is 704.2918531894684\n", "Previous Qnode is: None\n", "Time taken for 56700000 is 705.4744689464569\n", "Previous Qnode is: None\n", "Time taken for 56800000 is 706.7711172103882\n", "Previous Qnode is: None\n", "Time taken for 56900000 is 708.0259158611298\n", "Previous Qnode is: None\n", "Time taken for 57000000 is 709.3079130649567\n", "Previous Qnode is: None\n", "Time taken for 57100000 is 710.5661561489105\n", "Previous Qnode is: None\n", "Time taken for 57200000 is 711.8266499042511\n", "Previous Qnode is: None\n", "Time taken for 57300000 is 713.0204710960388\n", "Previous Qnode is: None\n", "Time taken for 57400000 is 714.1743910312653\n", "Previous Qnode is: None\n", "Time taken for 57500000 is 715.3203139305115\n", "Previous Qnode is: None\n", "Time taken for 57600000 is 716.4938499927521\n", "Previous Qnode is: None\n", "Time taken for 57700000 is 717.6904788017273\n", "Previous Qnode is: None\n", "Time taken for 57800000 is 718.8560011386871\n", "Previous Qnode is: None\n", "Time taken for 57900000 is 720.0363190174103\n", "Previous Qnode is: None\n", "Time taken for 58000000 is 721.2244408130646\n", "Previous Qnode is: None\n", "Time taken for 58100000 is 722.4429049491882\n", "Previous Qnode is: None\n", "Time taken for 58200000 is 723.6499350070953\n", "Previous Qnode is: None\n", "Time taken for 58300000 is 724.8284728527069\n", "Previous Qnode is: None\n", "Time taken for 58400000 is 726.0177428722382\n", "Previous Qnode is: None\n", "Time taken for 58500000 is 727.2296478748322\n", "Previous Qnode is: None\n", "Time taken for 58600000 is 728.3987309932709\n", "Previous Qnode is: None\n", "Time taken for 58700000 is 729.5818021297455\n", "Previous Qnode is: None\n", "Time taken for 58800000 is 730.7857439517975\n", "Previous Qnode is: None\n", "Time taken for 58900000 is 731.9865479469299\n", "Previous Qnode is: None\n", "Time taken for 59000000 is 733.2272350788116\n", "Previous Qnode is: None\n", "Time taken for 59100000 is 734.4478940963745\n", "Previous Qnode is: None\n", "Time taken for 59200000 is 735.6790609359741\n", "Previous Qnode is: None\n", "Time taken for 59300000 is 736.8759911060333\n", "Previous Qnode is: None\n", "Time taken for 59400000 is 738.0839591026306\n", "Previous Qnode is: None\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Time taken for 59500000 is 739.2276680469513\n", "Previous Qnode is: None\n", "Time taken for 59600000 is 740.442360162735\n", "Previous Qnode is: None\n", "Time taken for 59700000 is 741.6496458053589\n", "Previous Qnode is: None\n", "Time taken for 59800000 is 742.8656630516052\n", "Previous Qnode is: None\n", "Time taken for 59900000 is 744.050265789032\n", "Previous Qnode is: None\n", "Time taken for 60000000 is 745.2600898742676\n", "Previous Qnode is: None\n", "Time taken for 60100000 is 746.4602167606354\n", "Previous Qnode is: None\n", "Time taken for 60200000 is 747.6180560588837\n", "Previous Qnode is: None\n", "Time taken for 60300000 is 748.802463054657\n", "Previous Qnode is: None\n", "Time taken for 60400000 is 749.9692358970642\n", "Previous Qnode is: None\n", "Time taken for 60500000 is 751.1622998714447\n", "Previous Qnode is: None\n", "Time taken for 60600000 is 752.3710432052612\n", "Previous Qnode is: None\n", "Time taken for 60700000 is 753.5850188732147\n", "Previous Qnode is: None\n", "Time taken for 60800000 is 754.7838101387024\n", "Previous Qnode is: None\n", "Time taken for 60900000 is 755.9867498874664\n", "Previous Qnode is: None\n", "Time taken for 61000000 is 757.1642229557037\n", "Previous Qnode is: None\n", "Time taken for 61100000 is 758.342472076416\n", "Previous Qnode is: None\n", "Time taken for 61200000 is 759.5354330539703\n", "Previous Qnode is: None\n", "Time taken for 61300000 is 760.7126519680023\n", "Previous Qnode is: None\n", "Time taken for 61400000 is 761.9154660701752\n", "Previous Qnode is: None\n", "Time taken for 61500000 is 763.1347210407257\n", "Previous Qnode is: None\n", "Time taken for 61600000 is 764.3926680088043\n", "Previous Qnode is: None\n", "Time taken for 61700000 is 765.6165041923523\n", "Previous Qnode is: None\n", "Time taken for 61800000 is 766.8044459819794\n", "Previous Qnode is: None\n", "Time taken for 61900000 is 767.9938580989838\n", "Previous Qnode is: None\n", "Time taken for 62000000 is 769.2120971679688\n", "Previous Qnode is: None\n", "Time taken for 62100000 is 770.4022779464722\n", "Previous Qnode is: None\n", "Time taken for 62200000 is 771.6212830543518\n", "Previous Qnode is: None\n", "Time taken for 62300000 is 772.8863959312439\n", "Previous Qnode is: None\n", "Time taken for 62400000 is 774.1702320575714\n", "Previous Qnode is: None\n", "Time taken for 62500000 is 775.3878688812256\n", "Previous Qnode is: None\n", "Time taken for 62600000 is 776.5886669158936\n", "Previous Qnode is: None\n", "Time taken for 62700000 is 777.76722407341\n", "Previous Qnode is: None\n", "Time taken for 62800000 is 778.9590930938721\n", "Previous Qnode is: None\n", "Time taken for 62900000 is 780.1937339305878\n", "Previous Qnode is: None\n", "Time taken for 63000000 is 781.4631922245026\n", "Previous Qnode is: None\n", "Time taken for 63100000 is 782.6946461200714\n", "Previous Qnode is: None\n", "Time taken for 63200000 is 783.8624670505524\n", "Previous Qnode is: None\n", "Time taken for 63300000 is 785.0540318489075\n", "Previous Qnode is: None\n", "Time taken for 63400000 is 786.2217218875885\n", "Previous Qnode is: None\n", "Time taken for 63500000 is 787.4326548576355\n", "Previous Qnode is: None\n", "Time taken for 63600000 is 788.615984916687\n", "Previous Qnode is: None\n", "Time taken for 63700000 is 789.8348159790039\n", "Previous Qnode is: None\n", "Time taken for 63800000 is 791.1137340068817\n", "Previous Qnode is: None\n", "Time taken for 63900000 is 792.3717288970947\n", "Previous Qnode is: None\n", "Time taken for 64000000 is 793.5339179039001\n", "Previous Qnode is: None\n", "Time taken for 64100000 is 794.7070291042328\n", "Previous Qnode is: None\n", "Time taken for 64200000 is 795.9083650112152\n", "Previous Qnode is: None\n", "Time taken for 64300000 is 797.0768411159515\n", "Previous Qnode is: None\n", "Time taken for 64400000 is 798.2576739788055\n", "Previous Qnode is: None\n", "Time taken for 64500000 is 799.4599869251251\n", "Previous Qnode is: None\n", "Time taken for 64600000 is 800.6602590084076\n", "Previous Qnode is: None\n", "Time taken for 64700000 is 801.8880379199982\n", "Previous Qnode is: None\n", "Time taken for 64800000 is 803.1761889457703\n", "Previous Qnode is: None\n", "Time taken for 64900000 is 804.3642449378967\n", "Previous Qnode is: None\n", "Time taken for 65000000 is 805.5291390419006\n", "Previous Qnode is: None\n", "Time taken for 65100000 is 806.6961097717285\n", "Previous Qnode is: None\n", "Time taken for 65200000 is 807.865208864212\n", "Previous Qnode is: None\n", "Time taken for 65300000 is 809.0520389080048\n", "Previous Qnode is: None\n", "Time taken for 65400000 is 810.2519149780273\n", "Previous Qnode is: None\n", "Time taken for 65500000 is 811.5062432289124\n", "Previous Qnode is: None\n", "Time taken for 65600000 is 812.8092949390411\n", "Previous Qnode is: None\n", "Time taken for 65700000 is 814.1033191680908\n", "Previous Qnode is: None\n", "Time taken for 65800000 is 815.3205950260162\n", "Previous Qnode is: None\n", "Time taken for 65900000 is 816.5084590911865\n", "Previous Qnode is: None\n", "Time taken for 66000000 is 817.6727728843689\n", "Previous Qnode is: None\n", "Time taken for 66100000 is 818.8171651363373\n", "Previous Qnode is: None\n", "Time taken for 66200000 is 820.1316750049591\n", "Previous Qnode is: None\n", "Time taken for 66300000 is 821.4662008285522\n", "Previous Qnode is: None\n", "Time taken for 66400000 is 822.7226991653442\n", "Previous Qnode is: None\n", "Time taken for 66500000 is 824.0062458515167\n", "Previous Qnode is: None\n", "Time taken for 66600000 is 825.1848909854889\n", "Previous Qnode is: None\n", "Time taken for 66700000 is 826.3844020366669\n", "Previous Qnode is: None\n", "Time taken for 66800000 is 827.638542175293\n", "Previous Qnode is: None\n", "Time taken for 66900000 is 828.8240880966187\n", "Previous Qnode is: None\n", "Time taken for 67000000 is 830.0589220523834\n", "Previous Qnode is: None\n", "Time taken for 67100000 is 831.2560610771179\n", "Previous Qnode is: None\n", "Time taken for 67200000 is 832.4574568271637\n", "Previous Qnode is: None\n", "Time taken for 67300000 is 833.663586139679\n", "Previous Qnode is: None\n", "Time taken for 67400000 is 834.8718869686127\n", "Previous Qnode is: None\n", "Time taken for 67500000 is 836.0572409629822\n", "Previous Qnode is: None\n", "Time taken for 67600000 is 837.2127230167389\n", "Previous Qnode is: None\n", "Time taken for 67700000 is 838.427362203598\n", "Previous Qnode is: None\n", "Time taken for 67800000 is 839.6183619499207\n", "Previous Qnode is: None\n", "Time taken for 67900000 is 840.8490340709686\n", "Previous Qnode is: None\n", "Time taken for 68000000 is 842.0557582378387\n", "Previous Qnode is: None\n", "Time taken for 68100000 is 843.2553100585938\n", "Previous Qnode is: None\n", "Time taken for 68200000 is 844.4825479984283\n", "Previous Qnode is: None\n", "Time taken for 68300000 is 845.6889879703522\n", "Previous Qnode is: None\n", "Time taken for 68400000 is 846.8894999027252\n", "Previous Qnode is: None\n", "Time taken for 68500000 is 848.1088569164276\n", "Previous Qnode is: None\n", "Time taken for 68600000 is 849.3214240074158\n", "Previous Qnode is: None\n", "Time taken for 68700000 is 850.5358448028564\n", "Previous Qnode is: None\n", "Time taken for 68800000 is 851.7229640483856\n", "Previous Qnode is: None\n", "Time taken for 68900000 is 852.9296000003815\n", "Previous Qnode is: None\n", "Time taken for 69000000 is 854.1199581623077\n", "Previous Qnode is: None\n", "Time taken for 69100000 is 855.3395960330963\n", "Previous Qnode is: None\n", "Time taken for 69200000 is 856.5533421039581\n", "Previous Qnode is: None\n", "Time taken for 69300000 is 857.8220911026001\n", "Previous Qnode is: None\n", "Time taken for 69400000 is 859.0750269889832\n", "Previous Qnode is: None\n", "Time taken for 69500000 is 860.34801197052\n", "Previous Qnode is: None\n", "Time taken for 69600000 is 861.5921750068665\n", "Previous Qnode is: None\n", "Time taken for 69700000 is 862.8314549922943\n", "Previous Qnode is: None\n", "Time taken for 69800000 is 864.0628180503845\n", "Previous Qnode is: None\n", "Time taken for 69900000 is 865.2787709236145\n", "Previous Qnode is: None\n" ] } ], "source": [ "def create_dbpedia_link(wiki_link,lang):\n", " wiki_link_list = wiki_link.split('/')\n", " if lang == \"en\":\n", " dbpedia_link = \"http://dbpedia.org/resource/\" + wiki_link_list[-1]\n", " \n", " else:\n", " dbpedia_link = \"http://\" + lang + '.dbpedia.org/resource/' + wiki_link_list[-1]\n", " \n", " return dbpedia_link\n", " \n", "\n", "def dbpedia_edge_file(wikipedia_file,output_file):\n", " with gzip.open(wikipedia_file,'rt') as file:\n", " prev = None\n", " lines_to_write = list()\n", " first_line = file.readline().replace('\\n','').replace('\\r','')\n", " write_first_line = 'id' + '\\t' + 'node1' + '\\t' + 'label' + '\\t' + 'node2' \n", " columns = first_line.split('\\t')\n", " print(columns)\n", " prop_index = columns.index('label')\n", " node1_index = columns.index(\"node1\")\n", " id_index = columns.index(\"id\")\n", " node2_index = columns.index(\"node2\")\n", " lang_index = columns.index(\"language\")\n", " flag = False\n", " st = time.time()\n", " \n", " for i,line in enumerate(file):\n", " if i%100000 == 0:\n", " print(\"Time taken for {} is {}\".format(i,time.time() - st))\n", " print(\"Previous Qnode is:\",prev)\n", " \n", " vals = line.split('\\t')\n", " prop_label = vals[prop_index]\n", " node1 = vals[node1_index]\n", " id_val = vals[id_index].strip('\\n')\n", " node2 = vals[node2_index]\n", " lang = vals[lang_index]\n", " \n", " dbpedia_link = create_dbpedia_link(node2,lang)\n", " \n", " lines_to_write.append(id_val + '\\t' + node1 + '\\t' + 'dbpedia_link' + '\\t' + dbpedia_link + '\\n')\n", " lines_to_write.append('\\t' + id_val + '\\t' + 'P424' + '\\t' + lang + '\\n')\n", " \n", " if len(lines_to_write) > 100000:\n", " with gzip.open(output_file,'a') as writer:\n", " if flag == False:\n", " header = write_first_line + '\\n'\n", " writer.write(header.encode('utf8'))\n", " flag = True\n", " \n", " writer.write(''.join(lines_to_write).encode('utf8'))\n", " #writer.write('\\n'.encode('utf8')) \n", " lines_to_write = list()\n", " if len(lines_to_write) > 0:\n", " #print(lines_to_write)\n", " with gzip.open(output_file,'a') as writer:\n", " if flag == False:\n", " header = write_first_line + '\\n'\n", " writer.write(header.encode('utf8'))\n", " flag = True\n", " writer.write(''.join(lines_to_write).encode('utf8'))\n", " #writer.write('\\n'.encode('utf8'))\n", "\n", "dbpedia_edge_file(os.getenv(\"WIKIPEDIA\"),output_file)" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [], "source": [ "!kgtk add-id --id-style wikidata -i $output_file -o $final_output_file" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idnode1labelnode2
0Q1-wikipedia_sitelink-017715Q1dbpedia_linkhttp://oc.dbpedia.org/resource/Univèrs
1Q1-wikipedia_sitelink-017715-P424-5f751eQ1-wikipedia_sitelink-017715P424oc
2Q1-wikipedia_sitelink-0753b0Q1dbpedia_linkhttp://cdo.dbpedia.org/resource/Ṳ̄-dêu
3Q1-wikipedia_sitelink-0753b0-P424-da62beQ1-wikipedia_sitelink-0753b0P424cdo
4Q1-wikipedia_sitelink-0881b4Q1dbpedia_linkhttp://ml.dbpedia.org/resource/പ്രപഞ്ചം
5Q1-wikipedia_sitelink-0881b4-P424-5d58d4Q1-wikipedia_sitelink-0881b4P424ml
6Q1-wikipedia_sitelink-09275bQ1dbpedia_linkhttp://si.dbpedia.org/resource/විශ්වය
7Q1-wikipedia_sitelink-09275b-P424-97a62aQ1-wikipedia_sitelink-09275bP424si
8Q1-wikipedia_sitelink-0befb2Q1dbpedia_linkhttp://bxr.dbpedia.org/resource/Оршолон
9Q1-wikipedia_sitelink-0befb2-P424-b7d00cQ1-wikipedia_sitelink-0befb2P424bxr
\n", "
" ], "text/plain": [ " id node1 \\\n", "0 Q1-wikipedia_sitelink-017715 Q1 \n", "1 Q1-wikipedia_sitelink-017715-P424-5f751e Q1-wikipedia_sitelink-017715 \n", "2 Q1-wikipedia_sitelink-0753b0 Q1 \n", "3 Q1-wikipedia_sitelink-0753b0-P424-da62be Q1-wikipedia_sitelink-0753b0 \n", "4 Q1-wikipedia_sitelink-0881b4 Q1 \n", "5 Q1-wikipedia_sitelink-0881b4-P424-5d58d4 Q1-wikipedia_sitelink-0881b4 \n", "6 Q1-wikipedia_sitelink-09275b Q1 \n", "7 Q1-wikipedia_sitelink-09275b-P424-97a62a Q1-wikipedia_sitelink-09275b \n", "8 Q1-wikipedia_sitelink-0befb2 Q1 \n", "9 Q1-wikipedia_sitelink-0befb2-P424-b7d00c Q1-wikipedia_sitelink-0befb2 \n", "\n", " label node2 \n", "0 dbpedia_link http://oc.dbpedia.org/resource/Univèrs \n", "1 P424 oc \n", "2 dbpedia_link http://cdo.dbpedia.org/resource/Ṳ̄-dêu \n", "3 P424 cdo \n", "4 dbpedia_link http://ml.dbpedia.org/resource/പ്രപഞ്ചം \n", "5 P424 ml \n", "6 dbpedia_link http://si.dbpedia.org/resource/විශ්වය \n", "7 P424 si \n", "8 dbpedia_link http://bxr.dbpedia.org/resource/Оршолон \n", "9 P424 bxr " ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.read_csv(final_output_file,sep = '\\t',nrows = 10)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## CleanUp" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "os.remove(output_file)" ] } ], "metadata": { "celltoolbar": "Tags", "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.9" } }, "nbformat": 4, "nbformat_minor": 4 }