A plot of the query depicted as a graph
graph_query.Rd
A plot of the query depicted as a graph
Arguments
- query
a query as returned by glitter (before call to spq_perform)
- layout
type of layout. Can be e.g. "tree"
- flip
whether to flip the coordinates. Defaults to FALSE
- label
whether to label the identifiers in the graph
Examples
library(glitter)
#>
#> Attaching package: ‘glitter’
#> The following object is masked from ‘package:sequins’:
#>
#> get_label
query=spq_init() %>%
spq_add("?mayor wdt:P31 ?species") %>%
# dog, cat or chicken
spq_set(species = c('wd:Q144','wd:Q146', 'wd:Q780')) %>%
# who occupy the function
spq_add("?mayor p:P39 ?node") %>%
# of mayor
spq_add("?node ps:P39 wd:Q30185") %>%
# of some places
spq_add("?node pq:P642 ?place")
graph_query(query, layout="tree")
graph_query(query, label=TRUE)