© the Owner Societies 2015. In this work, the systems are constructed with the defect lines of B-B or N-N dimers embedded in a graphene matrix using density functional theory. It is found that the Dirac-cone dispersions appear at the Fermi level in the bands introduced by the B or N heteroatom, linear B-B or N-N dimers, demonstrating that the carrier mobility is ∼ 106 m s-1 which is comparable with that of the pristine graphene. Most importantly, such dimer lines act as the quasi-1-D conducting nanowires whose charge carriers are confined around the linear defects in these dimers while the charge carriers in pristine graphene are dispersed two-dimensionally. Such systems suggest that heteroatoms in graphene can indeed contribute to the Dirac cone. In addition, the type of carriers (p-type or n-type) can be manipulated using the B or N heteroatoms, respectively. This will greatly enrich the electronic properties of Dirac semimetals.