Loop closure detection (LCD) plays an essential role in the Simultaneous Localization and Mapping (SLAM) process, effectively reducing cumulative trajectory errors. However, conventional LCD methods often encounter challenges when dealing with variations in illumination, changes in viewpoint, and environments with weak textures. This is due to their reliance on low-level geometric or image features. To address these issues, we propose a robust LCD method named SL-LCD, which integrates semantic information and line features to fully leverage the semantic content and line attributes within indoor scenes, thereby establishing a reliable feature correspondence between query images and loop closure images. For the retrieval of candidate closed-loop images, we construct a semantic-line-segment topological graph and introduce a graph matching algorithm to perform the LCD task. This approach fully exploits image features and spatial information to achieve closed-loop detection in complex indoor scenes. Furthermore, we present a semantic voxel-based generalized ICP (SVGICP) closed-loop relocalization algorithm tailored for challenging and complex indoor scenes, enhancing the accuracy of closed-loop relocalization in such scenarios. Experimental results demonstrate that the SL-LCD algorithm proposed in this paper surpasses state-of-the-art methods, accurately detecting closed loops, and effectively eliminating trajectory drift.