{ "cells": [ { "cell_type": "markdown", "id": "8d898856-71fe-4bbc-914b-b4ed9d3101bc", "metadata": {}, "source": [ "# gd07 Overview" ] }, { "cell_type": "markdown", "id": "10535845-26ea-405f-9124-c53a664b9c91", "metadata": {}, "source": [ "## Docu for Users" ] }, { "cell_type": "code", "execution_count": 1, "id": "1a06d9c9-945b-4ad5-9e7e-a90725191a5d", "metadata": {}, "outputs": [], "source": [ "from gd07 import GenDifS" ] }, { "cell_type": "markdown", "id": "41d3c02a-7c42-4123-8ce6-3cc6b0119b07", "metadata": {}, "source": [ "load mindmap file:" ] }, { "cell_type": "code", "execution_count": 2, "id": "18d950ee-fc82-4f67-8e24-9cd2027c0a55", "metadata": {}, "outputs": [], "source": [ "m = GenDifS(\"../mm/gd07-overview.mm\", verb=2)" ] }, { "cell_type": "markdown", "id": "c9f04823-c510-4d5b-83d5-807482360b78", "metadata": {}, "source": [ "We can now have a look at the XML file." ] }, { "cell_type": "code", "execution_count": 3, "id": "12f6352a-4c0e-4a05-b26e-deaea44fa515", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "self.mindmap_file_location='../mm/gd07-overview.mm': self.mindmap_topnode.get('TEXT')='test'\n", "len(self.mindmap_xml.getroot().xpath('.//node'))=70 nodes\n" ] } ], "source": [ "m.describe_mindmap()" ] }, { "cell_type": "markdown", "id": "acbe2191-1099-413a-a230-728e8ee98e8e", "metadata": {}, "source": [ "We now compile the mindmap:" ] }, { "cell_type": "code", "execution_count": 4, "id": "42b3b029-ace9-4712-a939-90aeb84d10a3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Info 766: Test_classify_similar OK, id='ID_1827765926', tuple=(b'urn:ex#White_Horse_ID_1827765926', b'urn:ex#White_Horse_ID_1827765926_2').\n", "Info 766: Test_classify_similar OK, id='ID_1301336062', tuple=(b'urn:ex#thing_ID_1301336062', b'urn:ex#Animal_ID_1301336062').\n", "Info 766: Test_classify_similar OK, id='ID_994727770', tuple=(b'urn:ex#Milk_ID_994727770', b'urn:ex#BY_ID_994727770_restriction_example').\n", "Info 766: Test_classify_similar OK, id='ID_844451713', tuple=(b'urn:ex#Milk_ID_844451713', b'urn:ex#BY_ID_844451713_restriction_example').\n", "Info 766: Test_classify_similar OK, id='ID_630221511', tuple=(b'urn:ex#Milk_ID_630221511', b'urn:ex#Goat_Milk_ID_630221511').\n", "Info 766: Test_classify_similar OK, id='ID_642212529', tuple=(b'urn:ex#Pferd_ID_642212529', b'urn:ex#BY_ID_642212529_restriction_example').\n", "Info 766: Test_classify_similar OK, id='ID_795911570', tuple=(b'urn:ex#Pferd_ID_795911570', b'urn:ex#Schimmel_ID_795911570').\n" ] } ], "source": [ "m.compile()" ] }, { "cell_type": "markdown", "id": "e190d28c-0f7c-4a60-beb2-3416eea5e068", "metadata": {}, "source": [ "Into which languages did we compile the mindmap by default?" ] }, { "cell_type": "code", "execution_count": 5, "id": "46d561c0-e4e1-4e58-ad68-d29e617ebe97", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'DE', 'OWL', 'OWLtest', 'RDFS', 'RDFStest', 'SKOS'}" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m.languages" ] }, { "cell_type": "markdown", "id": "19434da8-0768-4f1a-9ea1-a892708d62be", "metadata": {}, "source": [ "By default we generate one RDF Graph per taxonomy and language. However, we can tell the compiler to collect several languages into one single graph. In the following examples we assume that we want to have a SKOS graph and a graph comprising RDFS and RDFS test instances." ] }, { "cell_type": "code", "execution_count": 6, "id": "ad2ba652-fb4d-4aea-84d6-7096f5fc5f03", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Info 766: Test_classify_similar OK, id='ID_1827765926', tuple=(b'urn:ex#White_Horse_ID_1827765926', b'urn:ex#White_Horse_ID_1827765926_2').\n", "Info 766: Test_classify_similar OK, id='ID_1301336062', tuple=(b'urn:ex#thing_ID_1301336062', b'urn:ex#Animal_ID_1301336062').\n", "Info 766: Test_classify_similar OK, id='ID_994727770', tuple=(b'urn:ex#Milk_ID_994727770', b'urn:ex#BY_ID_994727770_restriction_example').\n", "Info 766: Test_classify_similar OK, id='ID_844451713', tuple=(b'urn:ex#Milk_ID_844451713', b'urn:ex#BY_ID_844451713_restriction_example').\n", "Info 766: Test_classify_similar OK, id='ID_630221511', tuple=(b'urn:ex#Milk_ID_630221511', b'urn:ex#Goat_Milk_ID_630221511').\n", "Info 766: Test_classify_similar OK, id='ID_642212529', tuple=(b'urn:ex#Pferd_ID_642212529', b'urn:ex#BY_ID_642212529_restriction_example').\n", "Info 766: Test_classify_similar OK, id='ID_795911570', tuple=(b'urn:ex#Pferd_ID_795911570', b'urn:ex#Schimmel_ID_795911570').\n" ] } ], "source": [ "m.compile(language_list_list= ['SKOS', ['RDFS', 'RDFStest'], 'DE' ])" ] }, { "cell_type": "markdown", "id": "e28b0bbd-f5ba-4621-850c-0e9b5bf348b6", "metadata": {}, "source": [ "On single mindmap may contain several taxonomies. List them by ID:" ] }, { "cell_type": "code", "execution_count": 7, "id": "b58f04cf-58fe-424d-b0dd-e2418a7fb8c6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'ID_1063896536': ,\n", " 'ID_169383865': ,\n", " 'ID_1362702576': ,\n", " 'ID_1860444087': ,\n", " 'ID_43103660': ,\n", " 'ID_159324499': }" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m.taxonomies_by_ID" ] }, { "cell_type": "markdown", "id": "ccf395dd-73e6-4d99-8a05-65ca524f5ce0", "metadata": {}, "source": [ "List them by name:" ] }, { "cell_type": "code", "execution_count": 8, "id": "ac3a7254-8e7a-4fdf-acf8-07dfa726932f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'test_ISA': ,\n", " 'test_SUP': ,\n", " 'test_SOME': ,\n", " 'test_BY': ,\n", " 'test_BY_SOME': ,\n", " 'test_natural_language_de': }" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m.taxonomies_by_name" ] }, { "cell_type": "markdown", "id": "6261d186-53fd-459e-8a50-718b93c1ecb2", "metadata": {}, "source": [ "Describe the taxonomies from a bird's eye view:" ] }, { "cell_type": "code", "execution_count": 9, "id": "c14fa971-a0d6-49f9-8190-b7ddaed8cab2", "metadata": {}, "outputs": [], "source": [ "#m.describe_taxonomies()" ] }, { "cell_type": "markdown", "id": "04dd2cd7-43d7-4fc0-88b8-6b92737e6633", "metadata": {}, "source": [ "You may access a taxonomy either by ID or by name. " ] }, { "cell_type": "code", "execution_count": 10, "id": "121f8b6f-50f3-43ad-9da9-880547ae64d5", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "ID_1063896536 TAXONOMY test_ISA: #5 GenDifS nodes;\n", "self.languages={'RDFS', 'SKOS', 'RDFStest'};\n", "self.rdf_graphs.keys()=dict_keys(['SKOS', 'RDFS_RDFStest', 'DE'])\n" ] } ], "source": [ "m.taxonomies_by_name[\"test_ISA\"].describe()" ] }, { "cell_type": "markdown", "id": "0f6beb13-45d3-45e9-b301-a07adf8f86c6", "metadata": {}, "source": [ "The language sets of a taxonomy:" ] }, { "cell_type": "code", "execution_count": 11, "id": "6656b06c-85a0-4069-a962-f99b688eb6e9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "dict_keys(['SKOS', 'RDFS_RDFStest', 'DE'])" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m.taxonomies_by_name[\"test_ISA\"].rdf_graphs.keys()" ] }, { "cell_type": "markdown", "id": "ef26080c-5792-4076-8f66-682fd498fe36", "metadata": {}, "source": [ "Each taxonomy has for each language set an own graph:" ] }, { "cell_type": "code", "execution_count": 12, "id": "6263e9a9-7585-40b2-9b81-ba61bf4f528b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'SKOS': )>,\n", " 'RDFS_RDFStest': )>,\n", " 'DE': )>}" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m.taxonomies_by_name[\"test_ISA\"].rdf_graphs" ] }, { "cell_type": "markdown", "id": "726fe16e-ae9e-4b79-9368-8e071a103816", "metadata": {}, "source": [ "Access e.g. the SKOS graph of taxonomy `test_ISA`:" ] }, { "cell_type": "code", "execution_count": 13, "id": "63f502a5-cdd8-4889-9749-b343497f3d21", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "@prefix cpt: .\n", "@prefix skos: .\n", "\n", "cpt:Mare a skos:Concept ;\n", " skos:broader cpt:Horse .\n", "\n", "cpt:Stallion a skos:Concept ;\n", " skos:broader cpt:Horse .\n", "\n", "cpt:test_ISA a skos:ConceptScheme .\n", "\n", "cpt:Horse a skos:Concept ;\n", " skos:inScheme cpt:test_ISA .\n", "\n", "\n" ] } ], "source": [ "print(m.taxonomies_by_name[\"test_ISA\"].rdf_graphs_ttl[\"SKOS\"])" ] }, { "cell_type": "markdown", "id": "012a6d76-d414-43c8-b0ef-bd8b80f99a10", "metadata": {}, "source": [ "Access the graph comprising the RDFS and RDFS test instances as generated by GenDifS / TBD: rather generated by RDFlib?" ] }, { "cell_type": "code", "execution_count": 14, "id": "ad537984-05a1-41b4-a613-aeb435e55f95", "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "@prefix : .\n", "@prefix ex: .\n", "@prefix gendifs: .\n", "@prefix owl: .\n", "@prefix rdfs: .\n", "\n", "ex:Horse_ID_256160314 a :Horse .\n", "\n", "ex:Mare_ID_1847046641 a :Mare ;\n", " gendifs:classify_similar ex:Horse_ID_1847046641 .\n", "\n", "ex:Mare_ID_889051662 a :Mare .\n", "\n", "ex:Stallion_ID_1083557091 a :Stallion .\n", "\n", "ex:Stallion_ID_1847046641 a :Stallion ;\n", " gendifs:classify_similar ex:Horse_ID_1847046641 .\n", "\n", ":Mare a owl:Class ;\n", " rdfs:subClassOf :Horse .\n", "\n", ":Stallion a owl:Class ;\n", " rdfs:subClassOf :Horse .\n", "\n", "ex:Horse_ID_1847046641 a :Horse .\n", "\n", ":Horse a owl:Class .\n", "\n", "\n" ] } ], "source": [ "print(m.taxonomies_by_name[\"test_ISA\"].rdf_graphs_ttl[\"RDFS_RDFStest\"])" ] }, { "cell_type": "markdown", "id": "d17debf6-50ab-4cca-8dd2-1db039177afa", "metadata": {}, "source": [ "Access the same graph as generated by rdflib:" ] }, { "cell_type": "code", "execution_count": 15, "id": "0fea72c4-64c2-41c6-9ac2-21383b634d79", "metadata": {}, "outputs": [], "source": [ "# print(m.taxonomies_by_name[\"test_ISA\"].rdf_graphs[\"RDFS_RDFStest\"].serialize())" ] }, { "cell_type": "markdown", "id": "08a486f4-ccb3-440d-a151-783d56c172ca", "metadata": {}, "source": [ "## Normal Language Explanations\n", "\n", "We have added a natural language description to the individual class descriptions (experimental, for the time being only for DE), see {doc}`explanation-demo`." ] }, { "cell_type": "markdown", "id": "040cf6c2-8fdb-4050-a781-805407d6b0fd", "metadata": {}, "source": [ "# Technical Stuff" ] }, { "cell_type": "markdown", "id": "75f0d7e2-5d93-421f-bb0a-24275f31932e", "metadata": {}, "source": [ "Dictionaries" ] }, { "cell_type": "markdown", "id": "3217d048-a8d3-4364-9f63-7fa976d26228", "metadata": {}, "source": [ "`m.taxonomies_by_name` is a dictionary of taxonomies:" ] }, { "cell_type": "code", "execution_count": 16, "id": "1cb5cdfe-4ebc-48ed-aa44-d71e1d430229", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "gd07.GenDifS_taxonomy" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m_one = m.taxonomies_by_name[\"test_ISA\"]\n", "type(m_one)" ] }, { "cell_type": "markdown", "id": "5310c46a-27b3-4446-8d42-78420ad510fe", "metadata": {}, "source": [ "Each single taxonomy can be accessed via a dict of GenDifsNodes, short: `gdn`:" ] }, { "cell_type": "code", "execution_count": 17, "id": "6137f86b-b7cb-4d6b-8fbc-2068edbb419d", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'ID_1063896536': ,\n", " 'ID_256160314': ,\n", " 'ID_1847046641': ,\n", " 'ID_889051662': ,\n", " 'ID_1083557091': }" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "m_one.dict_of_all_gdn" ] }, { "cell_type": "markdown", "id": "7e36ccaf-48fd-4a2f-980d-cdbd2a8fc334", "metadata": {}, "source": [ "gdn have a (more or less pretty) `__str__` method:" ] }, { "cell_type": "code", "execution_count": 18, "id": "10b18722-32cf-4567-b52e-13b60ec27076", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "ID_1063896536 (gdn_differentia) TAXONOMY test_ISA\n", " {'SKOS': '# ID_1063896536 SKOS\\ncpt:test_ISA a skos:ConceptScheme .\\ncpt:Horse a skos:Concept ;\\n skos:inScheme cpt:test_ISA .'}\n", "ID_256160314 (gdn_taxon) Horse\n", " {'RDFS': '# ID_256160314 RDFS\\n:Horse a owl:Class . ', 'RDFStest': '# ID_256160314 RDFStest\\nex:Horse_ID_256160314 a :Horse . '}\n", "ID_1847046641 (gdn_differentia) ISA\n", " {'RDFS': '# ID_1847046641 RDFS\\n:Horse a owl:Class .\\n:Mare a owl:Class;\\n rdfs:subClassOf :Horse .\\n:Stallion a owl:Class;\\n rdfs:subClassOf :Horse .', 'RDFStest': '# ID_1847046641 RDFStest\\nex:Horse_ID_1847046641 a :Horse .\\nex:Mare_ID_1847046641 a :Mare .\\nex:Stallion_ID_1847046641 a :Stallion .\\nex:Mare_ID_1847046641 gendifs:classify_similar ex:Horse_ID_1847046641 .\\nex:Stallion_ID_1847046641 gendifs:classify_similar ex:Horse_ID_1847046641 .', 'SKOS': '# ID_1847046641 SKOS\\ncpt:Horse a skos:Concept .\\ncpt:Mare a skos:Concept ;\\n skos:broader cpt:Horse .\\ncpt:Stallion a skos:Concept ;\\n skos:broader cpt:Horse .'}\n", "ID_889051662 (gdn_taxon) Mare\n", " {'RDFS': '# ID_889051662 RDFS\\n:Mare a owl:Class . ', 'RDFStest': '# ID_889051662 RDFStest\\nex:Mare_ID_889051662 a :Mare . '}\n", "ID_1083557091 (gdn_taxon) Stallion\n", " {'RDFS': '# ID_1083557091 RDFS\\n:Stallion a owl:Class . ', 'RDFStest': '# ID_1083557091 RDFStest\\nex:Stallion_ID_1083557091 a :Stallion . '}\n" ] } ], "source": [ "for id, gdn_node in m_one.dict_of_all_gdn.items():\n", " print(gdn_node)" ] }, { "cell_type": "markdown", "id": "f729cde1-aee3-4d76-944d-2488add5aecc", "metadata": {}, "source": [ "Describe all GenDifS nodes of `m_one` with the `describe()` method:" ] }, { "cell_type": "code", "execution_count": 19, "id": "6f9af56a-09a5-405e-a48a-be6d4d8b3913", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "differentia TAXONOMY: {'TAXONOMY': 'test_ISA'} \n", "self.context={'id': 'ID_1063896536', 'codeclass': 'TAXONOMY', 'taxonomy_name': 'test_ISA', 'graph': 'graph_ID_1063896536', 'species_list': ['Horse']}\n", "self.molecule_per_language=\n", "--------------------\n", "Horse\n", "self.context={'id': 'ID_256160314', 'codeclass': 'taxon', 'species': 'Horse'}\n", "====================\n", "differentia ISA: {'ISA': ''} \n", "self.context={'id': 'ID_1847046641', 'codeclass': 'ISA', 'genus': 'Horse', 'species_list': ['Mare', 'Stallion']}\n", "self.molecule_per_language=\n", "--------------------\n", "Mare\n", "self.context={'id': 'ID_889051662', 'codeclass': 'taxon', 'species': 'Mare'}\n", "====================\n", "Stallion\n", "self.context={'id': 'ID_1083557091', 'codeclass': 'taxon', 'species': 'Stallion'}\n", "====================\n" ] } ], "source": [ "for node in m_one.dict_of_all_gdn.values():\n", " node.describe()" ] }, { "cell_type": "markdown", "id": "72449b98-2adf-46c3-a5c2-0f785d89186c", "metadata": {}, "source": [ "Retrieve all ids (there might be more than one) of all nodes with a specific species, say `Horse`:\n", "\n", "TBD provide methods (a) for taxon nodes, (b) for differentia nodes" ] }, { "cell_type": "code", "execution_count": 20, "id": "7a914264-7334-4030-9a48-89f2a60db26c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'ID_256160314'}" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Pferd_id_set = { node.context['id'] for node in m_one.dict_of_all_gdn.values() if node.context.get(\"species\") == \"Horse\" }\n", "Pferd_id_set" ] }, { "cell_type": "markdown", "id": "4179b4f7-94b5-4e96-8ba2-090517609fea", "metadata": {}, "source": [ "As expected we only got one id. \n", "Link `Pferd_gdn` to the identified gdn:" ] }, { "cell_type": "code", "execution_count": 21, "id": "8894b929-3ebd-46e3-844e-79b67eaac638", "metadata": {}, "outputs": [], "source": [ "Pferd_id = Pferd_id_set.pop()\n", "Pferd_gdn = m_one.dict_of_all_gdn[Pferd_id]" ] }, { "cell_type": "markdown", "id": "954c3c97-6b57-4ba3-a339-febb735a04a9", "metadata": {}, "source": [ "Inspect the dict `context` of this gdn. The context comprises all information which is relevant for code generation" ] }, { "cell_type": "markdown", "id": "5a171595-0ed8-4ba4-94bf-62a2a286543a", "metadata": {}, "source": [ "Lets have a look at a differentia node" ] }, { "cell_type": "code", "execution_count": 22, "id": "49cffc66-fa4f-47bc-908c-59eb47347d1b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'id': 'ID_256160314', 'codeclass': 'taxon', 'species': 'Horse'}" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Pferd_gdn.context" ] }, { "cell_type": "code", "execution_count": 23, "id": "3fb304c2-c883-4db9-baa4-0c9935d40d67", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'id': 'ID_1847046641',\n", " 'codeclass': 'ISA',\n", " 'genus': 'Horse',\n", " 'species_list': ['Mare', 'Stallion']}" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "isa_gdn = m_one.dict_of_all_gdn[\"ID_1847046641\"]\n", "isa_gdn.context" ] }, { "cell_type": "markdown", "id": "ed8123c0-a415-43f9-a72d-680cbe183547", "metadata": {}, "source": [ "The code of a gdn is maintained in the class `molecule_per_language`:" ] }, { "cell_type": "code", "execution_count": 24, "id": "1de5bd59-132a-4c06-8d74-111ee4a50079", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "gd07.GenDifS_molecule_per_language" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(isa_gdn.molecule_per_language)" ] }, { "cell_type": "markdown", "id": "fce37c39-8521-49d4-be49-43eb012c475b", "metadata": {}, "source": [ "`isa_gdn.molecule_per_language.compile()` generates a ttl molecule for each language. The generated code is kept in `sa_gdn.molecule_dict`:" ] }, { "cell_type": "code", "execution_count": 25, "id": "350f97ee-af1a-4fd6-8a13-701deaa2f404", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "dict_keys(['RDFS', 'RDFStest', 'SKOS'])" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "isa_gdn.molecule_dict.keys()" ] }, { "cell_type": "markdown", "id": "c9bd0cff-b4b7-49e6-af1d-c7451489b4e3", "metadata": {}, "source": [ "get SKOS:" ] }, { "cell_type": "code", "execution_count": 26, "id": "b5f15de1-458a-47d0-9f05-d6c8a0c1185a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "# ID_1847046641 SKOS\n", "cpt:Horse a skos:Concept .\n", "cpt:Mare a skos:Concept ;\n", " skos:broader cpt:Horse .\n", "cpt:Stallion a skos:Concept ;\n", " skos:broader cpt:Horse .\n" ] } ], "source": [ "print(isa_gdn.molecule_dict[\"SKOS\"])" ] }, { "cell_type": "markdown", "id": "0a382328-c243-4650-9a77-9b2fab8236e4", "metadata": {}, "source": [ "get RDFS:" ] }, { "cell_type": "code", "execution_count": 27, "id": "8da643e1-687f-480d-b2c0-6f75b99f9e20", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "# ID_1847046641 RDFS\n", ":Horse a owl:Class .\n", ":Mare a owl:Class;\n", " rdfs:subClassOf :Horse .\n", ":Stallion a owl:Class;\n", " rdfs:subClassOf :Horse .\n" ] } ], "source": [ "print(isa_gdn.molecule_dict[\"RDFS\"])" ] }, { "cell_type": "markdown", "id": "0b6e8708-b7e5-4208-84f2-20d1541519b7", "metadata": {}, "source": [ "RDFSTest provides example instances plus a `gendifs:classify_similar` property:" ] }, { "cell_type": "code", "execution_count": 28, "id": "1b199be0-d709-43f2-93bb-bbf0e0fee2f9", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "# ID_1847046641 RDFStest\n", "ex:Horse_ID_1847046641 a :Horse .\n", "ex:Mare_ID_1847046641 a :Mare .\n", "ex:Stallion_ID_1847046641 a :Stallion .\n", "ex:Mare_ID_1847046641 gendifs:classify_similar ex:Horse_ID_1847046641 .\n", "ex:Stallion_ID_1847046641 gendifs:classify_similar ex:Horse_ID_1847046641 .\n" ] } ], "source": [ "print(isa_gdn.molecule_dict[\"RDFStest\"])" ] }, { "cell_type": "code", "execution_count": null, "id": "3d18474e-37bd-41cd-9f56-cd0dbcafb9dc", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.12.2" } }, "nbformat": 4, "nbformat_minor": 5 }