vfb_neo4j_query: Query VFB's Neo4J graph database

Description Usage Arguments Details Value References See Also Examples

View source: R/vfb_query.R

Description

Query VFB's Neo4J graph database

Usage

1
2
3
4
5
6
vfb_neo4j_query(
  x,
  ...,
  path = "db/data",
  server = getOption("vfbr.server.neo4j")
)

Arguments

x

A character query in Neo4J's cypher language

...

Additional query arguments of the form key=value

path

The relative path on the server for the Neo4J endpoint

server

The server's root URL

Details

Under the hood, this uses the RNeo4j::cypher function to call a Neo4J service running on the specified VFB server.

Value

A data.frame of query results

References

https://neo4j.com/developer/cypher-query-language/

See Also

RNeo4j::RNeo4j, RNeo4j::cypher and https://neo4j.com/docs/rest-docs/3.3/

Other query: vfb_owl_query(), vfb_solr_query()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# ask for all neuronal classes
nclasses=vfb_neo4j_query("MATCH (n:Neuron:Class) RETURN n.label")
nrow(nclasses)
head(nclasses)

# Find all images with an associated neuronal class
q=paste0("MATCH (n:Class:VFB { label : 'neuron' })",
  "<-[:SUBCLASSOF*]-(p)<-[:INSTANCEOF]-(i:Individual)",
  "RETURN distinct i.label, p.label;")
nclasses_image=vfb_neo4j_query(q)
nrow(nclasses_image)
head(nclasses_image)

# how many neuronal classes have images?
length(unique(nclasses_image$p.label))

# look at number of images for each neuronal class
table_by_nclass <- table(nclasses_image$p.label)
subset(as.data.frame(table_by_nclass), Freq>200)

jefferis/vfbr documentation built on Feb. 17, 2021, 4:46 p.m.