R/example_graph.neo4j_engine.R
example_graph.neo4j_engine.Rd
Given a KGX Neo4j KG engine, returns a graph representing the diversity of node categories and edge predicates for browsing. The returned graph is guaranteed to contain at least one node of every category, and at least one edge of every predicate. No other guarantees are made: the example graph is not minimal to satisfy these criteria, it is not random or even pseudo-random, and it may not be connected.
# S3 method for class 'neo4j_engine'
example_graph(engine, ...)
A tbl_kgx graph
# Retrieve and print an example graph:
g <- monarch_engine() |> example_graph()
#> Trying to connect to https://neo4j.monarchinitiative.org
#> Connected to https://neo4j.monarchinitiative.org
print(g)
#> # A tbl_graph: 79 nodes and 44 edges
#> #
#> # A directed acyclic simple graph with 37 components
#> #
#> # Node Data: 79 × 22 (active)
#> id category pcategory name symbol in_taxon_label description synonym
#> <chr> <list> <chr> <chr> <chr> <chr> <chr> <list>
#> 1 WB:WBGene… <chr> biolink:… abc-1 abc-1 Caenorhabditi… NA <lgl>
#> 2 GO:0051306 <chr> biolink:… mito… NA NA The proces… <chr>
#> 3 NCBIGene:… <chr> biolink:… CRAB… CRABP2 Bos taurus cellular r… <lgl>
#> 4 FB:FBgn00… <chr> biolink:… fabp fabp Drosophila me… NA <chr>
#> 5 dictyBase… <chr> biolink:… DDB_… DDB_G… Dictyostelium… NA <lgl>
#> 6 GO:0070876 <chr> biolink:… SOSS… NA NA A protein … <lgl>
#> 7 GO:0001556 <chr> biolink:… oocy… NA NA A developm… <lgl>
#> 8 WB:WBGene… <chr> biolink:… acy-4 acy-4 Caenorhabditi… NA <chr>
#> 9 ZFIN:ZDB-… <chr> biolink:… klf2… NA Danio rerio NA <lgl>
#> 10 ZFIN:ZDB-… <chr> biolink:… bns12 NA Danio rerio NA <lgl>
#> # ℹ 69 more rows
#> # ℹ 14 more variables: full_name <chr>, xref <list>, in_taxon <chr>,
#> # namespace <chr>, provided_by <chr>, type <list>, iri <chr>,
#> # related_synonyms <chr>, exact_synonyms <chr>, subsets <chr>,
#> # narrow_synonyms <chr>, has_gene <chr>, broad_synonyms <chr>,
#> # deprecated <lgl>
#> #
#> # Edge Data: 44 × 23
#> from to subject predicate object primary_knowledge_so…¹ knowledge_level
#> <int> <int> <chr> <chr> <chr> <chr> <chr>
#> 1 1 2 WB:WBGene… biolink:… GO:00… infores:wb knowledge_asse…
#> 2 3 4 NCBIGene:… biolink:… FB:FB… infores:panther knowledge_asse…
#> 3 5 6 dictyBase… biolink:… GO:00… infores:go-central knowledge_asse…
#> # ℹ 41 more rows
#> # ℹ abbreviated name: ¹primary_knowledge_source
#> # ℹ 16 more variables: negated <lgl>, species_context_qualifier <chr>,
#> # agent_type <chr>, aggregator_knowledge_source <chr>, has_evidence <chr>,
#> # provided_by <chr>, id <chr>, category <list>, publications <list>,
#> # qualifier <chr>, original_predicate <chr>, qualifiers <list>,
#> # disease_context_qualifier <chr>, original_object <chr>, …