# Rasa Knowledge graph query

**URL:** <https://forum.rasa.com/t/rasa-knowledge-graph-query/15756>\
**Category:** Rasa Open Source\
**Created:** [September 17, 2019, 8:51am UTC](https://forum.rasa.com/t/rasa-knowledge-graph-query/15756 "2019-09-17T08:51:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![skylacking](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/skylacking/32/4836_2.png) [@skylacking](https://forum.rasa.com/u/skylacking)\
**Post date:** [September 17, 2019, 8:51am UTC](https://forum.rasa.com/t/rasa-knowledge-graph-query/15756/1 "2019-09-17T08:51:17Z")

</div>

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`
```

---

<div class="post-metadata">

**Author:** ![Tanja](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tanja/32/4696_2.png) [@Tanja](https://forum.rasa.com/u/Tanja)\
**Post date:** [September 17, 2019, 9:38am UTC](https://forum.rasa.com/t/rasa-knowledge-graph-query/15756/2 "2019-09-17T09:38:33Z")

</div>

We recently add [Knowledge Base Actions](https://rasa.com/docs/rasa/core/knowledge-bases/) 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](https://dev.grakn.ai/docs/workbase/overview) 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?

---

<div class="post-metadata">

**Author:** ![Sara\_TN](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@Sara\_TN](https://forum.rasa.com/u/Sara_TN)\
**Post date:** [October 21, 2020, 8:51pm UTC](https://forum.rasa.com/t/rasa-knowledge-graph-query/15756/5 "2020-10-21T20:51:43Z")

</div>

@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
