
\newlength{\colDist}
\newlength{\rowSpace}
\setlength{\colDist}{2cm}
\setlength{\rowSpace}{0.8cm}


\begin{tikzpicture}

\tikzset{
    node distance=\rowSpace and \colDist,
    % Styles
    stage/.style={rectangle, draw, fill=blue!5, text width=2cm, align=center, minimum height=0.6cm, font=\small},
    engine/.style={diamond, draw, fill=orange!10, text width=1cm, aspect=2, align=center, inner sep=0pt, font=\scriptsize},
    output/.style={rectangle, rounded corners, draw, fill=green!5, text width=2cm, align=center, font=\small},
    header/.style={font=\footnotesize\bfseries, gray},
    arrow/.style={-Stealth, thick, gray!80},
    base diamond/.style={diamond, draw, minimum size=4mm, inner sep=0pt},
    splitdiamond/.style={
        diamond, draw, minimum size=4mm, inner sep=0pt,
        path picture={
            \fill[red] (path picture bounding box.north) -- (path picture bounding box.west) 
                       -- (path picture bounding box.south) -- cycle;
            \fill[blue] (path picture bounding box.north) -- (path picture bounding box.east) 
                        -- (path picture bounding box.south) -- cycle;
        }
    },
    reddiamond/.style={base diamond, fill=red},
    bluediamond/.style={base diamond, fill=blue}
}


% --- HEADER DEFINITION (Die Ankerpunkte) ---
\node[header] (h1) {Input Type};
\node[header, right=2\colDist of h1] (h3) {Strategy};
\node[header, right=2.8\colDist of h3] (h5) {Output};

% --- SPALTE 1: Input (Hängt an h1) ---
\node[stage, below=0.3cm of h1] (raw) {Raw Text};
\node[stage, below=\rowSpace of raw] (simp) {Simplified Text};
\node[stage, below=\rowSpace of simp] (trans) {Translation};


% --- SPALTE 3: Strategy (Hängt an h3) ---
\node[stage, below=0.3cm of h3] (dni) {\textbf{DNI}};
\node[stage, below=\rowSpace of dni] (tbi_syl) {\textbf{TBI-SYL}\\ Aristotelian Triples};
\node[stage, below=\rowSpace of tbi_syl] (tbi_fol) {\textbf{TBI-FOL}\\ FOL Formulas};

% --- SPALTE 4: Inference (Hängt an h4) ---
% Positionierung auf Höhe der TBI-Strategien
\node[engine, right= .6\colDist of tbi_fol] (otter) {Otter\\Prover};
\node[engine, right= .6\colDist of tbi_syl] (prolog) {Prolog\\KB};

% --- SPALTE 5: Output (Hängt an h5) ---
\node[output, below= 1.5 *  \rowSpace of h5] (val) {Validity Label};
\node[output, below= \rowSpace of val] (prem) {Relevant Premises};

% --- VERBINDUNGEN (Pfeile) ---


\draw[arrow, black] (raw) -- (dni) node[midway, bluediamond] {};
\draw[arrow, black] (raw) -- (tbi_fol) node[midway, splitdiamond] {};
\draw[arrow, black] (raw) -- (tbi_syl) node[midway, splitdiamond] {};


\draw[arrow, black] (simp) -- (tbi_fol) node[midway, splitdiamond] {};
\draw[arrow, black] (simp) -- (tbi_syl) node[midway, splitdiamond] {};
\draw[arrow, black] (trans) -- (tbi_fol) node[midway, splitdiamond] {};
\draw[arrow, black] (trans) -- (tbi_syl) node[midway, splitdiamond] {};



\draw[arrow] (dni) -- (val);

% To Inference
\draw[arrow] (tbi_fol) -- (otter);
\draw[arrow] (tbi_syl) -- (prolog);

% To Outputs
\draw[arrow] (otter) -- (val.west);
\draw[arrow] (prolog.east) -- (val.west);
\draw[arrow] (otter.east) -- (prem);

% Hilfs-Pfeil Prep
\draw[arrow, black] (raw) -- (simp) node[midway, bluediamond] {};
\draw[arrow, ->, gray] (raw) to [bend left] (trans);
\draw[arrow, black] (trans) -- (simp) node[midway, bluediamond] {};
\end{tikzpicture}
