Repository navigation
Fixes #37352: Skip and report what the native model cannot hold when importing real-world RDF - #37360
Conversation
…-world RDF The native RDF importer failed the whole import on the first statement it could not represent, which rejected every upstream OWL/RDFS ontology we tried. It now reads what the native model holds and returns a typed, deterministic report of everything it left out, grouped by reason and predicate with a bounded sample of subjects. - NativeOntologyRdfReader is extracted from the importer; RdfSourceNormalizer picks one language (untagged, then en, then the first tag) and one value for single-valued fields before reading; RdfSkipLedger builds the report. - rdfs:Class and rdf:Property are read; common annotations, owl:imports, and individuals that are neither classes nor concepts are skipped and reported. Native exports keep their individuals, so a re-import reports zero skipped. - schema:domainIncludes and rangeIncludes are skipped: native domain and range lists are intersections, so a union cannot be stored faithfully. - NativeOntologyImportSummary gains skippedStatements; the preview shows an N statements skipped disclosure. - Nine upstream ontologies are bundled as test resources with expected counts. - ADR 2026-10-19 replaces strict parsing with the skip-and-report contract.
… of failing on apply
…depend on parse order The skipped-statement count for a blank-node list or restriction depended on which cell of the list was skipped first, so reading the same bytes reported different totals. Blank nodes no other leftover reaches are now skipped before the ones inside a structure, which makes the count a property of the data. Only nodes inside a blank-node cycle still follow statement order. Tests read a list-heavy source repeatedly and read three upstream ontologies with their statements shuffled, expecting identical documents and skip reports.
…he stored one Storage adds an empty owners list to a stored property, so the plan rebuilt at install time differed from the stored plan and installing ssn after sosa failed with 412. The comparison now drops empty owners lists from both sides.
Previewing the W3C ORG ontology listed 51 operations and applying them failed with "Declare or import the referenced property: org#hasMember". The property's range is foaf:Agent, which ORG never declares, so the preview refused the property; the restriction axiom that names it was checked before that and stayed in the plan. The preview now validates the new and changed properties and axioms with the checks a save runs, against the target as the surviving plan would leave it, and repeats until nothing more is refused, so a refusal cascades to whatever names the refused definition. Refused definitions are listed as skipped with the reason apply would give. NativeOntologyUpstreamApplyIT previews and applies each of the nine upstream fixtures into a fresh ontology, and SOSA then SSN into one ontology. The v9 amendment records the rule.
…nge shapes the importer skips Statements read back in the graph's hash order, so a property's domain list differed between a pack read module by module and the same pack read as one body. An install job re-derives its plan on resume, so the order must not depend on how the model was built. FHIR R5 date and gYear unions and FIBO custom datatypes are refused by a save. The preview cascade already skips the restrictions over them; the test keeps it so.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
❌ UI Checkstyle Failed❌ Bundle Runtime CheckA route chunk loads but one of its chunks still exports 🔍 ESLint findings in this PR's files — 0 error(s), 1 warning(s)Errors block the build. Warnings do not yet — they are rules whose backlog is still 0 error(s), 1 warning(s) across 1 changed file(s).
All findings
Fix locally (fast - only checks files changed in this branch): make ui-checkstyle-changed |
Code Review ✅ Approved🟡 Medium risk · Changing RDF imports to accept partial ontologies while skipping unsupported statements could leave important definitions absent despite a successful import. Imports of real-world OWL/RDFS ontologies now skip and report the statements the native model cannot hold, instead of failing the whole import, and the import preview shows a skipped-statements disclosure. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
…review spec (#37390) * test(playwright): expect a skipped xsd:date range in the ontology import preview #37360 changed the native RDF importer to skip and report statements the model cannot hold instead of failing the preview. The import review spec still expected the old error alert, so it failed on every nightly AUT run. Assert the skipped-statements disclosure and that the rest applies. * chore(playwright): auto-refresh impact-map.generated.json --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>



Describe your changes:
Fixes #37352
The native RDF importer failed the whole import on the first statement it could not represent, which rejected every upstream OWL or RDFS ontology we tried. It now reads what the native model holds and returns a typed, deterministic report of what it left out, grouped by reason and predicate with a bounded sample of subjects. The import preview shows an "N statements skipped" disclosure.
Part 1 of 6 of the Ontology Library work: real-world RDF, a resumable install job, 50,000-member ontologies, property hierarchies, verbatim upstream packs, and serving large releases from Fuseki. Merge from the bottom; this PR targets
main, and each PR above it targets the PR below it, so its diff shows only its own changes. PRs 5 and 6 both target PR 4 and do not depend on each other.Type of change:
High-level design:
NativeOntologyRdfReaderis extracted fromNativeOntologyRdfImporter.RdfSourceNormalizerpicks one language per literal (untagged, thenen, then the first tag) and one value for single-valued fields before reading.RdfSkipLedgerbuilds the skipped-statement report.rdfs:Classandrdf:Propertyare read. Common annotations,owl:imports, and individuals that are neither classes nor concepts are skipped and reported. A native export keeps its individuals, so re-importing it reports zero skipped.schema:domainIncludesandrangeIncludesare skipped, because native domain and range lists are intersections and a union cannot be stored faithfully. Data assertions whose literal datatype OWL 2 cannot hold are skipped instead of failing on apply.org:hasMemberranges over the undeclaredfoaf:Agent.ownerslists from both sides, because storage adds one; installing SSN after SOSA failed with 412 before.NativeOntologyImportSummarygainsskippedStatements(additive, optional).Decision record: ADR:2026-10-19-native-ontology-imports-use-working-drafts, amendment v9 (RDF import skips and reports what the native model cannot hold).
Tests:
CI follow-up (2026-11-08)
Fixed the inherited Test Report failure. Pipeline encryption already uses the pipeline UUID, but the DBT unit fixture omitted it and secret ownership inventory still used the name. The fixture now has a stable UUID, inventory uses the same UUID root as encryption, and the existing API tests check UUID paths, including delayed cleanup after deletion and recreation.
The original unit test reproduced the encryption error. With only the fixture corrected, it failed because cleanup retained the owned authorization token. The production fix then passed all focused checks on this PR's branch:
SecretMapEntriesExternalStoreTest,AWSSSMSecretsManagerTest,AWSSecretsManagerTest, andEntityRepositorySecretStorageTest.SecretsManagerNullSecretIT, using the MySQL + Elasticsearch parallel lane. These cover header removal, direct/cascade deletion, user-owned references, and delayed cleanup preserving replacement credentials.mvn spotless:apply spotless:check, impact-map validation, and commit hooks passed. Independent review of the three-file follow-up found no issues.mvn -nsu -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel -Dit.test=SecretsManagerNullSecretIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=AWSSSMSecretsManagerTest,AWSSecretsManagerTest,EntityRepositorySecretStorageTest,SecretMapEntriesExternalStoreTest -Dsurefire.failIfNoSpecifiedTests=false.Use cases covered
Unit tests
UpstreamOntologyImportTest(new),NativeOntologyImportProfileCascadeTest(new),NativeOntologyRdfImporterTest,NativeOntologyImportItemsTest,NativeOntologyImportListRulesTest,OntologyPackInstallationsTest; JestOntologyNativeImportPanel.test.tsx.OntologyPropertyRules,NativeOntologyRdfReader,OntologyExpressionRdfReader,RdfSkipLedgerandRdfSourceNormalizerhave no class-named unit test; they are exercised throughNativeOntologyRdfImporterTestandUpstreamOntologyImportTest, which read real upstream files through them.Backend integration tests
NativeOntologyUpstreamApplyIT(new),NativeOntologyImportPreviewIT,NativeOntologyImportReviewIT(updated).This PR's focused checks (
make java_affected ARGS="--scope focused"): unitNativeOntologyImportItemsTest,NativeOntologyImportListRulesTest,NativeOntologyImportProfileCascadeTest,NativeOntologyRdfImporterTest,OntologyPackInstallationsTest,OntologyStructureValidatorTest,UpstreamOntologyImportTest; ITsNativeOntologyImportPreviewIT,NativeOntologyImportReviewIT,NativeOntologyUpstreamApplyIT. All are in the runs below and passed.Run by hand on the top of the stack (PR 5 at
78c3b7308a6, rebased onmainat3aaedcaaf87), which contains this PR's changes; Java 21, MySQL + Elasticsearch, clean build of the reactor (mvn clean install -DskipTests -pl openmetadata-integration-tests -am, BUILD SUCCESS). Not generated bymake java_affected_run.openmetadata-service, every test underontology/,rdf/,resources/ontology/,jdbi3/Ontology*,jdbi3/JobDAOTest,jobs/):Tests run: 2483, Failures: 0, Errors: 0, Skipped: 0.-Pmysql-elasticsearch -DintegrationTests.lane=parallel -Dit.test='Independent*Ontology*IT,NativeOntology*IT,OntologyPackResourceIT'):Tests run: 535, Failures: 1, Errors: 0, Skipped: 38. The one failure isNativeOntologyPartialImportIT.droppingTheRelationshipWithItsConceptOrKeepingEverythingApplies, a test this stack does not touch: it filtersontologyAxiomsbyontology, which the endpoint ignores (it takesontologyId), so it reads the first 50 axioms of the whole database and misses its own when parallel tests have written more. Rerun alone withIndependentOntologyReleaseIT:Tests run: 19, Failures: 0, Errors: 0, Skipped: 0. MySQL logged 36EntityRelationshipDAO.batchDeleteTodeadlocks during cleanup in that run; none failed a test (MySQL deadlocks between concurrent writes to different native ontologies (incomingInverses FOR UPDATE, batchDeleteTo) #37357).-DintegrationTests.lane=rdf -DrdfContainerImage=openmetadata/fuseki:6.2.0-318ff87,RdfRoundTripFidelityIT,RdfOntologyActivationIT,RdfBlueGreenRebuildIT,RdfLibraryPackActivationIT,RdfOntologyPropertyHierarchyIT):Tests run: 48, Failures: 0, Errors: 0, Skipped: 0.python3 .github/scripts/plan_local_java_tests.py --check-branch: the map is complete on this branch.mvn spotless:check: BUILD SUCCESS.make java_affectedselects the full IT suite for this stack); those run in the merge queue.src/components/governance/ontology src/components/OntologyExplorer src/hooks/governance/ontology:Test Suites: 141 passed, 141 total; Tests: 1596 passed, 1596 total.tsc --noEmit: no errors except the existingCustomPropertiesDetailPage.tsx(135,14)error onmain.yarn ui-checkstyle:changedandyarn ui-checkstyle:playwright:changedon every UI file the stack changes: exit 0, no diff.Ingestion integration tests
Playwright (UI) tests
Manual testing performed
None beyond the automated tests above.
UI screen recording:
Not done. This PR changes Ontology Studio UI (the native import preview's skipped-statements disclosure), so the pr-checklist recording item applies. No Docker build with sample data was run and no recording is attached; the matching checklist box below is left unchecked. The UI evidence is the Jest, type-check and UI checkstyle runs listed under Tests.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.nativeOntologyImportSummarygains an optionalskippedStatements; it is a response type, so no migration.REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.Reviewed
70bdf0622e6against REVIEW.md as a pass over this PR's production diff (authorization on new or changed endpoints, transactions and retries, caches, job types, schema compatibility, and the test map). It was run by the agent that prepared the stack; no independent reviewer was available for this run. No 🔴 findings.docs/decisions/(see itsREADME.md). This description is gone fromgit logafter the squash-merge. Amends ADR:2026-10-19-native-ontology-imports-use-working-drafts (v9).Summary by Gitar
SecretsManagerThis will update automatically on new commits.