عجفت الغور

org-roam

Tags: org-mode

Org-Download

Graphs

  • Groups - https://org-roam.discourse.group/t/analysing-the-semantic-network/56

  • Example:

    ## Fetch data
    library(DBI) # Sqlite
    con <- dbConnect(RSQLite::SQLite(), "org-roam.db")
    dbListTables(con)
    links <- dbSendQuery(con, "SELECT [from], [to] FROM links")
    links <- dbFetch(links)
    titles <- dbSendQuery(con, "SELECT * FROM titles")
    titles <- dbFetch(titles)
    dbDisconnect(con)
    
    ## Create edge list [from - to] with clean labels
    library(dplyr) # Transformation
    library(stringr) # String manipulation
    edges <- inner_join(links, titles, by = c("from" = "file")) %>%
      inner_join(titles, by = c("to" = "file")) %>%
      select(From = titles.x, To = titles.y) %>%
      mutate(From = str_sub(From, 3, -3), # Clean titles
             From = str_replace(From, '" "' ,"/"),
             To = str_sub(To, 3, -3),
             To = str_replace(To, '" "' ,"/"),
             )
    
    ## Visualise and save as png
    library(igraph) # Network analysis
    svg("./org-roam-graph.svg", width = 19200, height = 10800)
    par(mar = rep(0,4))
    g <- graph_from_edgelist(as.matrix(edges), directed = FALSE)
    g <- simplify(g)
    coms <- spinglass.community(g) # Community detection
    plot(coms, g, layout = layout_with_fr,
                vertex.size=degree(g))
    dev.off()
    
    

Org-roam-bibtex

https://github.com/zaeph/org-roam-bibtex

Org-roam-v2