{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "pediatric-publication", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[2021-03-07 18:46:19 query]: SQL Translation:\r\n", "---------------------------------------------\r\n", " SELECT graph_1_c1.\"id\" \"_aLias.id\", graph_1_c1.\"node1\" \"_aLias.node1\", graph_2_c2.\"label\" \"_aLias.label\", graph_2_c2.\"node2\" \"_aLias.node2\"\r\n", " FROM graph_1 AS graph_1_c1, graph_2 AS graph_2_c2\r\n", " WHERE graph_1_c1.\"label\"=?\r\n", " AND graph_1_c1.\"node2\"=?\r\n", " AND (graph_1_c1.\"id\" = graph_2_c2.\"node1\")\r\n", " PARAS: ['P2302', 'Q21503247']\r\n", "---------------------------------------------\r\n" ] } ], "source": [ "!kgtk --debug query -i ../../gdrive-kgtk-dump-2020-12-07/claims.properties.tsv.gz \\\n", " ../../gdrive-kgtk-dump-2020-12-07/qualifiers.properties.tsv.gz \\\n", " --match \"p: (nodeProp1)-[nodePropEdge:P2302]->(:Q21503247), q: (nodePropEdge1)-[nodePropEdgeProps]->(val)\" \\\n", " --where 'nodePropEdge.id = nodePropEdge1' \\\n", " --return 'nodePropEdge.id as id, nodeProp1 as node1, nodePropEdgeProps.label as label, val as node2' \\\n", " -o ../../constraintsOP/itemRequiresConstraint/claims.type-constraints_all.tsv \\\n", " --graph-cache ~/sqlite3_caches/temp1345.valuetype.sqlite3.db" ] } ], "metadata": { "kernelspec": { "display_name": "kgtkEnv", "language": "python", "name": "kgtkenv" }, "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.8.5" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 5 }