Global Positioning System Reference
In-Depth Information
The combination of nodes, relationships between them, and the
properties of these nodes form a space node, a structured network
representing a graph database.
Figure 2 illustrates an example of data stored in Neo4j. It is possible to
see fi ve identifi ed nodes, their relationships, some properties like “name”,
“address.lat”, “address.lon”, and spatial attributes. In addition, the fi gure
depicts properties in relationships like “knows” that connects the fourth
node to the second node and has the properties “disclosure” and “time”.
Another relationship “knows”, connects the second node to the third node
with the property “disclosure”. The link labeled “knows” represents a direct
relationship that depicts which people know each other. From this example,
it is possible to observe, for instance, that Bob (whose age is unknown) is the
boyfriend of Kate (age 31) and resides in a location where the coordinates
(lat, long) are known, and he also knows Peter (age 52).
The graph shown in Fig. 2 makes it clear that both nodes and
relationships can have different properties. The properties are strings
formed by key/value pairs and their values can be any Java primitive type
or an array of primitive Java types such as int, int [], String, fl oat, fl oat [],
and so on.
name: Cristine
age: 26
address.lat: ‐15.768
address.lon: ‐47.886
name: Paul
age: 23
address.lat: ‐7.865
address.lon: ‐43.882
6
name: Bob
KNOWS
3
where: UFCG
address: Polygon(…)
4
disclosure: public
time: 10 years
GIRLFRIEND
disclosure: secret
KNOWS
STUDY_ WITH
KNOWS
BOYFRIEND
8
2
time: 5 years
key: value
Property
name: Kate
age: 31
address.lat: ‐7.217
address.lon: ‐35.911
name: Peter
age: 52
Node
id
Relationship
type
Fig. 2.
Example of data stored in Neo4j (adapted from Bass 2012).
Neo4j does not support declarative queries. Instead, the search for
information starts from either an initial node that may be provided or an
arbitrary node, and follows the relationships to other nodes that satisfy the
search criteria. This navigation is known as traversing. Neo4j provides an
Search WWH ::
Custom Search