# Multiple Knowledge Graphs

The input data is a model as defined in a script which contains 1 top level module and a main function. The default name for the main function is main but you could pass in a different name if you wanted to.

Example:

module Foo
using Roots
a = 3
b = 4
c = -1
f(x,y) = c*x*y + a*x + b

function main()
x0 = [0.0,0.0]
xstar = RootProblem(f, x0)
@show xstar
end
end #module

There are a few different forms of knowledge graphs that can be extracted from codes.

1. The type graph: Vertices are types, edges are functions between types
2. Vertices are functions and variables, edges represent dataflow, function references variable or function calls function.
3. Conceptual knowledge graph from text, vertices are concepts edges are relations between concepts.

With a script we should be able to merge the types of graph by converting the type graph into its pseudodual. The pseudodual is constructed by take a type-function graph and constructing a new graph where functions and types are both vertices, if U = typeof(f(::V)) then there is a pair of edges V -> f -> U and there are edges for the functions getindex(u::U, v::V) ie (U, V) -> getindex -> typeof(u[v]) for all the values of v. These represent untupling and accessing fields of structs.