Browse Source

add schema definitions to documentation

automated with Documenter.jl so the tables in markdown reflect the CSV.
pull/44/head
James Fairbanks 2 years ago
parent
commit
492a3d38bc
  1. 1
      Project.toml
  2. 15
      doc/make.jl
  3. 49
      doc/src/graph.md

1
Project.toml

@ -14,6 +14,7 @@ Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GLM = "38e38edf-8417-5370-95a0-9cbb8c7f171a"
GraphDataFrameBridge = "3c71623a-a715-5176-9801-629b201a4880"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MetaGraphs = "626554b9-1ddb-594c-aa3c-2596fe9399a5"

15
doc/make.jl

@ -1,4 +1,6 @@
using Documenter
using Latexify
using CSV
function makefigs(ext="svg")
try
@ -15,10 +17,23 @@ function makefigs(ext="svg")
end
function printmdtable(dir, outdir=".")
for path in readdir(dir)
df = CSV.read("$dir/$path")
s = mdtable(df,latex=false)
open("$outdir/$path.md", "w") do fp
print(fp, string(s))
end
end
end
@info "Making Figures"
makefigs()
makefigs("png")
# printmdtable("examples/knowledge_graph/data", "doc/src/schema/")
@info "Loading module"
using SemanticModels
@info "Making docs"

49
doc/src/graph.md

@ -0,0 +1,49 @@
# Knowledge Graphs
We use MetaGraphs.jl `MetaDiGraph`s to represent the knowledge we have extracted from the
code and test.
## Schema
Here we define the schema for our knowledge graph. The vertices and edges have types and
the metadata associated with the vertex or edge depends on its type.
### Vertex Types
```@eval
using CSV
using Latexify
df = CSV.read("../../examples/knowledge_graph/data/kg_vertex_types.csv")
mdtable(df,latex=false)
```
### Edge Types
```@eval
using CSV
using Latexify
df = CSV.read("../../examples/knowledge_graph/data/kg_edge_types.csv")
mdtable(df,latex=false)
```
Since those types are abstract, here are some examples that should make clear what is happening.
### Example Vertices
```@eval
using CSV
using Latexify
df = CSV.read("../../examples/knowledge_graph/data/kg_vertices.csv")
mdtable(df,latex=false)
```
### Example Edges
```@eval
using CSV
using Latexify
df = CSV.read("../../examples/knowledge_graph/data/kg_edges.csv")
mdtable(df,latex=false)
```
## API reference
```@autodocs
Modules = [SemanticModels.Graphs]
```
Loading…
Cancel
Save