liveBook · Manning

Graph database

As explained in Graph Algorithms for Data Science

A graph database is a database designed to store and query entities and their relationships directly.

A graph database stores data as nodes and relationships so that connections are first-class parts of the model. Nodes can represent people, companies, cities, concepts, ideas, or words; relationships represent links such as friendships, software dependencies, or other meaningful connections. section 1.0

This model suits highly connected, variable data. Rather than repeatedly joining tables or using recursive operations to follow a chain, a graph database emphasizes connected queries such as finding friends several steps away. Its flexible schema can also accommodate real-world variation and outliers as business needs evolve. section 1.0

Figure 1.4 A graph model representing a Lessons Learned record as a graph
01-04

Compare a record-oriented view with a graph model: one lesson can become a node connected to the people, topics, and other information needed for exploration. section 1.0

A practical graph-database workflow is to:

  • Identify a graph-shaped problem and decide which entities should become nodes and which connections should become relationships. section 2.0
  • Import the dataset into a labeled-property graph, the graph model used for the practical modeling path. section 2.0
  • Query the graph with Cypher to retrieve patterns, traverse connections, aggregate results, and explore the data. section 2.0
  • Use the resulting graph for graph algorithms, inferred networks, or graph machine learning when those analyses fit the question. section 2.0

Building a graph from text

An NLP pipeline can turn unstructured text into graph data. After resolving references and recognizing entities, relation extraction can produce triples such as Jon–WORKS_AT–W3C and Jon–RESIDES–Bahamas. Storing those relationships in a graph database makes them available for querying, visualization, pattern finding, node classification, or link prediction. section 12.0

Figure 12.1 Extracting structured information from text and using it to construct a graph
12-01

Use the pipeline diagram to trace how text becomes extracted entities and relationships, then becomes a queryable graph. section 12.0

How Graph Algorithms for Data Science covers it

How deep it goes
Introduces graph storage and modeling, then defers graph algorithms and machine learning to later milestones.
Examples
Uses NASA Lessons Learned records, a Twitter social network, and extracted Jon–WORKS_AT–W3C and Jon–RESIDES–Bahamas triples.
What you can do after
Evaluate/understand when relationship-heavy data benefits from graph modeling and connected queries.
How it connects
Connects nodes, relationships, labeled-property graphs, Cypher, graph algorithms, natural language processing, node classification, and link prediction.

Also explained in

Compare how 4 books explain graph database →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Algorithms for Data Science. The section links point to the parts of the book it draws on.