Source-linked AI summary

TCMaster: Confidence-Aware Querying and Workload-Guided Physical Design for Multi-Source Traditional Chinese Medicine Knowledge Graphs

Zheng Chen, Yuzhu Li, Haoxuan Li, Zhongde Zhang, Lianshun Jin, Peiwu Qin

arXiv:2609.25712v1cs.AI

TL;DR

Multi-source TCM knowledge graphs need query mechanisms that expose evidence reliability and exploit skewed domain structure. TCMaster combines provenance-level edge confidence, confidence-aware path queries, and workload-guided physical design; experiments report gains in attribute lookup, target counting, path filtering, and clinical QA retrieval.

  • Problem

    TCM knowledge bases rarely expose edge reliability and provenance or provide physical designs for skewed graph workloads, despite heterogeneous evidence and interactive multi-hop retrieval needs.

    Source: §I · p. 1
  • Method

    TCMaster builds a multi-source property graph with provenance-level edge confidence, confidence-aware Cypher path queries, and workload-guided structures including direction selection, bitmaps, and shortcuts.

    Source: §I · pp. 1–2
  • Results

    1.47× faster attribute lookup, 4.42× faster high-fanout target counting, 39.3% of low-quality paths filtered at θ = 0.18, and 20.0 percentage points higher TCMbench QA accuracy over the LLM baseline.

    Source: §I · p. 1
  • Takeaways & Limitations

    TCMaster makes reliability and stable ontology structure visible to query execution in a controlled way rather than making every TCM query faster.

    Source: K. Discussion and Threats to Validity · p. 11

    When a workload lacks reliability structure or stable ontology skew, the native graph engine remains competitive and TCMaster should avoid unnecessary rewrites.

    Source: K. Discussion and Threats to Validity · p. 11

Abstract

from arXiv · show

Multi-source knowledge graphs (KGs) need query mechanisms that expose reliability and exploit domain structure. This paper presents TCMaster, a property-graph query substrate for confidence-aware traversal and workload-guided physical design over Traditional Chinese Medicine KGs. TCMaster integrates pharmacopoeias, prescriptions, molecular databases, and LLM-extracted micro-semantics into a KG with approximately 221K entities and 723K base edges. It annotates edges with provenance-level confidence, rewrites Cypher queries with confidence predicates, ranks multi-hop paths under PRODUCT, MIN, or weighted-average policies, and uses ontology skew through direction selection, herb-attribute bitmaps, and materialized shortcut edges. On Neo4j, direction selection improves attribute lookup by a factor of 1.47, shortcuts accelerate high-fanout target counting by a factor of 4.42, confidence filtering removes 39.3 percent of low-quality heterogeneous paths, and KG retrieval improves TCMbench QA accuracy by 20.0 percentage points.

I. INTRODUCTION

TCM knowledge bases contain heterogeneous evidence but rarely expose reliability, provenance, or physical designs for skewed graph workloads. TCMaster combines confidence-aware traversal with workload-guided physical design for multi-source TCM knowledge graphs.

I. INTRODUCTION

  • TCM knowledge bases rarely expose edge reliability, provenance, or physical designs for ontology-skewed graph workloads, despite heterogeneous evidence and interactive multi-hop use cases.TCM attributes with values shared by more than 15K Herb nodes create predictable traversal asymmetry.Source: §I · p. 1

B. Confidence-Annotated Knowledge Graph

  • Every base edge carries provenance-level confidence, and Cypher queries can apply confidence predicates and rank paths using PRODUCT, MIN, or weighted-average policies.Source levels distinguish evidence types, including curated, LLM-extracted, and predicted edges.Source: §I · p. 1, B. Confidence-Annotated Knowledge Graph · p. 2

I. INTRODUCTION

  • TCMaster is a data-management substrate, not a clinical LLM, diagnosis protocol, probabilistic database, or universal graph optimizer.Its scope is making reliability and ontology-induced asymmetry visible to query execution.Source: §I · p. 1
  • Direction selection improves attribute lookup by 1.47×, shortcuts accelerate high-fanout target counting by 4.42×, and KG retrieval improves TCMbench QA accuracy by 20.0 percentage points over the LLM baseline.Confidence filtering removes 39.3% of low-quality heterogeneous paths at θ = 0.18.Source: §I · p. 1

A. Multi-Source TCM Knowledge Graph

  • TCMaster integrates about 221K entities and 723K base edges across five knowledge layers, with Herb nodes bridging molecular, prescription, micro-semantic, and clinical knowledge.Frequently queried TCM attributes are represented as first-class graph nodes.Source: A. Multi-Source TCM Knowledge Graph · p. 2

C. Confidence-Bounded Path Query

TCMaster defines confidence-bounded path queries and realizes them in a system that ingests, cleans, and stores multi-source TCM data with confidence metadata and derived physical structures. Its query processing and storage design preserve provenance while using workload-guided rewrites and structures.

C. Confidence-Bounded Path Query

  • For a query pattern Q, aggregation function A, and threshold θ, TCMaster returns matching paths whose aggregated edge confidence meets the query-time threshold.Supported path-scoring policies are PRODUCT, MIN, and weighted average, with the latter weighting edges closer to the query start more heavily.Source: C. Confidence-Bounded Path Query · p. 2

III. SYSTEM ARCHITECTURE

  • The system architecture connects data ingestion and cleaning to confidence-annotated Neo4j storage, workload-guided query processing, and downstream application modes.Base edges remain provenance-complete, while physical structures are derived views that can be rebuilt or disabled without changing the logical ontology.Source: §III · p. 3, Figure 1 · p. 3

A. Data Integration and Quality Layer

  • TCMaster integrates four source categories and applies seven cleaning rules before ingestion; therapeutic-category triples fall from 5,095 to 724, while audited extraction precision rises from 91.2% to 95.5%.Discarded tuples remain in logs but do not enter the executable graph.Source: A. Data Integration and Quality Layer · p. 3

B. Knowledge Graph Layer

  • Neo4j stores the five-layer ontology and adds per-edge confidence and provenance tags, per-herb attribute bitmaps, and materialized REACHES_TARGET shortcuts.Confidence controls evidence admissibility, bitmaps reduce local attribute-filtering cost, and shortcuts reduce repeated cross-layer traversal cost.Source: B. Knowledge Graph Layer · p. 3

C. Query Processing Layer

TCMaster’s query layer rewrites and executes Cypher with confidence-aware traversal and path scoring, returning ranked paths with provenance. Its application modes share a result object, while edge annotations expose source reliability and path policies provide distinct ways to rank evidence.

C. Query Processing Layer

  • TCMaster returns ranked paths with rewrite decisions and provenance-bearing edge sequences; clinical KG-RAG, safety auditing, and drug-target discovery share the same result-object schema.Applications vary by templates and thresholds, with optional shortcut expansion.Source: C. Query Processing Layer · p. 3, D. Application Layer · p. 3

A. Confidence Annotation Model

  • Every edge receives a confidence score and provenance label through two-pass annotation, preserving available per-edge values and assigning type-level defaults where they are absent.The procedure produces 722,671 annotated edges.Source: A. Confidence Annotation Model · pp. 3–4

B. Confidence Semantics and Query Guarantees

  • Edge confidence represents source reliability and validation status, while provenance records the score’s category; path confidence is computed after candidate paths return.Source-category scores encode a stable reliability ordering, not calibrated probabilities of clinical truth; inherited edge scores take precedence over type defaults.Source: B. Confidence Semantics and Query… · p. 4, A. Confidence Annotation Model · p. 4
  • Thresholding is monotone in θ, and raising a validated edge’s score cannot lower a containing path’s PRODUCT or MIN score.Returned paths also retain edge sequences, confidence scores, and source labels for distinguishing pharmacopoeia-only from mixed-source evidence.Source: B. Confidence Semantics and Query… · p. 4

C. Confidence Query Rewriting

TCMaster injects confidence predicates into Cypher relationship patterns, then extracts edge scores to aggregate and rank multi-hop paths. Edge filtering and path ranking are separate stages, allowing query templates and ranking policies to remain inspectable.

C. Confidence Query Rewriting

  • The rewriter adds a confidence-threshold predicate for each named relationship variable, conjoining the predicates with existing WHERE conditions or inserting a WHERE clause when needed.Anonymous relationships are named first; projection, grouping, ordering, and limits remain unchanged.Source: C. Confidence Query Rewriting · pp. 4–5
  • The rewriting deliberately preserves query projections and aggregation clauses, keeping transformations deterministic, executable in Neo4j, and auditable against the original query.For m paths of maximum length ℓ, extraction and aggregation cost O(mℓ), plus O(m log m) ranking.Source: C. Confidence Query Rewriting · pp. 4–5, D. Path Confidence Aggregation · p. 5

D. Path Confidence Aggregation

  • PathRanker extracts per-edge confidence scores and supports PRODUCT, MIN, and WAVG aggregation, respectively reflecting cumulative confidence, weakest-edge confidence, and a position-weighted average.WAVG weights edges nearer the query start more heavily and is described as supporting exploratory analysis.Source: D. Path Confidence Aggregation · p. 5
  • Paths below θ are discarded, while remaining paths are ranked by descending aggregate confidence and truncated to top-k, defaulting to 20.Edge predicates prune before execution; path aggregation provides the final policy check, and exploratory retrieval can set the edge threshold to zero.Source: D. Path Confidence Aggregation · p. 5

E. Incremental Confidence Updates

TCMaster supports edge-level confidence refinement and addresses TCM workloads whose high-cardinality herbs connect to small attribute sets. Its direction-selection rewrite starts attribute-constrained searches from the low-cardinality side.

E. Incremental Confidence Updates

  • Expert validation or rejection updates an edge’s confidence and marks its source as USER_VERIFIED, without triggering graph-wide recomputation.The cost depends on the number of matched relationships rather than graph size.Source: E. Incremental Confidence Updates · p. 5
  • Batch confidence updates change only matched edges, with 100-or-more-edge batches sustaining 4.7–5.4 ms per edge and 1,000-edge batches completing within 5 seconds.Neo4j transactions commit a feedback batch atomically; dependent shortcuts are flagged stale and lazily recomputed.Source: E. Incremental Confidence Updates · p. 5

V. WORKLOAD-GUIDED PHYSICAL DESIGN FOR ONTOLOGY-SKEWED GRAPH QUERIES

  • TCM workloads repeatedly traverse from 15K+ herbs to low-cardinality attributes or across knowledge layers, a skew that general-purpose cost-based optimizers may miss.The ontology snapshot includes 15,092 Herb nodes, 44,595 Ingredient nodes, and 15,515 Target nodes, versus 4–12 nodes for the listed attribute types.Source: §V · p. 5, A. Cardinality Skew in TCM Ontology · p. 5

B. Cardinality-Based Direction Selection

  • For herb-to-attribute constraints, TCMaster reverses traversal to begin at the low-cardinality attribute node rather than scanning 15K+ candidate herbs.Multiple attribute-direction reversals are applied simultaneously, while users can write the natural Herb-to-Attribute pattern.Source: B. Cardinality-Based Direction Selection · pp. 5–6

C. Bitmap-Based Attribute Pruning

TCMaster uses compact herb-attribute bitmaps for local filtering and materialized shortcuts for frequent Prescription-to-Target reachability. The bitmap test is not universally faster than traversal, and shortcut construction is intended for offline preparation rather than per-query use.

C. Bitmap-Based Attribute Pruning

  • Each Herb receives a 28-bit bitmap for the ontology’s 28 attribute values, with multiple values per dimension represented in a non-mutually-exclusive encoding.The bitmap is computed during ingestion; the current snapshot assigns a bitmap property to 11,014 herbs and performs 31,426 dimension updates.Source: C. Bitmap-Based Attribute Pruning · p. 6
  • Bitmap layout assigns contiguous bit blocks to Nature, Flavor, Meridian, and Toxicity, following ontology order rather than observed frequency.This keeps the encoding stable across graph snapshots and makes bits interpretable during debugging.Source: C. Bitmap-Based Attribute Pruning · p. 6
  • A bitmap test can replace a Herb-to-Meridian two-hop traversal with a one-hop lookup and constant-time bitwise check, but only as a local test after candidate herbs exist.The paper explicitly cautions that bitmap filtering is not universally faster than graph traversal.Source: C. Bitmap-Based Attribute Pruning · p. 6

D. Materialized Cross-Layer Shortcuts

  • Materialized shortcuts summarize the frequent Prescription→Herb→Ingredient→Target pattern as direct Prescription-to-Target reachability, not as new biomedical assertions.Batched construction deduplicates prescription-target pairs and assigns each shortcut confidence 0.8075, the PRODUCT of CURATED and two AUTHORITATIVE edges.Source: D. Materialized Cross-Layer Shortcuts · p. 6
  • Creating 28.75M shortcut edges takes about 74 minutes, so TCMaster treats shortcuts as an offline physical structure rather than constructing them per query.Shortcuts are lazily invalidated after constituent-edge updates; high-update deployments should rebuild them offline or disable them.Source: D. Materialized Cross-Layer Shortcuts · p. 6

E. Rewrite Applicability and Cost Intuition

TCMaster applies physical-design rewrites only when workload structure supports them, balancing traversal savings against planner behavior and maintenance cost. Its evaluation covers implementation, setup, and both favorable and competitive workload patterns.

E. Rewrite Applicability and Cost Intuition

  • Direction reversal helps when queries bind low-cardinality ontology values before expanding to high-cardinality entities; bitmaps suit repeated local checks, while shortcuts suit reused long traversals.These rewrites offer little benefit for selective entity starts or single top-k lookups; infrequent exploratory traversals remain on the native graph engine, and shortcut storage and maintenance are a cost.Source: E. Rewrite Applicability and Cost… · pp. 6–7

VI. IMPLEMENTATION

  • TCMaster runs on Neo4j 4.4 with edge confidence/provenance, 28-bit Herb attribute bitmaps, and 28.75M materialized shortcuts; offline structures are enabled only for supported query patterns.The implementation separates ETL, confidence annotation, query processing, and optimization; the optimizer applies rewrites only when query patterns match.Source: §VI · p. 7

VII. EXPERIMENTAL EVALUATION

  • The evaluation frames five database-system questions spanning rewritten-query latency, sampled-scale behavior, auditable facts, auxiliary link prediction, and downstream retrieval.KG-RAG is treated as an application-level validation, not evidence for a new clinical model.Source: §VII · p. 7

A. Experimental Setup

  • Benchmarks use Neo4j 4.4 with 8 GB heap, 100 sampled start entities, and three post-warmup runs; Base disables TCMaster rewrites, bitmaps, and shortcuts.Base uses the same graph, constraints, and indexes as the optimized condition.Source: A. Experimental Setup · p. 7

B. Workload Characterization

  • The workload suite stresses attribute-cardinality skew, cross-layer traversal, grouping, high-fanout matching, and safety audit rather than hop count alone.It includes selective queries where Neo4j may already be competitive as well as cross-layer and aggregation cases where provenance or physical structures matter.Source: B. Workload Characterization · p. 7, Table IV · p. 8

C. Query Performance

Workload-guided physical design yields its clearest gains for attribute lookup and complete high-fanout expansion, while bitmap and combined rewrites can add cost. Across evaluated clinical templates, latency is interactive but remains workload dependent.

C. Query Performance

  • Six of seven workloads stay below 10 ms at P95, but Q6 reaches 17.52 ms; high-fanout pattern matching remains the principal latency bottleneck.Across representative workloads, Q4's 4-hop latency is 7.12 ms versus 8.41 ms for 1-hop Q1, showing latency is not monotonic with hop count.Source: C. Query Performance · p. 8, Table V · p. 8
  • The latency profile supports interactive retrieval for evaluated lookup, safety, and target-discovery templates, not a workload-independent latency claim.Q2, Q5, and Q7 have similar mean latency despite different semantics, while Q1 is slower when lookup begins in higher-degree Herb neighborhoods.Source: C. Query Performance · p. 8

D. Optimization Evaluation

  • 1.47× faster property lookup (9.40 ms to 6.41 ms) follows direction reversal, while target counting over prescriptions with 5K–8K reachable targets is 4.42× faster (51.19 ms to 11.57 ms).Shortcuts improve top-k target lookup only 1.17× (13.62 ms to 11.64 ms) and complete enumeration 1.19× (336.08 ms to 283.43 ms).Source: D. Optimization Evaluation · p. 8, Table VI · p. 8
  • Bitmap pruning gives little benefit for single-attribute filtering (1.03×), and multi-attribute probes are mixed when bitmap scans displace selective attribute-node access.Bitmaps are treated as a compact representation for repeated local checks, not the main accelerator.Source: D. Optimization Evaluation · p. 8
  • Shortcut lookup plus a confidence predicate is slower than unoptimized top-k traversal (0.65×), because high-confidence shortcut edges leave little for the predicate to prune.The rewrite policy therefore avoids assuming that individually useful transformations compose beneficially.Source: D. Optimization Evaluation · p. 8
  • The results support exploiting ontology skew only when a workload exposes the matching bottleneck; gains are limited for top-k workloads already handled well by Neo4j.The selective policy uses direction reversal for Herb–attribute patterns below cardinality 32, shortcuts for aggregate counts or complete enumeration, and bitmaps for repeated local checks.Source: D. Optimization Evaluation · pp. 8–9

E. Core-Layer Scalability

The controlled core-layer scale check finds bounded but non-monotonic latency, while extraction validation reports strong precision alongside incomplete prescription-composition recall. The paper treats these as bounded robustness and data-quality evidence, not universal scaling or completeness claims.

E. Core-Layer Scalability

  • Core-layer latency remains bounded but non-monotonic across sampled scales; Q3 falls from 6.50 ms at 25% to 1.99 ms at 100%.Q1 temporarily rises to 11.67 ms at 50%, versus 7.98 ms at 25%, with dense attribute out-degree offered as the explanation.Source: E. Core-Layer Scalability · p. 9, Figure 2 · p. 9, Table VII · p. 9
  • The scale experiment is a robustness check for latency-critical L1–L3 paths, not a claim about arbitrary graph scaling; extending controlled scale-up to L4–L5 remains future work.The full 221K-node graph remains the primary setting for reported workload latency.Source: E. Core-Layer Scalability · p. 9

F. Data Quality and Extraction

  • Validation reports 93.7% herb–ingredient fuzzy precision, 100.0% ingredient–target precision, and 95.5% audited precision for LLM micro-semantics, while prescription composition recall is 76.0% (F1 = 72.4%).The authors attribute lower recall to reference formulary incompleteness relative to multi-source coverage.Source: F. Data Quality and Extraction · p. 9
  • TCMaster preserves provenance and confidence rather than forcing one unqualified truth table because source naming, granularity, and composition variants limit uniform recall.LLM-extracted relations are checked against source text, linked to core entities, and assigned lower confidence than curated or pharmacopoeia-derived relations.Source: F. Data Quality and Extraction · p. 9

G. Structural Validation via Link Prediction

The structural validation, clinical QA, and confidence-query analyses examine TCMaster’s diagnostic behavior, downstream retrieval, and workload-dependent confidence operations.

G. Structural Validation via Link Prediction

  • RotatE MRR was 0.185 (S1), 0.157 (S2), 0.131 (S3), and 0.136 (S4), a nonmonotonic structural probe rather than primary quality evidence.The authors caution that lower MRR does not mean a layer is harmful; candidate-space expansion and relation heterogeneity can make prediction harder.Source: G. Structural Validation via Link… · pp. 9–10, Figure 4 · p. 10

H. Downstream Clinical QA (TCMbench)

I. Confidence Query Analysis

  • At θ = 0.18, Q3 filters 39.3% of paths; Q1, Q2, Q5, and Q7 retain all results, while thresholds above 0.35 remove all Q3 paths.The threshold mainly affects paths combining heterogeneous evidence, making its effects workload-specific.Source: §I · pp. 10–11, Table IX · p. 11
  • PRODUCT, MIN, and WAVG score the same 184.5 average paths at mean confidences of 0.0248, 0.1347, and 0.3786, respectively.The paper characterizes PRODUCT as conservative, WAVG as preserving exploratory recall, and MIN as reflecting the weakest edge.Source: §I · p. 11
  • 4.67 ms per edge for 500-edge confidence-update batches compares with 28.78 ms per edge for 10-edge batches.The 100- and 1,000-edge batches cost 5.37 and 4.83 ms per edge, respectively; updates avoid full-graph recomputation.Source: §I · p. 11

J. Case Study: Prescription Evidence Inspection

The case study illustrates auditable prescription evidence inspection; the discussion bounds TCMaster’s gains by workload assumptions, evaluation scope, and rule-based rewrite selection.

J. Case Study: Prescription Evidence Inspection

  • At PRODUCT confidence ≥0.7, Ephedra Decoction inspection returned Hot/Pungent (0.90), a curated toxicity warning (0.85), and a full path confidence of 0.72 in 6.7 ms.The example supports expert evidence triage and is not presented as clinical deployment or a replacement for clinical judgment.Source: J. Case Study: Prescription Evidence… · p. 11

K. Discussion and Threats to Validity

  • Gains concentrate in workloads with confidence heterogeneity, ontology skew, and repeated cross-layer traversal; some rewrites do not outperform Neo4j.The stated boundary is controlled exposure of reliability and stable ontology structure, not faster execution for every TCM query.Source: K. Discussion and Threats to Validity · p. 11
  • Evaluation is bounded to Neo4j 4.4 on one hardware setting and clinical templates; confidence scores are source-category scores, and Safety Audit accuracy is insufficient for autonomous clinical use.The external-validity claim is limited to domains with small controlled ontologies linked to high-cardinality entities.Source: K. Discussion and Threats to Validity · pp. 11–12
  • Rule-based rewrite selection favors inspectability, but learned or cost-based selectors would require more query templates and cardinality observations.The evaluation emphasizes explainable applicability, with structural preconditions, measured positive cases, and boundary cases.Source: K. Discussion and Threats to Validity · p. 12

VIII. RELATED WORK

The related-work section distinguishes TCMaster from TCM resources, uncertainty systems, graph optimization, and KGE or KG-RAG efforts; the conclusion reports its substrate and bounds its claims.

VIII. RELATED WORK

  • TCM resources provide molecular, syndrome, symptom, and prescription data, while biomedical KGs do not model TCM attributes, prescriptions, or provenance-aware clinical query processing.TCMaster targets confidence-annotated path querying and ontology-aware execution over a multi-source TCM KG.Source: §VIII · p. 12
  • TCMaster uses deterministic cleaning, source-level edge confidence, Cypher predicates, and path ranking; its physical designs exploit ontology skew selectively rather than applying universal rewrites.The related work contrasts this operational property-graph approach with probabilistic databases and provenance systems, and notes that some rewrites do not outperform native top-k or shortcut-plus-confidence execution.Source: §VIII · p. 12
  • KGE results serve as diagnostic probes of structural predictability, while TCMaster’s KG-RAG work focuses on the data-management substrate and separately evaluates query workloads and downstream accuracy.MRR also depends on candidate space, relation heterogeneity, and negative sampling, so it does not alone establish data quality.Source: §VIII · p. 12

IX. CONCLUSION AND LIMITATIONS

  • TCMaster annotates 723K base edges with source-level confidence and uses direction selection, attribute bitmaps, and shortcuts; reported gains are 1.47×, 4.42×, and 20.0 pp for attribute lookup, target counting, and clinical QA.The conclusion presents these as results of a confidence-aware query substrate for multi-source TCM knowledge graphs.Source: §IX · p. 12
  • Evidence is bounded by L1–L3 scale tests and fixed top-3 full-recall KG-RAG; safety outputs are expert-review aids, not deployable clinical decisions.Source scores remain fixed, the case study covers one prescription, and bitmap and shortcut-plus-confidence rewrites do not consistently outperform Neo4j. Future work includes dynamic confidence learning, adaptive retrieval, and generalizing ontology-skew optimization.Source: §IX · p. 12

ARTIFACT AND DATA AVAILABILITY

  • The review artifact includes source code, experiment scripts, query templates, configurations, results, and a Neo4j dump; post-publication plans include code release and downloadable graph snapshots.The artifact description also provides load instructions, schema documentation, checksums, and verification scripts.Source: ARTIFACT AND DATA AVAILABILITY · pp. 12–13

AI-GENERATED CONTENT ACKNOWLEDGEMENT

  • The authors report using DeepSeek-V3 for micro-semantic extraction and audit scoring and Claude for data processing, scripting, and editing; they say they reviewed and verified the AI-generated work.Source: AI-GENERATED CONTENT ACKNOWLEDGEMENT · p. 13
Loading 2609.25712v1…