Graph-based retrieval-augmented generation depends on the quality of the knowledge graph (KG) it retrieves over, yet schema-free LLM-based extraction pipelines typically produce flat graphs: deduplicated entities and relations with no type hierarchy and no domain/range constraints. We present AutoOntic, a pipeline that automatically constructs an ontology from text by canonicalizing open-vocabulary entity types and relations, inducing a hierarchy over the canonicalized types, and mining relation-level domain and range constraints. Its hierarchy induction procedure prioritizes types using corpus-derived relation-argument profiles and places them through local, LLM-adjudicated parent/child checks, allowing newly inserted types to trigger reassignment of existing parent-child links. The resulting hierarchy constrains entity deduplication and supports the induction of relation-level domain/range constraints. For intrinsic evaluation, we introduce a reference-based protocol that classifies induced ontology types as exact, broader, narrower, or unrelated to reference domain and range classes. On the Wikidata-TekGen and DBpedia-WebNLG subsets of Text2KGBench, over 90% of AutoOntic's induced endpoint types are semantically aligned with the reference classes across two LLM backbones: about half match exactly, while most remaining differences concern granularity. On MINE, knowledge graphs organized using an ontology built by AutoOntic achieve 88% retrieval accuracy. AutoOntic is available at https://github.com/screemix/AutoOntic.
Figures & tables
Figure 1: The AutoOntic pipeline. A schema-free LLM extractor (§ 2.1 ) produces a collection G of raw triplets g=(s,ts,r,o,to,Q) . Their relation and type labels are canonicalized into a relation vocabulary R∗ (§ 2.2 ) and a type vocabulary T∗ (§ 2.3 ) organized into a single-parent is-a hierarchy H∗ (§ 2.4 ). Entity mentions are then deduplicated using that hierarchy as a symbolic gate (§ 2.5 ), and domain/range constraints are mined by re-resolving G against R∗ , T∗ , and H∗ (§ 2.6 ). Colored dashed arrows mark additional direct inputs beyond the sequential chain.
Figure 2: Hierarchy induction algorithm. Canonical types in T∗ are processed in descending order of a generality score based on Weeds precision over their relation-argument profiles. Starting from the roots of H∗ , an LLM first checks whether an existing candidate is a parent of the current type t∈T∗ . Synonymous types are merged; otherwise, a parent match continues traversal through that candidate’s children. If no parent is found, a separate child check identifies existing candidates to attach beneath t . If no match is found, t is added as a sibling at the current level. When the number of nodes at a level exceeds threshold B , an LLM consolidates related siblings under a synthesized parent, limiting the context required for subsequent placement decisions. The procedure repeats until all types have been processed.
Type Match
Constraint Plausibility
Dataset
Condition
Model
Side
Exact
More General
More Narrow
Sum
Exact
More Gen.
More Narrow
Sum
Wikidata TekGen
–
Qwen3-Next
D
58.6
14.7
17.5
90.8
9.6
34.9
1.6
46.1
R
53.6
22.6
16.3
92.5
12.2
33.3
2.6
48.1
gpt-oss
D
58.0
10.9
23.1
92.0
9.1
53.9
1.2
64.2
R
57.2
22.1
14.6
93.9
12.3
30.7
3.7
46.7
Wikidata Seeded
Qwen3-Next
D
58.5
14.6
17.6
90.7
3.4
77.7
1.6
82.7
Table 1: Per-triplet type match and Constraint plausibility of discovered ontology, reported separately for relation domains ( D ) and ranges ( R ) (%). Type Match compares each triplet’s domain/range types with the gold type and shows the share that matches it exactly, is more general (an ancestor), or is more narrow (a descendant). Constraint Plausibility applies the same breakdown to the induced relation constraints. Sum is the total of the three categories; the remainder up to 100 corresponds to types or constraints with no hierarchical relation to the gold ones. Conditions: – = unconstrained discovery, Wikidata-Seeded = discovery initialised with seed classes from the Wikidata ontology, D≤k = class hierarchy depth limited to k . Type Match is nearly invariant across conditions, whereas Constraint Plausibility shows variation depending on conditions and quantitatively characterizing the underlying ontology.
Method
MINE-1 score (%)
AutoOntic, gpt4.1, Wikidata-Seeded
88.00
AutoOntic, gpt4.1
85.87
AutoOntic, gpt4.1, D≤5
85.27
AutoOntic, gpt4.1, D≤10
85.47
KGGen, gpt4.1
82.37
Wikontic, gpt4.1
82.93
Table 2: MINE-1 information retention: the fraction of facts supported by context retrieved from the constructed KG. With GPT-4.1 as the construction backbone, AutoOntic achieves 85.87% without a supplied ontology, exceeding KGGen and Wikontic. Initializing AutoOntic with Wikidata seed classes further increases retention to 88.00%.
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
Symbol
Description
Value
Relation deduplication (§ 2.2 )
θr
HDBSCAN cosine-similarity threshold
0.75
Rr
Merge-round cap
5
Entity-type canonicalization (§ 2.3 )
θt
HDBSCAN cosine-similarity threshold
0.75
Rt
Merge-round cap
5
Appendix
Table 3: Pipeline hyperparameters. All HDBSCAN thresholds θ are cosine-similarity thresholds; HDBSCAN’s own cluster_selection_epsilon is set to 1−θ . The parallel-worker count affects wall-clock time only – cluster-verification order is reassembled deterministically regardless of completion order (§ 2 ).
Figure 3: Hierarchy induction on a film-domain vocabulary, one placement decision per step. (1) The initial H∗ is empty, audiovisual work settles as a root; (2) once documentary film is placed, LLM judges audiovisual work as a parent of documentary film , which is too shallow; (3) LLM judges audiovisual work as a parent of film and documentary film as a child of film , reparenting too shallow is-a relation; (4) movie is identified as a synonym of film; (5) war film settles under audiovisual work and then under film as a child; (6) action film is judged as a child of audiovisual work and then as a child of film ; (7) there are too many siblings under film : consolidating war and action film under a common parent, genre film ; (h) biographical film settles under documentary film , giving the final tree.
Condition
Extraction
Pipeline
TekGen / Qwen3-Next-80B
4.71
3.84
TekGen / gpt-oss-120b
7.02
5.63
WebNLG / Qwen3-Next-80B
2.20
1.09
WebNLG / gpt-oss-120b
2.99
1.71
Appendix
Table 4: Total tokens (prompt+completion, Millions), summed across all domains, per Text2KGBench condition.
Recall (%, grounded-only)
Extra rate (%)
Domain
Qwen3-Next-80B
gpt-oss-120b
Qwen3-Next-80B
gpt-oss-120b
ont_1_movie
77.4
73.7
74.5
78.9
ont_2_music
72.6
74.2
74.1
77.6
ont_3_sport
44.3
46.5
87.6
87.2
ont_4_book
72.5
74.5
78.4
80.6
ont_5_military
52.9
63.0
90.7
90.0
Appendix
Table 5: Recall (grounded-only, see § 4.1 ) and extra rate (§ 3 ) per Wikidata-TekGen domain, judged by GPT-5.1.
Recall (%, unfiltered)
Extra rate (%)
Domain
Qwen3-Next-80B
gpt-oss-120b
Qwen3-Next-80B
gpt-oss-120b
ont_1_university
71.4
71.0
29.1
23.9
ont_2_musicalwork
75.5
79.5
28.4
31.2
ont_3_airport
79.3
78.5
26.3
25.3
ont_4_building
67.3
71.5
34.0
22.7
ont_5_athlete
86.3
92.3
12.5
7.7
Appendix
Table 6: Recall and extra rate (§ 3 ) per DBpedia-WebNLG domain, judged by GPT-5.1.
Domain
Raw
Filtered
Ungr. (%)
ont_1_movie
42.9
77.4
62.2
ont_2_music
46.9
72.6
51.2
ont_3_sport
32.0
44.3
32.1
ont_4_book
48.6
72.5
45.8
ont_5_military
39.1
52.9
38.7
ont_6_computer
59.8
79.5
34.5
Appendix
Table 7: Recall (%) before and after excluding gold triplets an independent GPT-5.1 judge flags as not grounded in their own sentence, and the Averaged fraction of gold triplets so flagged (Qwen3-Next-80B, Wikidata-TekGen). The Averaged ungrounded rate (48.8%) differs from the per-domain average because it is computed over triplets, not domains.
Model
Recall, grounded
Recall, ungrounded
Qwen3-Next-80B
68.9
20.6
gpt-oss-120b
69.9
19.7
Appendix
Table 8: Recall (%) computed separately over the grounded and ungrounded gold-triple subsets, Averaged across all ten Wikidata-TekGen domains, Separate condition ( n=3,705 grounded / 3,527 ungrounded triplets, both models).
Knowledge graph construction turns text, tables, images, and databases into structured entities and relationships that machines can query and reason over.
Organizing a large-scale knowledge graph into a typed property graph requires structural decisions -- which entities become nodes, which properties become edges, and what schema governs these choices. Existing approaches embed these decisions in pipeline code or extract relations ad hoc, producing schemas that are tightly coupled to their construction process and difficult to reuse for downstream ontology-level tasks. We present an ontology-oriented approach in which the schema is designed from the outset for ontology analysis, entity disambiguation, domain customization, and LLM-guided extraction -- not merely as a byproduct of graph building. The core mechanism is intrinsic-relational routing, which classifies every property as either intrinsic or relational and routes it to the corresponding schema module. This routing produces a declarative schema that is portable across storage backends and independently reusable. We instantiate the approach on the January 2026 Wikidata dump. A rule-based cleaning stage identifies a 34.6M-entity core set from the full dump, followed by iterative intrinsic-relational routing that assigns each property to one of 94 modules organized into 8 categories. With tool-augmented LLM support and human review, the schema reaches 93.3% category coverage and 98.0% module assignment among classified entities. Exporting this schema yields a property graph with 34.0M nodes and 61.2M edges across 38 relationship types. We validate the ontology-oriented claim through five applications that consume the schema independently of the construction pipeline: ontology structure analysis, benchmark annotation auditing, entity disambiguation, domain customization, and LLM-guided extraction.
Ontology-driven knowledge graph construction from industrial text remains challenging due to the domain specificity of documents, the scarcity of annotated resources, and the complexity of ontology engineering workflows. This paper presents and investigates the applicability of an ontology learning pipeline that combines compact open-source Large Language Models (LLMs), reusable prompting strategies, and open knowledge bases to support the extraction, structuring, enrichment, and evaluation of knowledge from textual corpora. The approach is tested and evaluated on a private French corpus of power-grid incident reports, using locally deployable open-source LLMs ranging from 7B to 32B parameters. Starting from unstructured reports, the approach extracts entities and relations, generates RDF triples, constructs related OWL ontology, enriches it using external knowledge sources, assesses the quality of the ontology, and subsequently constructs a populated knowledge graph grounded in the resulting ontology schema. Experiments on 80 manually annotated private reports show that schema-guided prompting significantly improves extraction quality, while quantized models provide an effective trade-off between performance and computational cost. These results demonstrate the feasibility of transforming domain-specific industrial text into ontology-based knowledge graphs using locally deployed open-source LLMs, while supporting the generalization of the extraction process through reusable prompting strategies.
Abdelhadi Belfadel, Maxence Gagnant, Joseph Kattan +1
Institute for Technological Research - IRT SystemX 2 Bd Thomas Gobert, 91120 Palaiseau, France.
Knowledge graph generation typically relies either on predefined ontologies or on schema-free extraction. Ontology-driven pipelines enforce consistent typing but require costly schema design and maintenance, whereas schema-free methods often produce fragmented graphs with weak global organization, especially in long technical documents with dense, context-dependent information. We propose TRACE-KG (Text-dRiven schemA for Context-Enriched Knowledge Graphs), a framework that jointly constructs a context-enriched knowledge graph and an induced schema without assuming a predefined ontology. TRACE-KG captures conditional relations through structured qualifiers and organizes entities and relations using a data-driven schema that serves as a reusable semantic scaffold while preserving full traceability to the source evidence. Experiments show that TRACE-KG produces structurally coherent, traceable knowledge graphs and offers a practical alternative to both ontology-driven and schema-free construction pipelines. The code, experiments and prompts are available at https://github.com/mosadddeq01/TRACE-KG.
Mohammad Sadeq Abolhasani, Yang Ba, Yixuan He +1
School of Computing and Augmented Intelligence, Arizona State University, Tempe, USA · School of Mathematical and Natural Sciences, Arizona State University, Tempe, USA.