  An intact CuO$_2$ plane is widely believed to be a prerequisite for the
high-$T_c$ superconductivity in cuprate superconductors. However, an exception
may exist in the superconducting Ba$_2$CuO$_{3+\delta}$ materials where CuO
chains play a more important role. From first-principles density functional
theory calculations, we have studied the electronic and magnetic structures of
Ba$_2$CuO$_{3+\delta}$. The stoichiometric Ba$_2$CuO$_3$ and Ba$_2$CuO$_4$
contain quasi-one-dimensional CuO chains and intact two-dimensional CuO$_2$
planes, respectively. In comparison with the nonmagnetic metal Ba$_2$CuO$_4$,
Ba$_2$CuO$_3$ is found to be an antiferromagnetic (AFM) Mott insulator. It
possesses a nearest-neighbor intra-chain antiferromagnetic (AFM) coupling and a
weak inter-chain interaction, and its lowest unoccupied band and highest
occupied band are contributed by Cu 3$d_{b^2-c^2}$-orbital (or
$d_{x^2-y^2}$-orbital if we denote the $bc$-plane as the $xy$-plane) and O
2$p$-orbitals, respectively. Total energy calculations indicate that the oxygen
vacancies in Ba$_2$CuO$_{3+\delta}$ prefer to reside in the planar sites rather
than the apical oxygens in the CuO chains, in agreement with the experimental
observation. Furthermore, we find that the magnetic frustrations or spin
fluctuations can be effectively induced by moderate charge doping. This
suggests that the superconducting pairing in oxygen-enriched
Ba$_2$CuO$_{3+\delta}$ or oxygen-deficient Ba$_2$CuO$_{4-\delta}$ is likely to
be mainly driven by the AFM fluctuations within CuO chains.
