the wagon man got killed when they attacked him
( ( the ( wagon man ) ) ( got ( killed ( when ( they ( attacked him ) ) ) ) ) )
(ROOT (S (NP (DT the) (NN wagon) (NN man)) (VP (VBD got) (SBAR (S (VP (VBD killed) (SBAR (WHADVP (WRB when)) (S (NP (PRP they)) (VP (VBD attacked) (NP (PRP him)))))))))))
The wagon man had committed a crime.
( ( The ( wagon man ) ) ( ( had ( committed ( a crime ) ) ) . ) )
(ROOT (S (NP (DT The) (NN wagon) (NN man)) (VP (VBD had) (VP (VBN committed) (NP (DT a) (NN crime)))) (. .)))