Video lessons are designed for content that benefits from visual demonstration, such as live coding, complex processes, or building learner confidence.
Configuration
Example from neo4j-fundamentals course:
= What is Neo4j?
:type: video
:order: 1
:image-path: images
[.video]
video::EhwYM5E0S3c[youtube,width=560,height=315]
[.transcript]
== Understanding graph databases
Neo4j is a graph database that stores data in a graph structure.
Data is stored as nodes and relationships instead of tables or documents.
Graph databases are particularly useful when _the connections between data are as important as the data itself_.
In this lesson, you will learn about graphs and the elements that make up a Neo4j graph database.
A graph shows how objects are related to each other.
image::{image-path}/large-social-graph.jpg[A large graph showing circles connected to each other by lines]
The objects are referred to as *nodes* (vertices) connected by *relationships* (edges).
Neo4j uses the graph structure to store data and is known as a *labeled property graph*.
=== How Neo4j organizes data
Neo4j stores and organizes data using these four elements:
* *Nodes* - The fundamental entities in the graph
* *Relationships* - The connections between nodes
* *Labels* - Categories or types for nodes
* *Properties* - The attributes of nodes and relationships
==== Nodes
*Nodes* are the circles in a graph. They represent _objects_ or _entities_ in your data model.
Imagine a social network, the entities (e.g. people, locations, companies) would be represented by nodes.
image::{image-path}/michael-neo4j-sweden.svg[Three nodes representing Michael, Neo4j, and Sweden]
Each entity would be stored as a separate node in the graph.
==== Labels
Nodes are grouped by or categorized using *labels*.
Labels describe what the nodes are, for example, `Person`, `Company`, `Location`.
image::{image-path}/node-labels.svg[Michael and Sarah nodes with a Person label, Neo4j with a Company label, Sweden with a Location label]
Nodes of the same type would have the same label.
Labels allow you to distinguish between different types of nodes and filter the graph.
Nodes can have multiple labels, for example, Michael is a `Person` and could also be an `Employee`.
image::{image-path}/multiple-labels.svg[Michael nodes with 2 labels, Person and Employee]
[TIP]
.Using effective node labels
====
Nodes typically represent things, and should be given a singular noun label. For example, `Product`, `Event`, `Account`.
====
==== Relationships
*Relationships* are the lines in the graph.
Relationships describe how nodes within the graph are connected to each other.
image::{image-path}/michael-neo4j-sweden-rel.svg[Displaying a WORKS_AT relationship between Michael and Neo4j and a FOUNDED_IN relationship between Neo4j and Sweden]
A relationship in Neo4j connects two nodes, referred to as the *start* and *end* nodes.
All relationships have:
* a *type* - `WORKS_AT`, `FOUNDED_IN`.
* a *direction* - Michael `WORKS_AT` Neo4j, Neo4j doesn't work at Michael.
Nodes can have multiple relationships to other nodes.
Multiple relationships can be used to describe bi-directional relationships.
In this example, two `LOVES` relationships are used to describe the status between Michael and Sarah.
image::{image-path}/michael-loves-sarah.svg[Michael and Sarah connected by 2 LOVES relationship Michael to Sarah and Sarah to Michael]
You cannot assume that just because Michael loves Sarah, Sarah loves Michael back!
[TIP]
.Use verbs for relationship types
====
You can use a relationship to represent:
* A personal connection - `Person KNOWS Person`, `Person MARRIED_TO Person`.
* A fact - `Person LIVES_IN Location`, `Person OWNS Car`, `Person RATED Movie`.
* A hierarchy - `Parent PARENT_OF Child`, `Software DEPENDS_ON Library`.
* Any type of connection between 2 entities - `Entity CONNECTED_TO Entity`.
====
==== Properties
You can store data against nodes and relationships as properties.
Properties are named key, value pairs; for example _firstName_, _lastName_, and _position_.
image::{image-path}/node-properties.svg[Properties shown against nodes and relationships]
Nodes and relationships can have any number of properties, and those of the same type do not have to have the same properties (i.e. Neo4j is schemaless).
Properties have a type (integer, boolean, string, list, etc) and can be unique identifiers (keys) for specific node labels.
[.quiz]
== Check your understanding
:leveloffset: +1
[.question]
= Data in Neo4j
Data within Neo4j is stored and organized using which of the following? (Select all that apply)
* [x] Nodes
* [x] Relationships
* [x] Labels
* [x] Properties
[TIP,role=hint]
.Hint
====
Nodes and relationships are the fundamental elements of a graph database.
Labels categorize nodes, and properties store data within nodes and relationships.
====
[TIP,role=solution]
.Solution
====
Data within Neo4j is stored and organized using *nodes*, *relationships*, *labels*, and *properties*.
====
:leveloffset!:
[.summary]
In this lesson, you learned that Neo4j stores and organizes data as a graph using nodes, labels, relationships, and properties.
In the next lesson, you will learn how to apply graph thinking to solve real-world problems.Required Attributes
-
:type: video - Identifies this as a video lesson
-
:order: - Numeric order within the module
-
Title - Level 1 heading describing the content
Required Sections
-
[.video] - Section containing the video embed
-
[.transcript] - Written version of the video content
Video Embedding
GraphAcademy supports YouTube videos using the video directive:
video::VIDEO_ID[youtube,width=560,height=315]Replace VIDEO_ID with the YouTube video identifier.
Best Practices
-
Keep videos under 5 minutes when possible
-
Provide complete transcripts for accessibility
-
Include timestamps for key sections in long videos
-
Use high-quality audio and clear visuals
-
Add supplementary content after the transcript
-
Test video playback before publishing
Transcripts
Transcripts should:
-
Match the video content closely
-
Be formatted for easy reading (headings, paragraphs, lists)
-
Include code examples shown in the video
-
Provide links mentioned in the video
Summary
In this lesson, you learned about video lessons in GraphAcademy.
Video lessons require :type: video, a [.video] section with embedded video, and a [.transcript] section with written content.