Schema-Agnostic Knowledge Graph Construction via Hybrid Ontology Discovery for Cyber Threat Intelligence Seonwoo Kim Ministry of National Defense Seoul, Republic of Korea
Jinwoo Kim Incheon International Airport Corporation Incheon, Republic of Korea
arXiv:2606.01208v1 [cs.CR] 31 May 2026
Daeseong Kim Korean National Police Agency Seoul, Republic of Korea
Abstract—Cyber threat intelligence (CTI) reports now serve as essential resources for capturing adversary tactics, techniques, and procedures observed in modern attack campaigns. While traditional CTI platforms reduce this intelligence to isolated indicators through fixed schemas such as STIX, ontology-based representations preserve the semantic relationships needed for structured threat analysis. However, existing approaches for ontology-aligned CTI extraction face three challenges: (i) schemaspecific pipelines that require manual reconfiguration whenever the schema changes, (ii) prompt-based schema inclusion that fails to scale on large ontologies such as UCO, and (iii) reliance on enterprise LLM APIs that conflicts with privacy constraints when integrating sensitive internal incident data. In this paper, we present A NCHOR, a schema-agnostic CTI knowledge graph construction system that bridges LLMs and formal ontology schemas. At the core of A NCHOR is hybrid ontology discovery, a search-and-navigate mechanism that dynamically explores largescale ontology schemas, combined with SHACL-based validation to enforce schema-compliant type assignments. Experimental results on the UCO, STIX, and MALOnt schemas show that A NCHOR outperforms existing baselines in ontology typing and schema compliance. In addition, A NCHOR with a local LLM closely matches enterprise LLM typing performance, enabling privacy-preserving CTI analysis with high fidelity. Index Terms—Cyber threat intelligence, ontology, knowledge graph, large language models
I. I NTRODUCTION A comprehensive analysis of cyber campaigns requires more than isolated indicators of compromise (IoC) [1]. Cyber threat intelligence (CTI) reports record the threat actors, attack sequences, and technical evidence, explicitly detailing the causal relationships between attack steps. To facilitate automated sharing of such knowledge, standardized data formats such as the structured threat information expression (STIX) [2] and the malware information sharing platform (MISP) [3] have been widely adopted. However, these indicator-oriented formats primarily capture low-level, isolated data points such as IP addresses and file names, discarding the causal dependencies between attack steps and the analytical reasoning that links them [4]–[6]. Ontology-based representations address this semantic gap by defining a formal vocabulary of ontology classes, their ∗ Corresponding author: Insup Lee ([email protected])
Daegyu Kang Financial Security Institute Yongin, Republic of Korea
Insup Lee∗ Korea University Seoul, Republic of Korea
properties (object and datatype), and structural constraints. Notable efforts include the unified cyber ontology (UCO) [7], STUCCO [8], and MALOnt [9]. These frameworks are typically formalized in the web ontology language (OWL) for class hierarchies and properties, supplemented by optional shapes constraint language (SHACL) constraints for structural validation. However, despite the introduction of many security ontologies over the past decade, no single schema has achieved widespread adoption in practice [10]. Recent studies have therefore explored the automated extraction of ontology-aligned knowledge from unstructured CTI text. Conventional approaches rely on rule-based pipelines [11], [12] and classification models [13], [14]. Unfortunately, these methods depend on hand-crafted rules or fixed type inventories, requiring a complete redesign whenever the target schema changes. Large language model (LLM)-based methods [15]– [17] are better suited for schema-agnostic extraction because they can interpret ontology class descriptions directly without schema-specific engineering. However, existing LLM-based approaches have been validated only on small custom schemas and exhibit critical limitations when applied to large-scale, real-world ontologies [18]. We identify three limitations of existing LLM-based automated ontology extraction approaches. First, conventional methods [11], [15]–[17] either define their own custom schemas or hard-code a specific ontology into the extraction pipeline (schema dependency). This rigid design requires a complete redesign whenever the underlying schema changes. The resolution of schema dependency alone does not solve the scalability problem, as the system must still present the target ontology to the LLM at inference time. Second, promptbased schema inclusion strategies fail on large-scale ontologies such as UCO. Hundreds of hierarchical classes exhaust the context window and degrade the model’s ability to distinguish semantically similar types. Third, an inherent reliance on enterprise LLMs complicates the integration of external CTI with sensitive internal incident data due to privacy and datasovereignty concerns. In this context, we derive the following three challenges from the existing literature. Challenge 1) How can we extract ontology-aligned knowledge without being tied to a specific schema? To
support diverse and evolving security standards [19], the system must decouple extraction logic from schema definitions. This decoupling allows different OWL/SHACL ontologies to be loaded without manually reconfiguring the pipeline. Challenge 2) How can we handle large-scale ontologies that exceed the capacity of prompt-based schema inclusion? Rather than including the entire schema in the LLM prompt, the system must dynamically discover and retrieve only task-relevant ontology fragments. This dynamic retrieval enables schema-aware reasoning within large and hierarchical ontologies while keeping each query within the context window. Challenge 3) How can we support privacy-preserving CTI analysis with local LLMs? External CTI provides greater operational value when integrated with internal alerts, logs, and incident reports, but such data is often too sensitive to expose to enterprise LLMs. The system must therefore enable ontology-grounded reasoning with locally deployed open-source LLMs while preserving competitive typing performance. To this end, we propose A NCHOR (Adaptive Navigation for Cybersecurity Hybrid Ontology Reasoning), a schemaagnostic system that builds a structured threat knowledge graph from unstructured CTI reports. The proposed method presents a hybrid ontology discovery mechanism, which enables LLMs to dynamically explore relevant sub-graphs of complex ontologies and separates the extraction pipeline from any specific schema. To ensure accurate and schema-compliant ontology alignment, A NCHOR also considers a SHACL-based validation during ontology typing. The main contributions of this paper are summarized as follows. • We propose A NCHOR , a schema-agnostic CTI knowledge graph construction framework that decouples the extraction pipeline from any specific ontology schema, supporting arbitrary OWL/SHACL ontologies at runtime without manual reconfiguration. • We introduce hybrid ontology discovery, which combines embedding-based semantic search with LLM-guided recursive navigation to retrieve only task-relevant ontologies, integrated with closed-loop SHACL validation to ensure schema-compliant knowledge graphs. • We demonstrate privacy-preserving CTI knowledge graph construction with locally deployed open-source LLMs, retaining 99.2% (entity) and 97.8% (predicate) of the best enterprise LLM’s performance. The source code of A NCHOR will be publicly available in the near future to foster further research. II. BACKGROUND This section reviews the necessary background on CTI data formats, ontologies, and LLM-based knowledge extraction. A. CTI Data Formats and Ontologies CTI records adversary tactics, techniques, and procedures (TTPs) and IoCs. This intelligence serves as a shared resource for organizations to coordinate defenses against rapidly
Unstructured CTI Report Buckeye APT used Trojan.Bemstour to install DoublePulsar by exploiting CVE-2019-0703.
Indicator-Oriented
File
name=Trojan.Bemstour
Ontology-Based Knowledge Graph Adversary Buckeye APT
Vuln.
name=CVE=2019-0703
Maware
name=DoublePulsar
uses
Exploit Tool
Data extraction without causal context results in isolated attribute-value pairs
Trojan.Bemstour
Vuln.
delivers
Backdoor DoublePulsar
exploits
CVE-2019-0703
Knowledge graph with semantic relationships preserves attack logics
Fig. 1. Comparison of two CTI data formats: indicator-oriented flat data and ontology-based knowledge graph.
changing threats [20]. Open-source CTI (OSCTI) is collected from security blogs, threat reports, and vulnerability databases, providing a critical resource for understanding dynamic threat environments. To standardize the exchange of threat information, the security community widely adopts three data formats and protocols. STIX [2] defines a set of domain objects (e.g., threat actors, malware, vulnerabilities) and their relationships in a JSON-based format. MISP [3] provides a collaborative framework to share IoCs using a predefined attribute taxonomy. The trusted automated exchange of intelligence information (TAXII) [21] acts as the transport protocol to distribute STIX-formatted data between organizations. While these formats enable efficient indicator sharing, their structures are limited to flat attribute-value pairs and predefined relationship types [4]. Fig. 1 illustrates differences between this indicator-oriented view and an ontology-based knowledge graph. In the threat knowledge graph, semantic relationships connect security entities into a coherent structure. This connectivity allows analysts to trace the full attack flow rather than examine individual indicators in isolation. Ontologies are typically expressed in the web ontology language (OWL), which defines class hierarchies alongside object and datatype properties. These definitions often include optional shapes constraint language (SHACL) constraints for structural validation, such as required attributes and cardinality bounds. UCO [7] unifies concepts from multiple security standards (e.g., CyBOK, NIST, MITRE ATT&CK) into a single hierarchical framework defined in OWL/SHACL, containing hundreds of classes and properties. In contrast, MALOnt [9] provides a lightweight malware-focused ontology with only 75 classes, 10 relations, and 12 properties. Despite the studies on security ontologies, the construction and maintenance of a comprehensive cybersecurity ontology remains an open problem. A recent survey reports inconsistencies and ambiguities in cybersecurity terminology that hinder communication between security professionals [10]. Furthermore, no existing ontology fully aligns with the major security standards required for seamless cross-platform integration. These practical limitations motivate the scenarios described in Section III.
B. LLM-based Knowledge Extraction LLMs have demonstrated strong performance in natural language understanding and information extraction tasks [22], [23]. In the CTI domain, LLMs offer a practical alternative to traditional rule-based or keyword-matching systems. While these traditional systems struggle to capture the intent and contextual nuances of attacker behavior, recent studies [5], [15]–[17] show that LLMs can extract key entities and their semantic relationships from threat reports with high performance. This automated extraction reduces the need for manual analyst intervention in knowledge graph construction. The integration of LLMs with external knowledge sources, such as databases and ontology schemas, has traditionally required separate implementations for each data source. This requirement creates tightly coupled pipelines that are difficult to maintain. Recent agent frameworks address this fragmentation by providing standardized interfaces to access external knowledge dynamically. This interactive approach grounds LLM outputs in verifiable references rather than relying solely on parametric knowledge. Our design adopts this methodology to ensure flexibility and maintainability. A uniform interface between the LLM agent and the external ontology, aligned with open standards such as the model context protocol (MCP) [24], successfully decouples the extraction logic from any specific schema (Section IV). III. M OTIVATING E XAMPLES This section illustrates the practical limitations of current automated CTI extraction through two scenarios: (i) information loss issues common to all indicator-oriented pipelines and (ii) a scalability limitation caused by prompt-based schema inclusion in LLM. A. Information Loss in Indicator-oriented Formats To illustrate the information loss caused by indicatororiented CTI data, consider the following passage from typical threat analysis reports: “In early March 2024, security analysts identified a spear-phishing campaign targeting Southeast Asian financial institutions. The attacker delivered a Microsoft Word document disguised as an invoice via email. When a user opens the document, a macro executes to download a secondary payload from hxxp://update-check[.]site/loader.exe. This payload maintained access by creating a scheduled task named “WindowsUpdateCheck” and afterward communicated with a command and control (C2) server at 45.77.23.91 via TCP port 443. Analysis revealed that these techniques align with the activities of APTX, known for macro-based initial access and invoicethemed lures.” When this scenario is mapped into indicator-oriented formats such as STIX, most CTI platforms extract only a limited subset of isolated indicators: • Indicators:
TABLE I C OMPARISON OF CTI K NOWLEDGE G RAPH C ONSTRUCTION S YSTEMS System
Method
Schema dependency
Schema size
TTPDrill [11] CTIKG [15] CTINexus [16] LLM4CTI [17]
Rule LLM (prompt) LLM (prompt) LLM (prompt)
Fixed (ATT&CK) Open-ended Fixed (MALOnt) Fixed (STIX)
60 77
A NCHOR
LLM (hybrid)
Any OWL/SHACL
Up to 997 (UCO)
– URL: “update-check[.]site” – IP: “45[.]77[.]23[.]91” – File: “loader.exe” • Objects: – Scheduled Task: “WindowsUpdateCheck” – Identity: Financial Sector • Relationships: – Attributed-to APT-X Note that this isolation leads to the loss of semantic connectivity: indicator-oriented formats log discrete values while omitting the causality and rationale that link them together. For instance, the passage above includes a causal chain (e.g., (i) macro execution downloads the secondary payload and (ii) the C2 connection enables remote control) and an attribution rationale (TTP overlap with APT-X), yet the STIX output preserves only flat identifiers without any of this contextual reasoning. As a result, the structured output captures a fragmented snapshot of the original report, with no representation of the attack logic that connects these indicators. To preserve these crucial relationships, an ontology-based knowledge graph offers a promising alternative that explicitly models semantic connectivity between threat entities. B. Limited Scalability of Prompt-Based Schema Inclusion Recent LLM-based methods map entities to ontologies using prompt-based schema inclusion, which embeds the entire class list directly into the input prompt. As shown in Table I, existing systems [11], [15]–[17] either hard-code a specific schema, operate without one, or rely on prompt-based inclusion at a small scale (60 to 77 elements). While promptbased inclusion is feasible for small schemas like MALOnt and STIX, it introduces three severe limitations when applied to large-scale ontologies such as UCO (419 classes): • Context exhaustion: Massive prompts with hundreds of class descriptions trigger the “Lost in the Middle” phenomenon [25], causing the model to miss relevant context. • Precision degradation: An excessive number of candidates degrades semantic precision, causing the model to confuse adjacent types (e.g., Process, Action, Event) or hallucinate non-existent classes. • Maintenance burden: A fixed class list requires manual reconfiguration whenever the schema is updated. Furthermore, none of the existing baselines verify whether assigned types satisfy formal structural constraints, allowing invalid mappings to enter the knowledge graph undetected. These scalability and validation gaps highlight a critical mis-
alignment between static LLM prompts and complex security ontologies. To process large-scale schemas without context exhaustion, a system requires dynamic exploration that retrieves only task-relevant fragments on demand. Furthermore, to prevent hallucinated mappings from corrupting the output, the system must enforce formal constraints before committing the data. Motivated by these exact requirements, Section IV introduces the architectural design of A NCHOR, which replaces prompt-based full schema inclusion with an effective ontology discovery and validation mechanism. IV. A NCHOR D ESIGN We propose A NCHOR, a schema-agnostic threat knowledge graph construction system that aligns entities and predicates to large-scale OWL/SHACL ontologies via hybrid ontology discovery. This section describes the system overview, the schema-agnostic extraction pipeline, and the hybrid ontology discovery procedure. A. System Overview A NCHOR aims to construct threat knowledge graphs from fragmented CTI data based on the following three principles: (i) the extraction pipeline is decoupled from any specific ontology schema, supporting arbitrary OWL/SHACL ontologies at runtime; (ii) ontology fragments are discovered dynamically rather than included as a whole in the LLM prompt, keeping each query within the context window; (iii) during threat knowledge graph construction, every type assignment is verified against formal schema constraints before commitment, ensuring schema compliance. As shown in Fig. 2, the resulting architecture consists of three core components: schemaagnostic extraction, hybrid ontology discovery, and knowledge graph construction. Schema-agnostic extraction. This stage extracts entities, coreferences, and relation triplets from preprocessed CTI text without binding the extraction logic to any specific ontology, and forwards the structured output to the next stage for type assignment. Section IV-B details the full extraction pipeline. Hybrid ontology discovery. This stage aligns each extracted element to a formal ontology class or property URI by combining embedding-based semantic search with LLMguided hierarchical navigation over the target OWL/SHACL schema. When the search confidence falls below a predefined threshold, the system switches to recursive schema traversal, ensuring that domain-specific or novel terminology is correctly resolved. Section IV-C details the discovery algorithm. Knowledge graph construction. The validated type assignments are assembled into an ontology-aligned knowledge graph through a SHACL-based closed-loop correction process: each candidate assignment is checked against the target schema, and the mapper is re-invoked with the violation report until the output is conformant or a retry budget is exhausted. The resulting graph is serialized as JSON and, optionally, as a Neo4j-importable Cypher file to support downstream multihop queries over attack chains.
B. Schema-Agnostic Extraction To prepare unstructured CTI data for ontology-aligned knowledge extraction, A NCHOR processes raw inputs through a sequential pipeline: (i) input preprocessing, (ii) knowledge extraction, and (iii) post-processing and filtering. 1) Input Preprocessing: Given unstructured CTI text such as threat reports, A NCHOR applies a recursive characterbased splitting strategy to handle documents that exceed the LLM context window. The splitter respects natural semantic boundaries (paragraph breaks, sentence boundaries, word boundaries) and retains a fixed-size overlap window between consecutive chunks to preserve cross-boundary context. 2) Knowledge Extraction: After preprocessing, A NCHOR extracts structured entities and relationships from preprocessed chunks through three phases: entity extraction, coreference resolution, and triplet extraction. Entity extraction. A NCHOR identifies all named entities from each chunk through a dedicated LLM extraction call. An entity here refers to any phrase that denotes a concrete object or referent in the text, in contrast to descriptive expressions (e.g., adjectives, adverbs) or behavioral phrases that do not stand as standalone referents. Rather than restricting the process to predefined entity classes, the system captures a broad spectrum of referents and defers formal ontology type assignment to the subsequent discovery stage. Each extracted entity is represented as a tuple (name, type hint, properties), where type hint is a short phrase that guides ontology class search, and properties captures clearly stated literal attributes (e.g., implementation language, alias, first-seen date). To maintain consistent referencing, the extraction enforces name normalization (e.g., stripping leading articles, lowercasing) and performs crosschunk unification using a normalized key, so that surface variations such as “Fancy Bear Hacking Group” and “Fancy Bear” map to the same canonical entry while non-entity behavioral descriptions are filtered out. Coreference resolution. After entity extraction, A NCHOR applies an entity-aware coreference resolution pass to each chunk. The LLM replaces anaphoric references (pronouns, role descriptors, near-demonstratives) with the corresponding canonical entity name from the unified list, reducing misattributed or missing relations caused by unresolved anaphora. Triplet extraction. With the extracted entity list in place, the system extracts structured relationships per chunk, providing the entity list as an explicit restriction so that only known, verified entities appear as relation endpoints. This two-pass design (entities first, relations second) eliminates subject-bias (over-generating relations for prominent entities while neglecting less salient ones) and dangling references (relation endpoints absent from the final inventory), both of which frequently arise when entity discovery and relation extraction are performed simultaneously. ObjectProperty triplets represent entity-to-entity relations of the form (es , p, eo ) with p a concise predicate phrase (e.g., “uses”, “targets”, “exploits”, “attributed to”) and an evidence sentence from the source text attached for grounding context during ontology alignment;
(1) Schema-Agnostic Extraction
(2) Hybrid Ontology Discovery
(3) Knowledge Graph Construction
Concept Overview
Input Preprocessing
Knowledge Extraction
Post-processing & Filtering
Entity Extraction
IoC Detection
Coreference Resolution
Noise Filtering
Triplet Extraction
Duplicate Removal
Threat Reports
Security Blog
Vuln. DB
LLM Agent
Embedding Search
score ≥ τ?
YES
MCP Server
Ontology Schema
Direct Alignment
Ontology Typing
Entity to Ont. Class
NO Scoped Search Recursive Navigation
Predicate to Ont. Property
SHACL Validation Self Correction
Schema Compliance
Ontology-Aligned Threat Knowledge Graph
Threat Actor
Malware
Indicator
Campaign
Tool
Vuln.
Fig. 2. Architecture of the A NCHOR System: (i) Schema-agnostic extraction preprocesses CTI documents and extracts entities, coreferences, and triplets without binding to a fixed ontology schema; (ii) Hybrid ontology discovery maps each entity and predicate to an ontology class or property URI via embedding search when confidence meets τ , or recursive navigation otherwise; (iii) Knowledge graph construction applies SHACL validation with closed-loop self-correction to build an ontology-aligned threat knowledge graph.
DatatypeProperty triplets capture entity-to-literal associations such as language strings, timestamps, or boolean flags. The LLM is instructed to be exhaustive, evaluating every entity pair and capturing all stated attributes regardless of salience. 3) Post-processing and Filtering: Following knowledge extraction, A NCHOR applies three deterministic post-processing steps: IoC detection, noise filtering, and duplicate removal. In IoC detection, A NCHOR matches entity names against regular expression patterns and overrides their type hints with a schema-agnostic descriptor (e.g., “IPv4 address”, “SHA256 hash”), enabling reliable class resolution in the mapping stage regardless of which ontology is active. In noise filtering, A NCHOR removes non-entity strings such as temporal expressions, short strings, and common descriptors. Finally, in duplicate removal, A NCHOR merges duplicate entities sharing the same normalized key and removes duplicate or dangling triplets. The filtered output is then forwarded to the subsequent hybrid ontology discovery stage. C. Hybrid Ontology Discovery With the schema-agnostic knowledge extraction complete, A NCHOR aligns each extracted element to a formal ontology class and property. Hybrid ontology discovery provides this alignment through a uniform tool-based interface between the LLM agent and any OWL/SHACL ontology. At initialization, A NCHOR parses the target ontology file, pre-computes embeddings for all class names and descriptions, and indexes the type hierarchy. It exposes six tools covering three targets (classes, attributes, relations), each with two operations: (i) embeddingbased search that retrieves candidates by semantic similarity, and (ii) hierarchical recursive navigation that the LLM invokes when search confidence is below the threshold τ . 1 1) Entity Ontology Typing: A NCHOR determines the appropriate formal ontology class for each extracted entity, representing it as a uniform resource identifier (URI), by executing 1 To facilitate broader reuse, the discovery suite is provided as an MCPcompatible server that includes the six core tools used in this work along with auxiliary functions for general-purpose ontology exploration. The underlying hybrid ontology discovery architecture, however, is agnostic to any specific tool-call protocol.
Algorithm 1. For this phase, the algorithm is instantiated using class-specific semantic search, the root class set Uroots , and owl:Thing as the default fallback. Unlike predicate ontology typing, entity ontology typing executes only Steps 1 and 2 of the discovery process, with Algorithm 1 instantiated in E NTITY mode. Step 1: Embedding-based search. The system first performs embedding-based search, which computes a relevance score for each candidate URI u in the ontology graph G: 1 1 sim(q, ename ) + sim(q, edesc ) + δk , (1) u u 2 2 where q is the query embedding derived from the query hint h (e.g., the entity’s type hint), ename are and edesc u u pre-computed embeddings of the class name and description, sim(·) denotes cosine similarity, and δk is a fixed keyword bonus (set to 0.3 in our experiments) applied when the query string appears verbatim in the class name or description. If the top candidate’s score meets or exceeds the entity confidence threshold τentity (set to 0.45 in our experiments), the class is selected immediately. Step 2: Hierarchical recursive navigation. If no candidate from Step 1 clears the threshold τentity , the system activates hierarchical recursive navigation. From the set of root classes Uroots , the LLM evaluates semantic definitions of each subclass tier and selects the most logically matching branch, drilling down iteratively until it reaches a leaf node or determines that no sufficiently matching branch remains. This top-down approach compensates for the limitations of embedding models by leveraging LLM reasoning, enabling precise classification of domain-specific or novel terminology. The LLM bases this decision on the candidate subclasses’ names, textual descriptions, and child counts presented at each tier, signaling termination when no candidate aligns with the target query hint h. Fallback. If the recursive navigation fails to identify a suitable class, the entity defaults to owl:Thing, corresponding to the fallback return in Algorithm 1. This defensive assignment ensures the extracted entity and its associated relations remain score(u) =
property’s declared XML Schema Definition (XSD) range. For Algorithm 1: Hybrid Ontology Discovery Input: Query hint h; root URIs Uroots ; confidence threshold entity connections, the relation search targets ObjectProperty URIs by utilizing the evidence sentence captured during triplet τ ; discovery mode m ∈ {E NTITY, P REDICATE}. ∗ extraction as additional context. It applies direction-aware Output: Matched ontology element URI u . score adjustments, adding a bonus (0.10) for direct forward 1: /* Step 1: Embedding-based search */ relations and a minor penalty (−0.05) for inverse relations. To 2: Ucands ← Search(h) ensure completeness, both tools evaluate properties inherited 3: if Ucands ̸= ∅ and score(top(Ucands )) ≥ τ then from the transitive superclass hierarchy, leveraging SHACL 4: return top(Ucands ) domain annotations back-propagated during schema loading. 5: end if Step 2: Hierarchical recursive navigation. If the search 6: /* Step 2: Hierarchical recursive navigation */ score falls below the predicate confidence threshold τpredicate 7: ucurr ← LlmSelect(h, Uroots , RetrieveDesc(Uroots )) (set to 0.30), the system triggers LLM-guided traversal. The 8: if ucurr = none then traversal starting point depends on the target: data-property 9: return Fallback(m) navigation roots at the bound entity URI, while object-property 10: end if navigation roots at the (s, o) URI pair. From these roots, 11: uscope ← ∅ the LLM navigates a structured property list organized by 12: while true do inheritance level and domain class. For object properties, 13: S ← Children(ucurr ) the LLM additionally infers the correct assertion direction 14: if S = ∅ then (forward or inverse). 15: uscope ← ucurr ; break Step 3: Scoped embedding search. Large schemas of16: end if ten group properties under intermediate classes, making ex17: ubest ← LlmSelect(h, S, RetrieveDesc(S)) haustive LLM traversal impractical (e.g., UCO contains 578 18: if ubest = none then properties). When navigation reveals a collapsed property 19: uscope ← ucurr ; break group anchored to an intermediate class uscope , A NCHOR re20: end if executes the embedding similarity search restricted solely to 21: ucurr ← ubest the properties of that class. This scoped pass allows the system 22: end while to handle large hierarchies efficiently once anchored to a 23: if m = E NTITY then specific branch. 24: return uscope Fallback. If all three steps fail to identify a matching 25: end if property, A NCHOR defaults to rdfs:label for literal attributes 26: /* Step 3: Scoped embedding search (predicate) */ and rdfs:seeAlso for entity relations. Similar to entity ontology 27: if uscope ̸= ∅ then typing, this defensive mapping ensures every extracted triplet 28: Ucands ← Search(h, scope = uscope ) is preserved in the output graph without fabricating incorrect 29: if Ucands ̸= ∅ and score(top(Ucands )) ≥ τ then schema assignments. 30: return top(Ucands ) 31: end if D. Knowledge Graph Construction with SHACL Validation 32: end if After finalizing the entity and predicate mappings, A NCHOR 33: return Fallback(m) assembles the typed elements into a unified knowledge graph. To ensure structural integrity, the system applies a SHACLin the knowledge graph without introducing an incorrect or based validation mechanism that evaluates every entity against unverified type. the node shapes defined in the target ontology. This validation 2) Predicate Ontology Typing: To assign a formal property targets cardinality constraints, verifying that required propURI to each extracted triplet, A NCHOR extends the search- erties are present and that value counts fall within declared and-navigate strategy used in entity ontology typing. Depend- bounds. Because LLM-based extraction often omits mandaing on the triplet type, it determines either an ObjectProperty tory attributes, missing required properties represent the most URI for entity-to-entity relations or a DatatypeProperty URI common source of schema violations in this domain. for entity-to-literal attributes. For example, under the UCO schema, a cardinality violation Unlike entity ontology typing, this phase utilizes all three occurs if an extracted malware entity lacks the required steps of Algorithm 1, with the algorithm instantiated in P RED - hash algorithm attribute, a common omission that renders the ICATE mode. indicator unusable for downstream matching. Upon detecting a Step 1: Embedding-based search. A NCHOR deploys two violation, the system generates a structured feedback message distinct search tools to handle attributes and relations. For detailing the violating entity, the failed constraint, and the literal attributes, the embedding-based search identifies the op- expected correction. The LLM agent receives this feedback timal DatatypeProperty. It extends Equation 1 with a datatype and re-invokes the appropriate discovery tool to rectify the inference heuristic, applying a score boost when the inferred omission (e.g., searching for a missing required property). XSD type (e.g., xsd:dateTime, xsd:integer) aligns with the A NCHOR limits this closed-loop self-correction to three retries
TABLE II S TATISTICS OF TARGET O NTOLOGY S CHEMAS
File: buckeye-windows-zero-day-exploit Beginning in March 2016, Buckeye began using a variant of DoublePulsar (Backdoor.Doublepulsar), a backdoor that was subsequently released by the Shadow Brokers in 2017. DoublePulsar was delivered to victims using a custom exploit tool (Trojan.Bemstour) that was specifically designed to install DoublePulsar. Bemstour exploits two Windows vulnerabilities in order to achieve remote kernel code execution on targeted computers. One vulnerability is a Windows zero-day vulnerability (CVE-2019-0703) discovered by Symantec. The second Windows vulnerability (CVE-20170143) was patched in March 2017 after it was discovered to have been used by two exploit tools — EternalRomance and EternalSynergy — that were also released as part of the Shadow Brokers leak.
Symantec Identity
investigates CVE-2019-0703 Vulnerability
exploit-tool
exploits
malware_types
Buckeye uses
Trojan.Bemstour
ThreatActor
Malware
uses
Windows
delivers
Software
exploits
backdoor
targets
malware_types
CVE-2017-0143
alias
DoublePulsar
Vulnerability
Backdoor.DoubleParser exploits EternalSynergy Malware
exploits
EternalRomance Malware
Malware
authored-by
Shadow Brokers Identity
Fig. 3. Example knowledge graph constructed by A NCHOR from a Buckeye APT campaign report.
to prevent unbounded execution. If the violation persists after the maximum attempts, the system retains the entity with its assigned class and flags it with a validation warning rather than silently discarding it. This approach minimizes unverified type assignments while preserving the extracted intelligence. Beyond constraint checking, these SHACL shapes facilitate facet discovery for ontologies that organize auxiliary properties into compound structures (e.g., UCO). The system performs this through a multi-strategy lookup combining property domain inspection, inheritance traversal, and SHACL shape resolution. Finally, A NCHOR serializes the validated type assignments as an ontology-aligned knowledge graph in JSON format. To provide an intuitive understanding of how A NCHOR reconstructs semantic connectivity from an unstructured CTI report, as shown in Fig. 3, we visualize an example knowledge graph constructed from a Buckeye APT campaign report. The resulting graph contains 10 typed entities of five classes (ThreatActor, Identity, Malware, Software, and Vulnerability), connected by typed predicates (e.g., uses, delivers, and exploits) that trace the attack chain from the exploit tool through the vulnerabilities and the backdoor to the Shadow Brokers leak. The two vulnerabilities (CVE-2019-0703 and CVE-2017-0143) are typed against the Vulnerability class, demonstrating accurate resolution of numerical CVE refer-
Schema
Classes
Relations
Properties
UCO STIX 2.1 MALOnt
419 109 75
177 92 10
578 311 12
ences. Datatype properties such as malware types (“backdoor” and “exploit-tool”) and alias (“Backdoor.DoubleParser”) attach literal attributes to the entities. These typed entities, properties, and predicates jointly reconstruct the semantic connectivity discussed in Section III-A, including the causal chain, the temporal sequence, and the qualitative reasoning that indicatororiented formats omit. V. E VALUATION For reproducibility, we use a benchmark provided by CTINexus [16], consisting of 149 CTI reports with manually annotated entities, triplets, and ontology type labels. The original benchmark targets only the small-scale MALOnt schema, so we additionally reconstruct ground-truth type labels for two larger schemas, UCO and STIX 2.1, as summarized in Table II. Three cybersecurity researchers established the ground truth through a human-in-the-loop process. An ensemble of three LLMs (GPT-5.4, Claude-Sonnet-4-6, and Gemini-3.1-flash) produced the initial candidates, and the researchers manually cross-examined and resolved conflicting assignments by consensus. For our baselines, we compare the F1 scores of A NCHOR against three systems: TTPDrill [11], CTINexus [16], and LLM4CTI [17]. We exclude CTIKG [15], as it performs only knowledge extraction without ontology typing. Since CTINexus originally types only entities, we extend it to predicate typing by reusing its prompt-based entity ontology typing method on relation predicates. We deploy A NCHOR on a workstation equipped with an NVIDIA GB10 board and 128 GB of memory, where we serve Qwen3.5-35B locally via vLLM [26]. For a fair comparison, all baselines also use Qwen3.5-35B as their underlying model. In the comparison against enterprise LLMs (Section V-D), we additionally use GPT-5.4-mini and Claude Haiku-4.5. A. Ontology Typing Performance We examine the ontology typing performance on three schemas with different scales: UCO (large, 419 classes), STIX (medium, 109 classes), and MALOnt (small, 75 classes). Ontology typing measures whether the extracted entities and relations can be aligned to formal ontology classes and properties. Since the UCO schema is deeply nested with multi-level class hierarchies, we adopt a hierarchical F1 score that assigns full credit (1.0) for an exact match and partial credit (0.6 for a onestep parent or child mismatch, 0.3 for a two-step mismatch) to capture semantic proximity. We evaluate two complementary tasks: entity ontology typing, where each extracted entity is mapped to an ontology class uniform resource identifier (URI),
TABLE III E NTITY O NTOLOGY T YPING P ERFORMANCE ON T HREE S CHEMAS System
UCO
STIX
MALOnt
Average
TTPDrill [11] CTINexus [16] LLM4CTI [17] A NCHOR
0.0652 0.4439 0.4521 0.7347
0.1042 0.5698 0.7886 0.8724
0.2305 0.6370 0.6891 0.6942
0.1333 0.5502 0.6432 0.7371
TABLE IV P REDICATE O NTOLOGY T YPING P ERFORMANCE ON T HREE S CHEMAS System
UCO
STIX
MALOnt
Average
TTPDrill [11] CTINexus [16] LLM4CTI [17] A NCHOR
0.0033 0.1282 0.4000 0.5180
0.0000 0.4289 0.5355 0.5860
0.0000 0.4528 0.5647 0.5412
0.0011 0.3366 0.5001 0.5484
and predicate ontology typing, where each extracted relation predicate is mapped to an ontology property URI. Entity ontology typing. For each extracted entity, the system selects the best-matching class URI from the target ontology. As shown in Table III, A NCHOR achieves the highest performance on every schema, with an average F1 of 0.7371. Specifically, A NCHOR outperforms the second-best baseline (LLM4CTI) by 62.5% (from 0.4521 to 0.7347) on the UCO schema. The margin shrinks on smaller schemas: A NCHOR outperforms LLM4CTI by 10.6% (from 0.7886 to 0.8724) on STIX and by 0.7% (from 0.6891 to 0.6942) on MALOnt. CTINexus, which includes the entire schema in the LLM prompt, suffers a 30.3% performance drop when scaling from MALOnt (0.6370) to UCO (0.4439). TTPDrill never exceeds 0.2305 on any schema because it relies on a simple rule-based pipeline. We observe that this performance gap widens as the schema size grows, highlighting the contrast between prompt-based schema inclusion and the dynamic hybrid ontology discovery provided by A NCHOR. As the number of candidate classes increases from 75 in MALOnt to 419 in UCO, prompt-based baselines exhaust the LLM context window and degrade due to the “lost in the middle” phenomenon [25]. In contrast, A NCHOR retrieves only the relevant ontology fragments and remains stable on the larger schema. The small performance difference on MALOnt indicates that hybrid ontology discovery offers limited benefit when the schema fits easily within a single prompt. However, its advantage becomes highly pronounced on large schemas such as UCO, where promptbased inclusion fails. Predicate ontology typing. The system maps each extracted relation predicate to a formal property URI (either ObjectProperty or DatatypeProperty). As shown in Table IV, A NCHOR achieves the highest average F1 of 0.5484, outperforming the baselines on the UCO and STIX schemas. Specifically, A NCHOR outperforms LLM4CTI by 29.5% (from 0.4000 to 0.5180) on UCO and by 9.4% (from 0.5355 to 0.5860) on STIX. On MALOnt, A NCHOR scores 0.5412, which is 4.3% below LLM4CTI at 0.5647. TTPDrill records zero
TABLE V A BLATION S TUDY ON H YBRID O NTOLOGY D ISCOVERY C OMPONENTS
Configuration
Entity Ontology Typing
Predicate Ontology Typing
Search-Only Recurse-Only Hybrid (ours)
0.9184 0.7914 0.9364
0.3142 0.6416 0.7843
performance on STIX and MALOnt, since its template-based approach cannot produce property URIs outside the predefined ATT&CK vocabulary. Predicate ontology typing is more difficult than entity ontology typing for all four systems: A NCHOR drops by 25.6% (from 0.7371 to 0.5484) and LLM4CTI drops by 22.2% (from 0.6432 to 0.5001). The gap is intuitive since a predicate’s correct property URI depends not only on the surface verb but also on the domain and range of its subject and object entities, and on the direction of the edge (e.g., uses vs. used by). Single-word embedding similarity alone is therefore insufficient, and the schema-navigation component of hybrid ontology discovery becomes the main contributor to predicate ontology typing, as analyzed in Section V-B. The marginal underperformance of A NCHOR on MALOnt (0.5412 vs. 0.5647 for LLM4CTI) is consistent with our earlier observation that hybrid ontology discovery offers limited advantage on small schemas. The key findings from the ontology typing analysis are summarized as follows: (i) A NCHOR generalizes to large hierarchical schemas where prompt-based schema inclusion baselines collapse, and (ii) predicate typing remains a harder task than entity typing for all four systems, motivating the ablation study on hybrid ontology discovery in Section V-B. B. Ablation Study We isolate two design choices within hybrid ontology discovery: (i) the combination of embedding search and recursive schema navigation, and (ii) the embedding-similarity threshold τ that controls when the system switches from search to recursive traversal. For both ablations, we use ground-truth entities and triplets as fixed inputs so that the reported scores reflect only the typing performance of each configuration, while all other parameters (ontology schema, candidate inventory, scoring rule) remain unchanged. 1) Effect of Hybrid Ontology Discovery: We evaluate three configurations on both ontology typing tasks: Hybrid (A NCHOR), Search-Only, and Recurse-Only. The Hybrid configuration combines embedding-based search with hierarchical recursive navigation, while the others rely solely on one of these strategies. As shown in Table V, the Hybrid configuration achieves the highest performance on both tasks, scoring 0.9364 on entity typing and 0.7843 on predicate typing, while the two singlestrategy baselines exhibit asymmetric behavior. On entity ontology typing, Search-Only (0.9184) approaches the Hybrid score, whereas Recurse-Only falls to 0.7914. The pattern reverses on predicate ontology typing: Recurse-Only reaches 0.6416, while Search-Only collapses to 0.3142. Notably, the