Building a knowledge graph from your data
In a few words, a knowledge graph is a conceptual map of entities and relations between them. Imagine Alice and Bob are friends, then Alice and Bob are entities while their friendship is the relation between them.
The more meaningful your entities and relations are, the more interesting queries can be asked to the knowledge graph. For example, given Alice and Trudy, are they related somehow? We can then discover Trudy is also Bob's friend and also studied in the same school as Alice.
These are dummy examples but with real data, the use cases are really powerful.
However, graphs are hard and costly and finding this kind of relations efficiently can be challenging too.
Out of the box knowledge graph
Nuclia's processing engine extracts by default entities and relations from your data and stores them in your own knowledge graph. Automatic entity extraction is done directly from your data, for example from a sentence like "Alice is a friend of Bob". But also from your metadata, the collaborators of this resource are John and Anna, this resource is labeled with X and Y...
Customizing your knowledge graph
Nuclia API allows users to extend their knowledge graph in two different ways: Entities API and resource metadata. The first one allows you to manage entities at a Knowledge Box level while the second denotes entities inside a resource.
Entities API
Semantically, entities can be classified in groups. Alice is a person, while my cat is an animal. That's why every entity in your knowledge graph will belong to an entities group.
Nuclia's Entities API allows you to manage entities groups and their entities. Add new entities, express synonym relations (Trudy's friends call her Tru) or delete entities or relations we don't need/want.
Resource metadata
You can define your own entities per field using resource’s
fieldmetadata.token
. A token is not more than the portion of text representing
an entity. A token definition include its class/group and its position inside
the text.
Entity suggestion
The /suggest
endpoint is powered by NucliaDB knowledge graph index. Any new
entities added to your knowledge graph will appear as suggestions (with the
proper query).
You can find more information about suggest endpoint in its own section
Relation search
As explained in search, the knowledge graph can be queried using
/search
endpoint with features=relations
.
When enabled, entities will be extracted automatically from your queries and
searched through your knowledge graph. The response will include relations
, a
subgraph of the entities detected and its closest relations.