We first show that the braid group over a graph topologically containing no Theta-shape subgraph has a presentation related only by commutators. Then using discrete Morse theory and triple Massey products, we prove that a graph topologically contains none of four prescribed graphs if and only if its 4-braid groups is a right-angled Artin group.