use injected parameters to call wikidata usefule files notebook
"-p output_folder useful_files_v4 \\\n",
"-p temp_folder temp.useful_files_v4 \\\n",
"-p delete_database no \n",
+ "-p compute_pagerank no\n",
"```"
]
},
{
"cell_type": "code",
- "execution_count": 38,
+ "execution_count": 1,
"metadata": {
"tags": [
"parameters"
"cache_path = \"/Users/pedroszekely/Downloads/kypher/temp.useful_wikidata_files_v4\"\n",
"\n",
"# Whether to delete the cache database\n",
+ "if delete_database and delete_database.lower().strip() == 'yes':\n",
+ " delete_database = True\n",
+ "else:\n",
" delete_database = False\n",
"\n",
+ "if compute_pagerank and compute_pagerank.lower().strip() == 'yes':\n",
+ " compute_pagerank = True\n",
+ "else:\n",
+ " compute_pagerank = False\n",
+ "\n",
"# shortcuts to commands\n",
"kgtk = \"time kgtk --debug\"\n",
"# kgtk = \"kgtk --debug\"\n",
"source": [
"pm.execute_notebook(\n",
" notebooks_folder + useful_files_notebook,\n",
- " {temp} + \"/useful_files_notebook_output.ipynb\",\n",
+ " temp + \"/useful_files_notebook_output.ipynb\",\n",
" parameters=dict(\n",
- " output_path=\"/Users/pedroszekely/Downloads/kypher\",\n",
- " output_folder=\"wikidata_os_v1\",\n",
- " temp_folder=\"temp.wikidata_os_v1\",\n",
- " wiki_root_folder=\"/Users/pedroszekely/Downloads/kypher/wikidata_os_v1/\",\n",
+ " output_path=output_path,\n",
+ " output_folder=output_folder,\n",
+ " temp_folder=temp_folder,\n",
+ " wiki_root_folder=wiki_root_folder,\n",
" claims_file=\"claims.tsv.gz\",\n",
" label_file=\"labels.en.tsv.gz\",\n",
" alias_file=\"aliases.en.tsv.gz\",\n",
" description_file=\"descriptions.en.tsv.gz\",\n",
" item_file=\"claims.wikibase-item.tsv.gz\",\n",
- " cache_path=\"/Users/pedroszekely/Downloads/kypher/temp.useful_wikidata_files_v4\",\n",
- " delete_database=False,\n",
- " compute_pagerank=False\n",
+ " cache_path=cache_path,\n",
+ " delete_database=delete_database,\n",
+ " compute_pagerank=compute_pagerank\n",
" )\n",
")"
]
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
- "display_name": "kgtk",
+ "display_name": "kgtk_env",
"language": "python",
- "name": "kgtk"
+ "name": "kgtk_env"
},
"language_info": {
"codemirror_mode": {
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.7.8"
+ "version": "3.6.6"
}
},
"nbformat": 4,
