How to index graphs ? And how to search in graphs?

Hello,
I'm trying to find a way to index a graph.

The idea is :
I have documents like :
{ "name": "apple",
"edges": [
{
"type" : "isA",
"value" : "company"
} ,
{
"type" : "isA",
"value" : "fruit"
}
]
}

or

{ "name": "happy",
"edges": [
{
"type" : "synonym",
"value" : "excited"
} ,
{
"type" : "isA",
"value" : "adjective"
}
]
}

So, as you can see, when I search for the word apple, I have to see the different isA or synonyms relations ...
the object fruit or company also represents a document.

So what is the best way to index all this graph, so it can be easy after this, to search for all the relations for a given word ?

Thank you !

Any help please ?

If you put all the "nyms" (synonym, hypernym etc) into the same elasticsearch doc then it can become harder to run aggregations because each of the nym objects has two properties - type and value. You would need to use nested docs to avoid muddling the type of one nym with that of another (and Kibana doesn't do nested).
The alternative is to have separate docs for each nym so you'd repeat the root term in each doc (eg name:apple) and have a single type and value field to associate a single nym to that root term. You can then use query and aggregate on these docs without resorting to more complex nested structures.

1 Like

So, I think it's not the best way to use elasticSearch to build something like conceptNet.
Because there is no way to have the concept of a document pointing to another document.
I just wanted to use the power of string searching of elasticsearch.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.