example 3 runs well
"source": [
"# Example Scenario 1: Obtaining embeddings for strong relations\n",
"\n",
- "*Carol would like to combine two subsets of Wikidata: one containing all people, and the other containing all edges that point to USA. The combined file needs to be sorted by subject, after which she would compute the set of reachable nodes via the properties `instance of (P31)` or `subclass of (P279)`.*"
+ "*Carol would like to combine two subsets of Wikidata: one containing all subclass relations, and the other containing occuppations for several notable people. The combined file needs to be sorted by subject, after which she would compute the set of reachable nodes for those people via the properties `occupation (P106)` or `subclass of (P279)`.*"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Then, she can merge the two files into one and perform further operations:"
+ "Then, she can merge the two files into one, sort that file, and generate the set of reachable nodes for the three nodes of interest."
]
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
]
},
{
- "cell_type": "markdown",
+ "cell_type": "code",
+ "execution_count": 5,
"metadata": {},
+ "outputs": [],
"source": [
- "## Missing pieces\n",
- "* get the wikidata file\n",
- "* perhaps make it a tsv\n",
- "* concatenate two files - test\n",
- "* sort test\n",
- "* reachable nodes test"
+ "%%bash\n",
+ "kgtk reachable_nodes cat.tsv --subj 1 --pred 2 --obj 3 --props P106,P279 --root \"Q8023,Q483203,Q1426\" -o reachable.tsv"
]
},
{
- "cell_type": "code",
- "execution_count": 12,
+ "cell_type": "markdown",
"metadata": {},
- "outputs": [],
"source": [
- "%%bash\n",
- "kgtk reachable_nodes cat.tsv --subj 1 --pred 2 --obj 3 --props P31,P279 --root \"Q1001698, Q5\" > reachable.tsv"
+ "## Missing pieces\n",
+ "* get the wikidata file\n",
+ "* perhaps make it a tsv\n",
+ "* sort function integrated in kgtk dev"
]
},
{
