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?