A knowledge base is an organized store of facts about a domain or the world. NLP systems can populate one from text and use it to interpret statements, retrieve information, and support decisions. section 1.12 section 1.8
A graph representation connects entities through relationships. Queries can follow several relations and derive facts that are not explicitly stored; this process is knowledge graph inference. section 11.8
A knowledge base supports several practical operations:
- Store entities, relationships, conversation history, user information, and general world knowledge. section 1.8
- Answer questions that require multiple hops across relations, such as deriving a person’s military rank from connected facts. section 11.8
- Retrieve graph facts with languages such as SPARQL, Cypher, or AQL. section 11.9
Querying Wikidata
Wikidata supplies entities with Q-identifiers and relationships with P-identifiers. A Python client can resolve Timnit Gebru’s Q-id, use SPARQL to find a notable scholarly article, and retrieve its authors: Timnit Gebru, Margaret Mitchell, and Emily M. Bender. section 11.9
Figure 11.4 Stanislav’s knowledge graph
Inspect the connected entities and relationships used to infer Stanislav’s military rank. section 11.8
Knowledge bases improve interpretation but are not always required: chatbots can still produce useful behavior with upper-layer NLP algorithms, search, or string matching alone. section 1.9









