Creating nodes
Time to start storing information as graphs! To begin, you'll create a node to represent the book, Building Knowledge Graphs, a practitioner's guide to creating knowledge graphs in Neo4j.
We have provided a visualize_node()
function to visualize the resulting graph using the matplotlib
library.
Este exercício faz parte do curso
Graph RAG with LangChain and Neo4j
Instruções do exercício
- Create a new node of type
"Book"
with the unique identifierbuilding-knowledge-graphs
.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
from langchain_neo4j.graphs.graph_document import Node
# Create a Book node with a unique identifier
book = ____(
____="____",
____="____",
properties={"title": "Building Knowledge Graphs"}
)
print(book.id, book.type, book.properties['title'])
visualize_node(book)