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.
Latihan ini merupakan bagian dari kursus
Graph RAG with LangChain and Neo4j
Instruksi latihan
- Create a new node of type
"Book"with the unique identifierbuilding-knowledge-graphs.
Latihan interaktif langsung praktik
Cobalah latihan ini dengan melengkapi kode contoh ini.
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)