Message Boards Message Boards

Developing an NLP UI for an OWL Knowledge Graph

First, I'm a total noob with Wolfram so apologies in advance if this is a dumb question. I have a bunch of data for the domain of the UN Sustainable Development Goals in an OWL knowledge graph. I see that Wolfram can import data in Turtle or RDF/XML, both of which are natural export formats for the graph. It has information such as what Non-governmental Organizations (NGOs) are working on various UN Sustainable Development Goals. What I would like to to is to import the data and then use the Wolfram LLM so that users (e.g., an economist at the UN) can ask questions like "Which NGOs in India are working on eliminating poverty?" and get appropriate answers. Are there any tutorials or examples that are similar and would give me a head start? Also, it doesn't have to be an example using Turtle or RDF/XML. That would be the best format because it would preserve the most info but I can easily export most of the data to more common formats like CSV files and preserve most of the information.

Thanks in advance for any help.
Michael DeBellis
https://www.michaeldebellis.com/blog

POSTED BY: Michael DeBellis
2 Replies

(It would be helpful if you provided an example Turtle/RDF file and some relevant example questions)

You might consider using the LLM prompt to generate a SPARQL query (as in https://apex974.com/articles/chatgpt-for-info-retrieval-from-knowledge-graph) which you then apply using the various Mathematica SPARQL commands (https://reference.wolfram.com/language/GraphStore/guide/SPARQLQuery.html)

POSTED BY: Joshua Schrier

First, thanks for the links. I'm unable to attach a Turtle (ttl) file. It says that format is not supported so I changed the extension to "txt" but the attached demo ontology is a ttl file. This is just a small file I use for demos, the actual files would be too large to attach but here is a link to a larger file: DaanMatch Knowledge Graph on Github This is work in progress so there is more data we plan to add. But examples of the questions we would like to ask are:

Which NGOs have done projects in Andhra Pradesh with the goal of gender equality?

Which NGOs located within 100 miles of Hyderabad have the goal of eliminating poverty?

Those seem like pretty straight forward questions because there are already links in the ontology that answer them (in the demo ontology the answer may just be none but hopefully the idea is clear). On a more ambitious note, right now we are doing simple text pattern matching between keywords that describe the UN SDG Goals and the mission, vision, and objectives of the NGOs to create the property values linking an NGO to specific UN SDG goals that the NGO focuses on. I was hoping that the LLM would be able to replace that because for the finer grained Targets and Indicators the basic text matching isn't as accurate. So a question might be:

Based on their objectives, mission, and vision which NGOs have a budget of less than 10 million rupees, provide services for Andhra Pradash and are working on SDG Target 5.2? (Where the LLM would compare the description text for Target 5.2 with the listed properties for the SDGs in the geographic region)

POSTED BY: Michael DeBellis
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract