@@ -4,11 +4,10 @@ Graph Data Types
44
55Cypher queries can return entire graph structures as well as individual property values.
66
7- , The graph types model graph data returned from a Cypher query.
7+ The graph data types detailed here model graph data returned from a Cypher query.
88Graph values cannot be passed in as parameters as it would be unclear whether the entity was intended to be passed by reference or by value.
99The identity or properties of that entity should be passed explicitly instead.
1010
11- All graph values returned within a given :class: `.StatementResult ` are contained within a :class: `.Graph ` instance, accessible via :meth: `.StatementResult.graph `.
1211The driver contains a corresponding class for each of the graph types that can be returned.
1312
1413============= ======================
@@ -19,22 +18,149 @@ Relationship :class:`.Relationship`
1918Path :class: `.Path `
2019============= ======================
2120
22- .. autoclass :: neo4j.types.graph.Graph
23- :members:
21+ .. class :: neo4j.types.graph.Graph
2422
25- .. autoclass :: neo4j.types.graph.Entity
26- :members:
23+ A local, self-contained graph object that acts as a container for :class: ` .Node ` and :class: ` .Relationship ` instances.
24+ This is typically obtained via the :meth: ` .BoltStatementResult.graph ` method.
2725
28- .. autoclass :: neo4j.types.graph.EntitySetView
29- :members:
26+ .. autoattribute :: nodes
3027
31- .. autoclass :: neo4j.types.graph.Node
32- :members:
33- :inherited-members:
28+ .. autoattribute :: relationships
3429
35- .. autoclass :: neo4j.types.graph.Relationship
36- :members:
37- :inherited-members:
30+ .. automethod :: relationship_type
3831
39- .. autoclass :: neo4j.types.graph.Path
40- :members:
32+
33+ .. class :: neo4j.types.graph.Node
34+
35+ .. describe :: node == other
36+
37+ Compares nodes for equality.
38+
39+ .. describe :: node != other
40+
41+ Compares nodes for inequality.
42+
43+ .. describe :: hash(node)
44+
45+ Computes the hash of a node.
46+
47+ .. describe :: len(node)
48+
49+ Returns the number of properties on a node.
50+
51+ .. describe :: iter(node)
52+
53+ Iterates through all properties on a node.
54+
55+ .. describe :: node[key]
56+
57+ Returns a node property by key.
58+ Raises :exc: `KeyError ` if the key does not exist.
59+
60+ .. describe :: key in node
61+
62+ Checks whether a property key exists for a given node.
63+
64+ .. autoattribute :: graph
65+
66+ .. autoattribute :: id
67+
68+ .. autoattribute :: labels
69+
70+ .. automethod :: get
71+
72+ .. automethod :: keys
73+
74+ .. automethod :: values
75+
76+ .. automethod :: items
77+
78+
79+ .. class :: neo4j.types.graph.Relationship
80+
81+ .. describe :: relationship == other
82+
83+ Compares relationships for equality.
84+
85+ .. describe :: relationship != other
86+
87+ Compares relationships for inequality.
88+
89+ .. describe :: hash(relationship)
90+
91+ Computes the hash of a relationship.
92+
93+ .. describe :: len(relationship)
94+
95+ Returns the number of properties on a relationship.
96+
97+ .. describe :: iter(relationship)
98+
99+ Iterates through all properties on a relationship.
100+
101+ .. describe :: relationship[key]
102+
103+ Returns a relationship property by key.
104+ Raises :exc: `KeyError ` if the key does not exist.
105+
106+ .. describe :: key in relationship
107+
108+ Checks whether a property key exists for a given relationship.
109+
110+ .. describe :: type(relationship)
111+
112+ Returns the type (class) of a relationship.
113+ Relationship objects belong to a custom subtype based on the type name in the underlying database.
114+
115+ .. autoattribute :: graph
116+
117+ .. autoattribute :: id
118+
119+ .. autoattribute :: nodes
120+
121+ .. autoattribute :: start_node
122+
123+ .. autoattribute :: end_node
124+
125+ .. autoattribute :: type
126+
127+ .. automethod :: get
128+
129+ .. automethod :: keys
130+
131+ .. automethod :: values
132+
133+ .. automethod :: items
134+
135+
136+ .. class :: neo4j.types.graph.Path
137+
138+ .. describe :: path == other
139+
140+ Compares paths for equality.
141+
142+ .. describe :: path != other
143+
144+ Compares paths for inequality.
145+
146+ .. describe :: hash(path)
147+
148+ Computes the hash of a path.
149+
150+ .. describe :: len(path)
151+
152+ Returns the number of relationships in a path.
153+
154+ .. describe :: iter(path)
155+
156+ Iterates through all the relationships in a path.
157+
158+ .. autoattribute :: graph
159+
160+ .. autoattribute :: nodes
161+
162+ .. autoattribute :: start_node
163+
164+ .. autoattribute :: end_node
165+
166+ .. autoattribute :: relationships
0 commit comments