35.1 What Is a Knowledge Graph?
A knowledge graph represents information as a network of entities (nodes) and their relationships (edges), providing a structured, semantic representation of domain knowledge.
Core components:
- Entities (Nodes) — real-world objects or concepts (Person, Organization, Product, Service, Alert)
- Relationships (Edges) — semantic connections between entities (
WORKS_FOR,DEPENDS_ON,TRIGGERS) - Properties/Attributes — key-value metadata on nodes and edges (name, timestamp, confidence_score)
- Labels/Types — categorization of nodes and edges (
Person:Employee,DEPENDS_ON:Runtime)
35.2 RDF vs. Labeled Property Graphs (LPG)
| Feature | RDF (Resource Description Framework) | Labeled Property Graph (LPG) |
|---|---|---|
| Data model | Subject-predicate-object triples | Nodes and edges with properties |
| Query language | SPARQL | Cypher (Neo4j), Gremlin (TinkerPop) |
| Schema | OWL/RDFS ontologies | Flexible, schema-optional |
| Standards | W3C standard | Vendor-specific (Neo4j, TigerGraph, etc.) |
| Best for | Linked open data, semantic web, knowledge federation | Application-specific graphs, real-time traversals |
| Performance | Complex joins/reasoning can be slow | Optimized for graph traversals |
| Interoperability | High (standard format) | Lower (vendor lock-in risk) |
Recommendation for enterprise AI: use LPG (e.g., Neo4j) for application-specific knowledge graphs where traversal performance and developer ergonomics matter most; use RDF when you need to federate knowledge across organizational boundaries or interoperate with standards-based semantic-web tooling.
Section 35 — Interview Q&A
Q1: When would you choose RDF over a labeled property graph for an enterprise knowledge graph? Choose RDF when interoperability across organizational or system boundaries matters more than traversal performance — e.g., publishing a shared ontology that multiple independent systems must consume via a standard (SPARQL, OWL), or when regulatory/standards compliance requires a W3C-standard representation. Choose LPG for the far more common enterprise case: an application-specific graph that needs fast, expressive multi-hop traversal and a flexible, evolving schema, where vendor lock-in is an acceptable trade for developer productivity and query performance.
Q2: What are the core building blocks of a knowledge graph, and why does the “properties on edges” capability matter?
Nodes, edges, properties, and labels/types. Properties on edges (not just nodes) matter because real relationships carry metadata that changes the answer to a query — e.g., a DEPENDS_ON edge with criticality: high, protocol: gRPC, latency_p99: 45ms lets you answer “which critical dependencies exist” rather than just “which dependencies exist,” which is the difference between a toy graph and one that supports real operational decisions.