Neo4j Graph Database Fundamentals · Ders

Düğümler, İlişkiler ve Özellikler

Bir grafın yapı taşlarını anlayın: varlıkları, bağlantıları ve onları açıklayan öznitelikleri temsil eden düğümler, ilişkiler ve özellikler.

1. ders / 411 adım

Düğümler, İlişkiler ve Özellikler, CoddyKit'te ücretsiz bir Neo4j Graph Database Fundamentals dersidir. Bu, 4 dersinin 1. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Neo4j Graph Database Fundamentals öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Neo4j Graph Database Fundamentals kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Graph Building Blocks

Welcome to Cypher Fundamentals! To query a graph database like Neo4j, you first need to understand its core components.

Think of graphs as powerful ways to model real-world connections. They are built from three main elements:

  • Nodes: Your entities or 'things'
  • Relationships: How those 'things' are connected
  • Properties: Descriptors for nodes and relationships

Nodes: The Nouns of Your Graph

Nodes are the fundamental entities in your graph. They represent real-world objects, people, places, or concepts.

For example, in a social network, 'Alice' or 'New York' would be nodes. In an e-commerce graph, 'Product A' or 'Customer B' would be nodes.

Nodes can have labels to categorize them, like 'Person' or 'City'.

Node Labels: Categorize Your Data

Labels classify nodes into groups. A node can have one or more labels. This helps you organize and query your graph efficiently.

For example, a node representing 'Alice' might have the label :Person. A node for 'Neo4j' might have the label :Database.

Let's create a simple node with a label:

CREATE (:Person {name: 'Alice'})

Properties: Descriptive Attributes

Properties are key-value pairs that describe nodes or relationships. They store specific details about an entity or connection.

For a :Person node, properties could be name: 'Alice', age: 30, or city: 'London'. For a :Product node, properties might be price: 19.99 or category: 'Electronics'.

Here's how to create a node with multiple properties:

CREATE (:Movie {
  title: 'Inception',
  releaseYear: 2010,
  genre: 'Sci-Fi'
})

Relationships: Connecting the Dots

Relationships define how nodes are connected to each other. They are the 'verbs' of your graph, showing interactions or associations.

Unlike relational tables where connections are implicit via foreign keys, graph relationships are explicit, first-class citizens.

Relationships always have a type and a direction.

Relationship Types: What's the Link?

Every relationship has a type, which describes the nature of the connection. For instance, 'FRIENDS_WITH', 'ACTED_IN', or 'OWNS'.

Relationship types are crucial for understanding and querying your graph. They help you specify exactly what kind of connection you're looking for.

Let's create two nodes and connect them with a relationship:

CREATE (p1:Person {name: 'Bob'})
CREATE (p2:Person {name: 'Charlie'})
CREATE (p1)-[:FRIENDS_WITH]->(p2)

Relationship Direction Matters

Relationships are directional, meaning they flow from one node to another. This direction is important for understanding the context of the connection.

  • (Alice)-[:LIKES]->(Bob): Alice likes Bob
  • (Bob)-[:LIKES]->(Alice): Bob likes Alice

The arrows --> and <-- indicate direction. If direction isn't specified (--), the relationship is considered undirected in a query, but it's always stored with a direction.

Properties on Relationships Too!

Just like nodes, relationships can also have properties. These properties describe the relationship itself, not the connected nodes.

For example, a [:WORKS_FOR] relationship might have a startDate: '2020-01-15' property. A [:RATED] relationship could have a score: 5 property.

Here's an example of adding properties to a relationship:

CREATE (u:User {name: 'Eve'})
CREATE (p:Product {id: 'P123'})
CREATE (u)-[:PURCHASED {
  date: '2023-10-26',
  quantity: 2
}]->(p)

Visualizing a Graph Pattern

Let's see how these components look together in a simple graph structure. Imagine a person reviewing a movie:

(Person)-[:REVIEWED {rating: 4}]->(Movie)

Here:

  • (Person) and (Movie) are nodes, with their respective labels.
  • [:REVIEWED] is the relationship type, showing direction.
  • {rating: 4} is a property on the REVIEWED relationship.

This structure is incredibly flexible for modeling complex domains!

Check Your Understanding

What are the three fundamental building blocks of a graph database like Neo4j?

Recap: Graph Essentials

Great job! In this lesson, you learned about the foundational elements of a graph database:

  • Nodes are your entities, categorized by labels.
  • Relationships connect nodes, defined by a type and direction.
  • Properties are key-value pairs that add descriptive details to both nodes and relationships.

Understanding these concepts is key to building and querying powerful graph models. Next, we'll dive deeper into creating actual data using Cypher's CREATE clause!

Başlamak ücretsiz

Yapay zeka eğitmeniyle Neo4j Graph Database Fundamentals öğren — ücretsiz

Tarayıcında gerçek kod yaz ve çalıştır, 7/24 yapay zeka eğitmeninden anında yardım al; web'de ya da uygulamada kaldığın yerden devam et.

Kurslar
12
Dersler
48

Sıkça Sorulan Sorular

“Düğümler, İlişkiler ve Özellikler” dersi ücretsiz mi?

Evet — “Düğümler, İlişkiler ve Özellikler” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Neo4j Graph Database Fundamentals kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Neo4j Graph Database Fundamentals kursu toplamda 4 dersten oluşur.

“Düğümler, İlişkiler ve Özellikler” dersinde ne öğreneceğim?

Bir grafın yapı taşlarını anlayın: varlıkları, bağlantıları ve onları açıklayan öznitelikleri temsil eden düğümler, ilişkiler ve özellikler. Neo4j Graph Database Fundamentals ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Neo4j Graph Database Fundamentals öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Neo4j Graph Database Fundamentals, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 1. dersidir.

“Düğümler, İlişkiler ve Özellikler” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Neo4j Graph Database Fundamentals dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Neo4j Graph Database Fundamentals dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Düğümler, İlişkiler ve Özellikler
  2. Cypher CREATE ile Veri Oluşturma
  3. Cypher MATCH ile Kalıpları Eşleştirme
  4. RETURN ile Sonuçları Döndürme ve Şekillendirme
← Neo4j Graph Database Fundamentals Sayfasına Dön