Reading tools and contents
Ontology & Knowledge Graph Engineering

Chapter 10 of 10

Evaluation, security, and graph governance

Mastery and stewardship

About 4 minutes · includes examples, an exercise, and references

Chapter at a glance

  • Evaluate mappings, identity, reasoning, queries, and decisions independently and end to end.
  • Treat graph structure and inferred conclusions as potentially sensitive.
  • Prioritize poisoning defenses around high-influence claims and identity decisions.

A graph is successful when it supports correct, timely, authorized decisions with inspectable evidence. Counting triples or classes measures volume, not utility. Build evaluation from competency questions and failure consequences. For each important question, maintain fixtures with expected bindings, allowed alternatives, required provenance, latency bounds, and authorization scope. Run them on every ontology, mapping, identity, and data release.

Evaluate layers separately. Mapping tests compare source fields with emitted RDF terms and datatypes. Validation tests exercise conforming and failing boundaries. Resolution tests measure pair and cluster quality. Reasoning tests check intended and forbidden entailments plus consistency and performance. Query tests inspect completeness, precision, cardinality, and evidence. End-to-end decision tests ask whether a user or agent reached an acceptable conclusion from an approved snapshot.

Graph security begins before SPARQL. Classify sources and predicates, minimize ingestion, and record purpose and retention. Enforce authorization on graph selection, query templates, traversal depth, and returned fields. Relationship structure can itself be sensitive: the existence of an edge, community membership, path length, or aggregate may reveal protected information. Redaction after a broad query may be too late if hidden data influenced ranking or inference.

Inference creates covert disclosure paths. A user denied direct access to an employee condition might infer it through accommodation, policy eligibility, or organizational relations. Threat modeling should enumerate sensitive conclusions and test whether authorized visible claims entail them. Where necessary, reason inside security partitions, remove unsafe axioms from a serving profile, or mediate conclusions through an approved policy service. Access control and logical entailment must be designed together.

SPARQL endpoints need bounded resources: authentication, graph allow lists, prepared operations, query timeouts, result and path limits, rate controls, audit logs, and isolated exploratory workloads. Disable or tightly govern remote SERVICE calls and graph-management updates. A syntactically valid query may still be a denial-of-service program or an inference attack.

Data poisoning targets high-centrality entities, identity merges, vocabulary mappings, and authoritative-looking provenance. Require stronger review for claims whose graph position creates large downstream influence. Compare source distributions, relationship density, new predicates, merge rates, and inference volume between releases. Sign or checksum artifacts and manifests; verify them before promotion.

Privacy rights challenge append-only ideals. Maintain a data inventory that connects people, source artifacts, assertions, derived claims, indexes, embeddings, exports, and backups. A deletion workflow must find and remove or irreversibly anonymize applicable artifacts while preserving only permitted audit evidence. Test re-ingestion prevention and downstream propagation. Governance should document jurisdiction and policy rather than claim that one deletion pattern fits every obligation.

Stewardship assigns accountable owners to namespaces, terms, shapes, source mappings, identity models, and release policies. Proposals should include competency questions, examples, semantic effects, migration, privacy and security analysis, and test results. A review board is useful only when decisions, exceptions, and turnaround are visible; otherwise it becomes a bottleneck that teams bypass with shadow predicates.

Operational indicators include release freshness, unresolved violations, lineage completeness, resolution review age, deprecated-term use, failed authorization probes, answer regressions, and consumer adoption. Pair leading indicators with incidents: a low shape-violation rate is reassuring only if shapes cover fields related to actual harm.

The mastery project is a governed decision graph. Select a bounded domain such as supplier recall impact. Publish an ontology and shapes, ingest two conflicting sources, resolve identities reversibly, represent provenance and time, run reasoning and competency queries, expose an authorized evidence API, and simulate a correction and deletion. The project passes when another engineer can reproduce the release and an independent reviewer can challenge any answer from citation to source without privileged oral context.

Key points

  • Evaluate mappings, identity, reasoning, queries, and decisions independently and end to end.
  • Treat graph structure and inferred conclusions as potentially sensitive.
  • Prioritize poisoning defenses around high-influence claims and identity decisions.
  • Govern namespaces and releases with accountable owners, tests, and migration evidence.

A release evaluation contract

Read the expected behavior in the surrounding walkthrough, then copy and run this reference implementation.

A release evaluation contractyaml
question: active-recall-supplier-impact
dataset_release: candidate
authorization_fixture: product-safety-analyst
expected:
  must_include: [https://kg.example/supplier/S-7]
  must_exclude: [https://kg.example/supplier/S-9]
  evidence_per_result: 2
  max_results: 100
  p95_latency_ms: 800
security:
  forbidden_graphs: [hr-private, tenant-b]
  max_path_depth: 3

Worked examples

Toy

A forbidden entailment test

A visible eligibility claim and a subclass axiom reveal a hidden medical classification.

Encode the attacker-visible dataset and query as a regression fixture. Remove or partition the unsafe inference path, then prove the protected class is absent from both direct and indirect results.

  • Attacker knowledge
  • Entailment regime
  • Negative assertion test

System

Poisoned ownership edge

One newly ingested edge connects a sanctioned entity to a major supplier and changes thousands of risk paths.

A release-diff alert detects abnormal influence. Promotion pauses until source authenticity, extraction span, identity decisions, and edge semantics pass elevated review.

  • Centrality change
  • Evidence authenticity
  • Blast radius

Exercise

Complete the governed knowledge-graph capstone

Deliver a reproducible graph release and defend one consequential answer under correction, attack, and access-control tests.

  1. Run layer-specific quality suites.
  2. Attempt one inference and one query-cost attack.
  3. Simulate poisoned evidence and a mistaken merge.
  4. Execute correction, deletion, rollback, and audit reconstruction.

Success criteria

  • Competency answers include authorized evidence.
  • Security tests cover structural and inferred disclosure.
  • Every release artifact and exception has an owner.
  • A new operator can reproduce and restore the system from documented artifacts.

Reflect: Which metric would have looked healthy while the most consequential failure remained invisible?

References and further reading