關於neo4j初入門(1)

2022-03-30 11:43:47 字數 1559 閱讀 5231

圖形資料庫也稱為圖形資料庫管理系統或gdbms。

neo4j的官方**:

關係應該是定向的

訪問neo4j通過使用http:// localhost:7474 /

create (:) 節點名稱。節點標籤名稱

create (

:)總結: 節點 標籤 屬性

match 

( :)

return 

.,........

.不能單獨使用match或return命令,因此我們應該合併這兩個命令

match (dept: dept)

return dept.deptno,dept.dname

dept是節點名稱

這裡dept是乙個節點標籤名

deptno是dept節點的屬性名稱

dname是dept節點的屬性名

create (e:customer)
create (cc:creditcard)
match (e:customer)

return e.id,e.name,e.dob

match (cc:creditcard)

return cc.id,cc.number,cc.cvv,cc.expiredate

neo4j關係被分為單向關係、雙向關係

neo4j僅支援兩個節點之間的單個關係型別。

create (google1:googleplusprofile)
create (::.....:)多個標籤到節點

例如create (m:movie:cinema:film:picture)

單個標籤到關係
create (:)-

[(:)]

->(:)

舉例
create (p1:profile1)-[r1:likes]->(p2:profile2)
這裡p1和profile1是節點名稱和節點標籤名稱「from node」

p2和profile2是「to node」的節點名稱和節點標籤名稱、r1是關係名稱、likes是乙個關係標籤名稱

過濾match查詢的結果。

where
where 

and or not xor

match (emp:employee) 

where emp.name = 'abc' or emp.name = 'xyz'

return emp

match (:),(:) 

where create ()-[:{}]->()

例子

match (cust:customer),(cc:creditcard)

where cust.id = "1001" and cc.id= "5001"

create (cust)-[r:do_shopping_with]->(cc)

return r

Neo4j入門教程 1

neo4j資料庫是一種圖形資料庫 不知道這麼翻譯準不准,暫且這麼稱呼吧 這種資料庫與傳統的關係型資料庫有很大的差別。為了更好地幫助大家理解我這裡就將關係型資料庫與圖形資料庫作個比較。關係型資料庫 我們常用的像mysql,oracle等都是關係型資料庫,在關係型資料庫裡面對資料的處理是這樣子的 對每個...

Neo4j入門教程 1

neo4j 資料庫是一種圖形資料庫 不知道這麼翻譯準不准,暫且這麼稱呼吧 這種資料庫與傳統的關係型資料庫有很大的差別。為了更好地幫助大家理解我這裡就將關係型資料庫與圖形資料庫作個比較。關係型資料庫 我們常用的像 mysql oracle 等都是關係型資料庫,在關係型資料庫裡面對資料的處理是這樣子的 ...

Neo4j學習(2) Win系統安裝Neo4j

neo4j 是目前最流行的圖形資料庫,支援完整的事務,在屬性圖中,圖是由頂點 vertex 邊 edge 和屬性 property 組成的,頂點和邊都可以設定屬性,頂點也稱作節點,邊也稱作關係,每個節點和關係都可以由乙個或多個屬性。neo4j建立的圖是用頂點和邊構建乙個有向圖,其查詢語言cypher...