Rasa Knowledge graph query

Thanks for your help @Tanja .

I am having issues querying the knowledge graph db. I created a small demo to begin pulling entity types and their attributes. You can see the full repo her

How it works: I have entity type: dog and entity type: need

dog has an attribute: ‘dog-name’ value ‘German Shepard’

need has an attribute ‘condition’ with a value ‘protection’

If someone in rasa says: I would like a dog for protection(condition). I would like to query the knowledge graph, and return the value “German Shepard”(dog-name) to the user.

When I try this, I run into the following message:

    `File "/Users/skylacking/Desktop/makegraphwork/getdoggy/actions.py", line 245, in run
    entity_type = get_entity_type(tracker)
  File "/Users/skylacking/Desktop/makegraphwork/getdoggy/actions.py", line 44, in get_entity_type
    return graph_database.map("entity-type-mapping", entity_type)
  File "/Users/skylacking/Desktop/makegraphwork/getdoggy/graph_database.py", line 534, in map
    and mapping_key in self.entity_type_mapping
AttributeError: 'GraphDatabase' object has no attribute 'entity_type_mapping'
127.0.0.1 - - [2019-09-17 01:15:51] "POST /webhook HTTP/1.1" 500 411 0.024520`
1 Like

We recently add Knowledge Base Actions to Rasa. The actions do a lot of stuff required to query a knowledge base for you. If you just want to query certain dog names, it might be a good idea using it as you don’t have to implement everything from scratch.

The error indicates that your graph database does not contain an entity_type_mapping table. As you are using grakn, you can use Grakn Workbase | GRAKN.AI to visualize your schema and check what data is actually inside the DB. Can you check if entity_type_mapping exists and what data points are in there?

@Tanja, Thanks so much for your last response regarding merging Rasa with GraphDB (through linkdin discussion) Now, I have couples of questions for integrating a Graph DataBase with RASA. I wat to transfer intents to GraphDB and based on intent classification of RASA going through to find suitable actions. I mean I need to transfer all related data for the process as objects in Graph and use RASA to make conversation, Could you please guide me how can I design stories and slots in GraphDB based on conversation patterns that was already defined in RASA?? Thanks a lot