{"id":3660,"date":"2025-04-11T11:09:04","date_gmt":"2025-04-11T05:39:04","guid":{"rendered":"https:\/\/www.rangakrish.com\/?p=3660"},"modified":"2025-04-11T13:36:50","modified_gmt":"2025-04-11T08:06:50","slug":"using-claude-to-generate-rdf-triples","status":"publish","type":"post","link":"https:\/\/www.rangakrish.com\/index.php\/2025\/04\/11\/using-claude-to-generate-rdf-triples\/","title":{"rendered":"Using Claude to Generate RDF Triples"},"content":{"rendered":"<p>We all know that <em><strong>LLMs<\/strong><\/em> are now capable of generating structured data. I have used <em><strong>OpenAI<\/strong><\/em> models earlier to generate <em><strong>Tables<\/strong><\/em> and <em><strong>JSON<\/strong><\/em> data, but this time I wanted to try a more complex example.<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>As someone interested in <em><strong>Homeopathy<\/strong><\/em>, I wanted to generate remedy descriptions as <em><strong>RDF<\/strong><\/em> triples, in particular, <em><strong>Turtle<\/strong><\/em> (TTL) format. That would allow me to model homeo remedies using <em><strong>Knowledge Graph<\/strong><\/em>.<\/p>\n<p>I decided to use <em><strong>Anthropic Claude<\/strong><\/em> for this experiment.<\/p>\n<p>I launched <em><strong>Claude (Sonnet 3.7)<\/strong><\/em> and gave it the following prompt:<\/p>\n<blockquote><p>\u201cYou are an experienced software developer with a deep understanding of semantic web standards. As a student of homeopathy, I want to represent the key symptoms (including modalities) of Lycopodium in Turtle format. Apply your extensive knowledge and do this for me.\u201d<\/p><\/blockquote>\n<p>It immediately generated a <em><strong>TTL<\/strong><\/em> representation of some interesting symptoms of <em><strong>Lycopodium<\/strong><\/em>. Here is a partial representation:<\/p>\n<figure id=\"attachment_3661\" aria-describedby=\"caption-attachment-3661\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco.png?ssl=1\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" data-attachment-id=\"3661\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2025\/04\/11\/using-claude-to-generate-rdf-triples\/lyco\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco.png\" data-orig-size=\"1412,1092\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Lycopodium TTL Format\" data-image-description=\"&lt;p&gt;Lycopodium TTL Format&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Lycopodium TTL Format&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco-1024x792.png\" class=\"wp-image-3661\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco.png?resize=550%2C425&#038;ssl=1\" alt=\"Lycopodium TTL Format\" width=\"550\" height=\"425\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco.png?resize=300%2C232&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco.png?resize=1024%2C792&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco.png?resize=768%2C594&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco.png?w=1412&amp;ssl=1 1412w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-3661\" class=\"wp-caption-text\"><strong>Lycopodium TTL Format<\/strong><\/figcaption><\/figure>\n<p>Then I asked it to do the same for <em><strong>Argentum Nitricum<\/strong><\/em>:<\/p>\n<blockquote><p>\u201cThanks! Please do the same for Arg Nit remedy.\u201d<\/p><\/blockquote>\n<p>As earlier, it generated a <em><strong>TTL<\/strong><\/em> representation corresponding to Argentum Nitricum:<\/p>\n<figure id=\"attachment_3662\" aria-describedby=\"caption-attachment-3662\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/ArgNit.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"3662\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2025\/04\/11\/using-claude-to-generate-rdf-triples\/argnit\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/ArgNit.png\" data-orig-size=\"1628,908\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Arg Nit TTL Format\" data-image-description=\"&lt;p&gt;Arg Nit TTL Format&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Arg Nit TTL Format&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/ArgNit-1024x571.png\" class=\"wp-image-3662\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/ArgNit.png?resize=550%2C307&#038;ssl=1\" alt=\"Arg Nit TTL Format\" width=\"550\" height=\"307\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/ArgNit.png?resize=300%2C167&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/ArgNit.png?resize=1024%2C571&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/ArgNit.png?resize=768%2C428&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/ArgNit.png?resize=1536%2C857&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/ArgNit.png?w=1628&amp;ssl=1 1628w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-3662\" class=\"wp-caption-text\"><strong>Arg Nit TTL Format<\/strong><\/figcaption><\/figure>\n<p>The next challenge was to confirm that the generated information was a valid TTL representation. I used the <em><strong>\u201c<a href=\"http:\/\/ttl.summerofcode.be\" target=\"_blank\" rel=\"noopener\">Turtle Validator<\/a>\u201d<\/strong><\/em>\u00a0to test this. Fortunately, both representations were correct and I was relieved!<\/p>\n<p>How to use the generated <em><strong>TTL<\/strong><\/em> data of the two remedies? As a user of <em><strong>Allegro Common Lisp<\/strong><\/em>, I am familiar with their other excellent product <a href=\"https:\/\/allegrograph.com\" target=\"_blank\" rel=\"noopener\"><em><strong>\u201cAllegroGraph\u201d<\/strong><\/em><\/a>. I have written an <a href=\"https:\/\/www.rangakrish.com\/index.php\/2018\/09\/30\/dependency-graph-to-rdf-part-2\/\" target=\"_blank\" rel=\"noopener\"><em><strong>article <\/strong><\/em><\/a>earlier on this.<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>This time I decided to use their <em><strong>Cloud Hosted<\/strong><\/em> service (Free tier) and created a new account. I then used their <em><strong>\u201cWebView\u201d<\/strong><\/em> to connect to the server and created a new <em><strong>Repository<\/strong><\/em> called <em><strong>\u201cHomeopathy\u201d<\/strong><\/em>. Next, I imported data corresponding to the<span class=\"Apple-converted-space\">\u00a0 <\/span>2 remedies by copy pasting into the <em><strong>Input<\/strong><\/em> area. By default <em><strong>\u201cAuto-detect\u201d<\/strong><\/em> option is enabled in <em><strong>\u201cImport Options\u201d<\/strong><\/em>.<\/p>\n<figure id=\"attachment_3663\" aria-describedby=\"caption-attachment-3663\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco-Import.png?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"3663\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2025\/04\/11\/using-claude-to-generate-rdf-triples\/lyco-import\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco-Import.png\" data-orig-size=\"2466,2044\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Importing TTL Data\" data-image-description=\"&lt;p&gt;Importing TTL Data&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Importing TTL Data&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco-Import-1024x849.png\" class=\"wp-image-3663\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco-Import.png?resize=550%2C456&#038;ssl=1\" alt=\"Importing TTL Data\" width=\"550\" height=\"456\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco-Import.png?resize=300%2C249&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco-Import.png?resize=1024%2C849&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco-Import.png?resize=768%2C637&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco-Import.png?resize=1536%2C1273&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco-Import.png?resize=2048%2C1698&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Lyco-Import.png?w=2340&amp;ssl=1 2340w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-3663\" class=\"wp-caption-text\"><strong>Importing TTL Data<\/strong><\/figcaption><\/figure>\n<p>The <em><strong>Knowledge Graph<\/strong><\/em> repository now contains information about two homeopathy remedies. How can we use this? <em><strong>\u201cSparql\u201d<\/strong><\/em> immediately comes to our mind.<\/p>\n<p>Here is a query for: <em><strong>\u201cWhat are the Mental\/Emotional symptoms of Argentum Nitricum?\u201d<\/strong><\/em><\/p>\n<blockquote>\n<p style=\"padding-left: 40px;\">PREFIX rdf: &lt;http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#&gt;<br \/>\nPREFIX rdfs: &lt;http:\/\/www.w3.org\/2000\/01\/rdf-schema#&gt;<br \/>\nPREFIX homo: &lt;http:\/\/example.org\/homeopathy\/ontology#&gt;<br \/>\nPREFIX remedy: &lt;http:\/\/example.org\/homeopathy\/remedy#&gt;<br \/>\nPREFIX argnit: &lt;http:\/\/example.org\/homeopathy\/remedy\/argentumnitricum#&gt;<\/p>\n<p style=\"padding-left: 40px;\">SELECT ?symptomName ?symptomDescription<br \/>\nWHERE {<br \/>\n?symptom homo:characteristicOf remedy:argentumnitricum ;<br \/>\nrdfs:label ?symptomName ;<br \/>\nhomo:description ?symptomDescription ;<br \/>\nhomo:belongsTo argnit:MentalEmotional .<br \/>\n}<br \/>\nORDER BY ?symptomName<\/p>\n<\/blockquote>\n<p>It is quite easy to run this in <em><strong>AllegroGraph<\/strong><\/em>:<\/p>\n<figure id=\"attachment_3664\" aria-describedby=\"caption-attachment-3664\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query1.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3664\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2025\/04\/11\/using-claude-to-generate-rdf-triples\/query1-4\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query1.png\" data-orig-size=\"2584,1552\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Executing Sparql Query\" data-image-description=\"&lt;p&gt;Executing Sparql Query&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Executing Sparql Query&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query1-1024x615.png\" class=\"wp-image-3664\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query1.png?resize=550%2C330&#038;ssl=1\" alt=\"Executing Sparql Query\" width=\"550\" height=\"330\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query1.png?resize=300%2C180&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query1.png?resize=1024%2C615&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query1.png?resize=768%2C461&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query1.png?resize=1536%2C923&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query1.png?resize=2048%2C1230&amp;ssl=1 2048w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query1.png?w=2340&amp;ssl=1 2340w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><figcaption id=\"caption-attachment-3664\" class=\"wp-caption-text\"><strong>Executing Sparql Query<\/strong><\/figcaption><\/figure>\n<p>Next query: <em><strong>\u201cWhat are the modalities of the remedies?\u201d<\/strong><\/em><\/p>\n<p>Here is the answer:<\/p>\n<figure id=\"attachment_3665\" aria-describedby=\"caption-attachment-3665\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query2.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3665\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2025\/04\/11\/using-claude-to-generate-rdf-triples\/query2-3\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query2.png\" data-orig-size=\"1654,1388\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Query on Modalities\" data-image-description=\"&lt;p&gt;Query on Modalities&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Query on Modalities&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query2-1024x859.png\" class=\"wp-image-3665\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query2.png?resize=500%2C420&#038;ssl=1\" alt=\"Query on Modalities\" width=\"500\" height=\"420\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query2.png?resize=300%2C252&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query2.png?resize=1024%2C859&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query2.png?resize=768%2C644&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query2.png?resize=1536%2C1289&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query2.png?w=1654&amp;ssl=1 1654w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-3665\" class=\"wp-caption-text\"><strong>Query on Modalities<\/strong><\/figcaption><\/figure>\n<p>Third and final question: <em><strong>\u201cWhat are the Mental, Emotional and Digestive symptoms of the remedies?\u201d<\/strong><\/em><\/p>\n<figure id=\"attachment_3666\" aria-describedby=\"caption-attachment-3666\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query3.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3666\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2025\/04\/11\/using-claude-to-generate-rdf-triples\/query3-3\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query3.png\" data-orig-size=\"1648,1772\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Another Query\" data-image-description=\"&lt;p&gt;Another Query&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Another Query&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query3-952x1024.png\" class=\"wp-image-3666\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query3.png?resize=500%2C538&#038;ssl=1\" alt=\"Another Query\" width=\"500\" height=\"538\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query3.png?resize=279%2C300&amp;ssl=1 279w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query3.png?resize=952%2C1024&amp;ssl=1 952w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query3.png?resize=768%2C826&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query3.png?resize=1429%2C1536&amp;ssl=1 1429w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query3.png?w=1648&amp;ssl=1 1648w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2025\/04\/Query3.png?w=1560&amp;ssl=1 1560w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption id=\"caption-attachment-3666\" class=\"wp-caption-text\"><strong>Another Query<\/strong><\/figcaption><\/figure>\n<p><em><strong>AllegroGraph<\/strong><\/em> even supports <em><strong>OpenAI LLM<\/strong> <\/em>Integration, but I did not get into that mode.<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>What I wanted to convey in this article is that <em><strong>LLMs<\/strong><\/em> are capable of generating highly structured data. This particular example is to show that unstructured data can be converted into a <em><strong>Knowledge Graph<\/strong><\/em> and then used appropriately depending on the requirements.<\/p>\n<p>You can <a href=\"https:\/\/www.rangakrish.com\/downloads\/Remedies-TTL.zip\" target=\"_blank\" rel=\"noopener\"><em><strong>download<\/strong><\/em><\/a> the <em><strong>TTL<\/strong><\/em> representations of <em><strong>Lycopodium<\/strong><\/em> and <em><strong>Argentum Nitricum<\/strong><\/em> used in this article.<\/p>\n<p>Have a great Weekend!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We all know that LLMs are now capable of generating structured data. I have used OpenAI models earlier to generate Tables and JSON data, but this time I wanted to try a more complex example.\u00a0 As someone interested in Homeopathy, I wanted to generate remedy descriptions as RDF triples, in particular, Turtle (TTL) format. That [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[22,162],"tags":[419,153,159],"class_list":["post-3660","post","type-post","status-publish","format-standard","hentry","category-homeopathy","category-knowledge-representation","tag-knowledge-graph","tag-rdf","tag-sparql"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9OLnF-X2","jetpack-related-posts":[{"id":1068,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/09\/16\/dependency-graph-to-rdf\/","url_meta":{"origin":3660,"position":0},"title":"Dependency Graph to RDF","author":"admin","date":"September 16, 2018","format":false,"excerpt":"Dependency parsing is widely used these days, and many NLP tools give a dependency graph as the parsed representation of the input text. See for example, SpacY and TextRazor.\u00a0 The following is the dependency tree corresponding to the sentence Mary is drinking cold water: The above tree was generated using\u2026","rel":"","context":"In &quot;Natural Language Processing&quot;","block_context":{"text":"Natural Language Processing","link":"https:\/\/www.rangakrish.com\/index.php\/category\/natural-language-processing\/"},"img":{"alt_text":"Dependency Graph","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/09\/DepGraph.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/09\/DepGraph.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/09\/DepGraph.png?resize=525%2C300 1.5x"},"classes":[]},{"id":1078,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/09\/30\/dependency-graph-to-rdf-part-2\/","url_meta":{"origin":3660,"position":1},"title":"Dependency Graph to RDF &#8211; Part 2","author":"admin","date":"September 30, 2018","format":false,"excerpt":"In the last post, I outlined an approach to convert a dependency graph (the result of dependency parsing) to RDF. The particular RDF format I used is Turtle, which is widely supported. Today, I would like to show how to load this RDF data in a Semantic\u00a0 Graph database and\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"Browser View","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/09\/Checking-the-server.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/09\/Checking-the-server.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/09\/Checking-the-server.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/09\/Checking-the-server.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":3283,"url":"https:\/\/www.rangakrish.com\/index.php\/2023\/12\/26\/homeopathy-case-analysis-using-retrieval-augmented-generation\/","url_meta":{"origin":3660,"position":2},"title":"Homeopathy Case Analysis Using Retrieval-Augmented Generation","author":"admin","date":"December 26, 2023","format":false,"excerpt":"Homeopaths, after detailed case taking, usually \u2018\u201crepertorize\u201d\u00a0 the case using software such as RadarOpus, MacRepertory, Vithoulkas Compass, etc., and finally consult a Materia Medica to confirm the remedy selection. There are some highly experienced homeopaths who have the gift of identifying the correct remedy without even repertorizing the case, but\u2026","rel":"","context":"In &quot;Homeopathy&quot;","block_context":{"text":"Homeopathy","link":"https:\/\/www.rangakrish.com\/index.php\/category\/homeopathy\/"},"img":{"alt_text":"Example Chat","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/12\/Two-300x95.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/12\/Two-300x95.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2023\/12\/Two-300x95.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":90,"url":"https:\/\/www.rangakrish.com\/index.php\/2015\/11\/25\/book-review-homeopathy-through-the-chinese-looking-glass-homeosiniatry-revisited\/","url_meta":{"origin":3660,"position":3},"title":"Book Review &#8211; Homeopathy through the Chinese Looking Glass: Homeosiniatry Revisited","author":"admin","date":"November 25, 2015","format":false,"excerpt":"Title: Homeopathy through the Chinese Looking Glass: Homeosiniatry Revisited Author: Dr. Joe Rozencwajg, NMD, Publisher: Emryss Publishers Year: 2011 Though I had purchased this book a few months ago, I could not finish reading it until last week. Thanks to the heavy rains in Chennai, I got some extra spare\u2026","rel":"","context":"In &quot;Acupuncture&quot;","block_context":{"text":"Acupuncture","link":"https:\/\/www.rangakrish.com\/index.php\/category\/acupuncture\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1613,"url":"https:\/\/www.rangakrish.com\/index.php\/2019\/06\/24\/text-analysis-using-meaningclouds-deep-categorization-api\/","url_meta":{"origin":3660,"position":4},"title":"Text Analysis Using MeaningCloud\u2019s Deep Categorization API","author":"admin","date":"June 24, 2019","format":false,"excerpt":"MeaningCloud\u00a0announced their premium offering \u201cDeep Categorization\u201d service quite recently. You can read about it in this nice blog\u00a0by Blanca Galego. Compared to the canonical classification models that rely on machine learning using large data sets, MeaningCloud\u2019s deep categorization models use hand-crafted rules that take advantage of \u201cmorphosyntactic, semantic and contextual\u2026","rel":"","context":"In &quot;Homeopathy&quot;","block_context":{"text":"Homeopathy","link":"https:\/\/www.rangakrish.com\/index.php\/category\/homeopathy\/"},"img":{"alt_text":"Diarrhoea Example","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/06\/diarrhoea-case-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/06\/diarrhoea-case-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/06\/diarrhoea-case-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2019\/06\/diarrhoea-case-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1109,"url":"https:\/\/www.rangakrish.com\/index.php\/2018\/10\/28\/flora-2-an-expressive-knowledge-representation-system\/","url_meta":{"origin":3660,"position":5},"title":"Flora-2: An Expressive Knowledge Representation System","author":"admin","date":"October 28, 2018","format":false,"excerpt":"I am always on the lookout for a good Knowledge Representation (KR) system that facilitates modeling and reasoning about real-world knowledge. I have experience with\u00a0KnowledgeWorks\u00a0available in LispWorks\u00a0since I have used it in a few projects. I have also taken a cursory look at PowerLoom\u00a0and Racer. Last week, I came across\u2026","rel":"","context":"In &quot;Flora-2&quot;","block_context":{"text":"Flora-2","link":"https:\/\/www.rangakrish.com\/index.php\/category\/flora-2\/"},"img":{"alt_text":"Quitting Flora-2 Session","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/quitting.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/quitting.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2018\/10\/quitting.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/3660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/comments?post=3660"}],"version-history":[{"count":6,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/3660\/revisions"}],"predecessor-version":[{"id":3672,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/3660\/revisions\/3672"}],"wp:attachment":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/media?parent=3660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/categories?post=3660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/tags?post=3660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}