Graph

From Wikisophia
Jump to: navigation, search

Wikitex

Contents

Graphviz

Graphviz by Lefty Koutsofios, et al.; for relational diagrams (doc | template). Examples from the Graphviz gallery. Oversize/problematic examples on separate pages.

hello world

digraph G {Hello->World}

process - buggy / contraints?

Cluster

intranet

fdp cluster

Take a look at the new "fdp" layout:

<graph layout="fdp">
graph G
{
  e
  subgraph clusterA
  {
    a -- b;
    subgraph clusterC
    {
      C -- D;
    }
  }
  subgraph clusterB
  {
    d -- f
  }
  d -- D
  e -- clusterB
  clusterC -- clusterB
}   
</graph>

Entity relation

<graph layout="neato">
graph ER
{
 node [fontsize=12];
 node [shape=box]; course; institute; student;
 node [shape=ellipse];
  {node [label="name"] name0; name1; name2;}
  code; grade; number;
 node [shape=diamond,style=filled,color=lightgrey];
  "C-I"; "S-C"; "S-I";
 name0 -- course;
 code -- course;
 course -- "C-I" [label="n",len=1.00];
 "C-I" -- institute [label="1",len=1.00];
 institute -- name1;
 institute -- "S-I" [label="1",len=1.00];
 "S-I" -- student [label="n",len=1.00];
 student -- grade;
 student -- name2;
 student -- number;
 student -- "S-C" [label="m",len=1.00];
 "S-C" -- course [label="n",len=1.00];
 label = "\n\nEntity Relation Diagram\ndrawn by NEATO";
}
</graph>

Ling

AVM and Parsetrees have been superseded by <graph>.

Attribute-Value Matrices

AVM by Christopher Manning for attribute-value matrices (doc | template);

<ling> \newbox\matrixsynsem \newbox\headdtr \newbox\compdtrone \newbox\compdtrtwo {\scriptsize \avmoptions{center} \setbox\matrixsynsem=\hbox{\begin{avm} \osort{synsem}{\[local & \[cat & \[ \] \\ content & \[ \]\]\]} \end{avm}} \setbox\headdtr=\hbox{\begin{avm} \osort{word}{\[ phon\;\<\rm likes\>\\ synsem\;\[local\[ cat\;\[ head \; \@{5}\\ arg-s\;\< \@{1},\@{2}\>\] \\ content\;\@{6} \]\]\]} \end{avm}} \setbox\compdtrone=\hbox{\begin{avm} \sort{phrase}{\[ phon\;\<\rm fido\>\\ synsem\;\@{1}\;\[local\[ cat\;\[ head\;noun\\ arg-s\;\< \>\] \\ content\;\@{3} \]\]\]} \end{avm}} \setbox\compdtrtwo=\hbox{\begin{avm} \sort{phrase}{\[ phon\;\<\rm bones\>\\ synsem\;\@{2}\;\[local\[ cat\;\[ head\;noun\\ arg-s\;\< \>\] \\ content\;\@{4} \]\]\]} \end{avm}} \avmoptions{active,sorted} \begin{avm} \hspace{-1in} [{phrase} phon\;\<\rm fido likes bones\> \\ synsem\;[{synsem} local [{} cat & [{} head & @{5}\\ arg-s & \< \; \>] \\ content & @{6}[{psoa} reln\;like \\ arg1\;@{3} \\ arg2\;@{4} ]]]\\ dtrs\;\sort{head-struc}{[{} head-dtr\;\box\headdtr \\ comp-dtrs\;< \box\compdtrone , \\ \hspace{.5in} \box\compdtrtwo>]}] \end{avm}} </ling>

Parsetrees

Parsetree by Eirik Hektoen for semantic trees (doc):

<ling> \ptbegtree \ptbeg \npile{S\\ see' (s, k)\\ \lambda y see' ( y,k ) (s)} \ptbeg \npile{NP\\s} \npile{Sam\\s} \ptend \ptbeg \npile{VP\\ \lambda y see' ( y,k )\\ \lambda x \lambda y see' ( y,x ) (k)} \ptbeg \npile{V\\ \lambda x \lambda y see' ( y,x ) } \npile{saw\\ \lambda x \lambda y see ( y,x )} \ptend \ptbeg \npile{NP\\k} \npile{Kim\\k} \ptend \ptend \ptend \ptendtree </ling>