Learn R Programming

RNeo4j (version 1.6.4)

getLabeledNodes: Retrieve Nodes by Label and Property

Description

Retrieve nodes from the graph with the specified label and optional key = value pair.

Usage

getLabeledNodes(graph, .label, ...)

Arguments

graph
A graph object.
.label
A character string.
...
A named list. A key = value pair to search the labeled nodes.

Value

A list of node objects.

See Also

getUniqueNode

Examples

Run this code
## Not run: 
# graph = startGraph("http://localhost:7474/db/data/")
# clear(graph)
# 
# createNode(graph, "School", name = "University of Texas at Austin")
# createNode(graph, "School", name = "Louisiana State University")
# 
# createNode(graph, "Person", name = "Nicole", status = "Employed")
# createNode(graph, "Person", name = "Drew", status = "Employed")
# createNode(graph, "Person", name = "Aaron", status = "Unemployed")
# 
# schools = getLabeledNodes(graph, "School")
# 
# sapply(schools, function(s) s$name)
# 
# employed_people = getLabeledNodes(graph, "Person", status = "Employed")
# 
# sapply(employed_people, function(p) p$name)
# ## End(Not run)

Run the code above in your browser using DataLab