Loading…
Glossary term
A network of entities and the relationships between them, used to organize facts.
A knowledge graph stores facts as a network of entities (nodes) and relationships (edges): 'Paris' is the capital of 'France'. Each fact is a triple of subject, relation and object.
It supports precise queries and reasoning, and can supply structured facts to language models.
Facts as triples
triples = [
("Paris", "capital_of", "France"),
("France", "located_in", "Europe"),
]
print([s for s, r, o in triples if o == "France"]) # ['Paris']Graphs organize facts explicitly, which helps with accuracy and traceability, complementing the fuzzy knowledge inside models.