We study the band topology and the associated linking structure of
topological semimetals with nodal lines carrying Z2 monopole charges,
which can be realized in three-dimensional systems invariant under the
combination of inversion P and time reversal T when spin-orbit coupling is
negligible. In contrast to the well-known PT-symmetric nodal lines protected
only by π Berry phase in which a single nodal line can exist, the nodal
lines with Z2 monopole charges should always exist in pairs. We show that
a pair of nodal lines with Z2 monopole charges is created by a {\it double
band inversion} (DBI) process, and that the resulting nodal lines are always
{\it linked by another nodal line} formed between the two topmost occupied
bands. It is shown that both the linking structure and the Z2 monopole
charge are the manifestation of the nontrivial band topology characterized by
the {\it second Stiefel-Whitney class}, which can be read off from the Wilson
loop spectrum. We show that the second Stiefel-Whitney class can serve as a
well-defined topological invariant of a PT-invariant two-dimensional (2D)
insulator in the absence of Berry phase. Based on this, we propose that pair
creation and annihilation of nodal lines with Z2 monopole charges can
mediate a topological phase transition between a normal insulator and a
three-dimensional weak Stiefel-Whitney insulator (3D weak SWI). Moreover, using
first-principles calculations, we predict ABC-stacked graphdiyne as a nodal
line semimetal (NLSM) with Z2 monopole charges having the linking
structure. Finally, we develop a formula for computing the second
Stiefel-Whitney class based on parity eigenvalues at inversion invariant
momenta, which is used to prove the quantized bulk magnetoelectric response of
NLSMs with Z2 monopole charges under a T-breaking perturbation.Comment: 4+28 pages, 3+17 figure