A method for extracting triples from knowledge graphs in the
mining industry based on ontology constraints and thought chain principles is proposed. The method constructs a highly complete mining domain ontology, acquires and preprocesses unstructured text data sources from the mining domain, and then constructs structured prompts containing ontology constraint information and thought chain reasoning instructions, transforming the triple extraction task into a constrained generative reasoning process. The structured prompts are input into a generative large
language model. After receiving the input, the model, relying on its self-attention mechanism and pre-trained knowledge, strictly follows the pre-defined thought chain paths in the structured prompts to conduct reasoning. The output of the generative large
language model is parsed using a
parsing algorithm, separating the thought chain part and the final result part of the model output. Triple data structures are extracted from the final result part to form a candidate triple
list, followed by ontology-based post-
processing verification and optimization. This method enables efficient, accurate, and standardized extraction of knowledge in the mining domain.