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.
School of Computing and Augmented Intelligence, Arizona State University, Tempe, USA · School of Mathematical and Natural Sciences, Arizona State University, Tempe, USA.