This function takes a Cypher query and parameters, executes the query using the given engine, and returns the result as a data frame.

cypher_query_df(engine, query, parameters = NULL, ...)

Arguments

engine

A neo4j_engine() or derivative providing access to a Neo4j database.

query

A string representing the Cypher query, which should return a table. Multiple queries may be passed as a vector; if so, Neo2R::multicypher if used and the result is returned as a list of data frames.

parameters

A list of parameters for the Cypher query, if required.

...

Additional arguments passed to the function.

Value

The result of the Cypher query as a data frame, or a list of data frames if multiple queries are passed.

Examples

engine <- monarch_engine()
#> Trying to connect to https://neo4j.monarchinitiative.org
#> Connected to https://neo4j.monarchinitiative.org

query <- "MATCH (n) WHERE n.id IN $ids RETURN n LIMIT 10"
parameters <- list(ids = c("MONDO:0007525", "MONDO:0020066", "MONDO:0034021"))

result <- cypher_query_df(engine, query, parameters)
print(result)
#>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             n
#> 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        http://purl.obolibrary.org/obo/MONDO_0034021, spondylodysplastic EDS, GARD:22214, MEDGEN:1814455, Orphanet:536471, UMLS:C5680154, spondylodysplastic Ehlers-Danlos syndrome, MONDO, phenio_nodes, MONDO:0034021, biolink:Disease, spondylodysplastic EDS, gard_rare|ordo_disorder|orphanet_rare|rare
#> 2 http://purl.obolibrary.org/obo/MONDO_0007525, DOID:0080727, GARD:2084, MEDGEN:1645042, MESH:C562625, NANDO:1200650, NANDO:2201260, NCIT:C125701, OMIM:130060, Orphanet:1899, SCTID:4170004, UMLS:C4551623, AEDS|EDS VII, mutant procollagen type|EDS7A (formerly)|EDSARTH1|Ehlers-Danlos syndrome type 7A (formerly)|Ehlers-Danlos syndrome, arthrochalasia type, 1|Ehlers-Danlos syndrome, type VII, autosomal dominant|Ehlers-Danlos syndrome, type VIIA, autosomal dominant|arthrochalasia EDS|arthrochalasia Ehlers-Danlos syndrome|arthrochalasis multiplex congenita, An inherited connective tissue disorder that is caused by defects in a protein called collagen. Common symptoms include severe joint hypermobility ; congenital hip dislocation; fragile, hyperextensible skin; hypotonia ; and kyphoscoliosis (kyphosis and scoliosis). EDS, arthrochalasia type is caused by changes (mutations) in the COL1A1 gene or the COL1A2 gene and is inherited in an autosomal dominant manner. Treatment and management is focused on preventing serious complications and relieving associated signs and symptoms., EDS 7A|EDS 7B, EDS VII|Ehlers-Danlos syndrome type 7|Ehlers-Danlos syndrome, arthrochalasia type|Ehlers-Danlos syndrome, type VII, AEDS, EDS 7A, EDS 7B, EDS VII, EDS VII, mutant procollagen type, EDS7A (formerly), EDSARTH1, Ehlers-Danlos syndrome type 7, Ehlers-Danlos syndrome type 7A (formerly), Ehlers-Danlos syndrome, arthrochalasia type, Ehlers-Danlos syndrome, arthrochalasia type, 1, Ehlers-Danlos syndrome, type VII, Ehlers-Danlos syndrome, type VII, autosomal dominant, Ehlers-Danlos syndrome, type VIIA, autosomal dominant, arthrochalasia EDS, arthrochalasia Ehlers-Danlos syndrome, arthrochalasis multiplex congenita, Ehlers-Danlos syndrome, arthrochalasia type, MONDO, phenio_nodes, MONDO:0007525, biolink:Disease, clingen|gard_rare|ordo_disorder|orphanet_rare|otar|rare
#> 3                                                                                                                                                                                                                                                                                                                 http://purl.obolibrary.org/obo/MONDO_0020066, Danlos Disease, Ehlers, Danlos disease, Disease, Ehlers Danlos, Disease, Ehlers-Danlos, Dystrophia mesodermalis congenita, ED syndrome, EDS, Ehler Danlos Syndrome, Ehlers Danlos Disease, Ehlers Danlos Syndrome, Ehlers Danlos syndrome, Ehlers-Danlos Disease, Ehlers-Danlos syndromes, Fibrodysplasia elastica generalisata, Hereditary collagen dysplasia, Meekeren-Ehlers-Danlos syndrome, Syndrome, Ehlers-Danlos, danlos ehlers syndrome, elastic skin, skin elastic, DOID:13359, GARD:6322, ICD10CM:Q79.6, ICD9:756.83, MEDGEN:41720, MESH:D004535, MedDRA:10014316, NANDO:1200645, NANDO:2200607, NCIT:C34568, NORD:1080, OMIMPS:130000, Orphanet:98249, SCTID:398114001, UMLS:C0013720, icd11.foundation:1122707206, ED syndrome, Ehlers-Danlos syndrome, MONDO, The Ehlers–Danlos syndromes (EDS) are a clinically and genetically heterogeneous group of heritable connective tissue disorders (HCTDs) characterized by joint hypermobility, skin hyperextensibility, and tissue fragility., phenio_nodes, MONDO:0020066, biolink:Disease, Danlos Disease, Ehlers|Danlos disease|Disease, Ehlers Danlos|Disease, Ehlers-Danlos|Dystrophia mesodermalis congenita|EDS|Ehler Danlos Syndrome|Ehlers Danlos Disease|Ehlers Danlos Syndrome|Ehlers Danlos syndrome|Ehlers-Danlos Disease|Ehlers-Danlos syndromes|Fibrodysplasia elastica generalisata|Hereditary collagen dysplasia|Meekeren-Ehlers-Danlos syndrome|Syndrome, Ehlers-Danlos|danlos ehlers syndrome|elastic skin|skin elastic, disease_grouping|gard_rare|nord_rare|ordo_group_of_disorders|otar|rare