Skip to content

test: cover a complete generated-schema document end to end - #63

Merged
jdsika merged 1 commit into
mainfrom
test/naturalistic-schema-document
Sep 18, 2026
Merged

jdsika merged 1 commit into
mainfrom
test/naturalistic-schema-document

Conversation

@jdsika

@jdsika jdsika commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Adds the document-level correctness net that #61's canary implies: a complete,
naturalistic generated-schema document, checked end to end.

Why

From the linkml/linkml#3985 review, this comment:

i think that there should be a graph isomorphism test with a complex
naturalistic schema, but that might work better in the downstream package
tests than here - another test i was looking for and did not find was "is the
transformation here correct across the fuckery that is possible in RDF"

The seeded graphs in properties/ exercise each hard shape on its own. This
covers the other risk: one document where they interact.

What

tests/integration/test_naturalistic_schema.py - an OWL/SHACL document that
combines, in a single graph:

  • two owl:unionOf lists sharing a tail cell, and a list whose member is a list
  • a blank node referenced from two subjects, and a blank-node cycle
  • OWL restrictions, SHACL property shapes, and an sh:ignoredProperties list
  • language-tagged, plain, empty, escaped, unicode and typed literals, and rdf:nil

Eight tests, 32 cases: isomorphic round-trip, idempotence, blank-node-label
independence and insertion-order independence across all seven public
renderings, plus diff locality on a realistic edit. A guard test asserts the
fixture still contains each hard shape, so the rest cannot pass vacuously.

The behavior it pins down

Adding one unrelated class to that document:

RDFC-1.0 only :  40 existing lines rewritten by the edit
diff-stable   :   0 existing lines rewritten by the edit

test_adding_a_class_rewrites_nothing_rdfc_alone_would_rewrite asserts both
arms, so a fixture that stopped demonstrating the problem fails instead of
passing quietly.

Requirement catalog

RDF-ISOMORPHISM and TURTLE-STABILITY described only seeded graphs, and both
they and WL-COMPONENTS declared their end-to-end dimension not-applicable.
The new cases are mapped as end-to-end evidence on all three, the descriptions
updated, and coverage.md regenerated.

No release

No src/ change, so no behavior or emitted-byte change, and no changelog entry

Local verification: 1259 passed, coverage 96.13% (gate 95%),
check_requirements.py and check_standards.py clean, ruff check and format clean.

The seeded property graphs exercise each hard RDF shape on its own. A real
generated schema puts them in one document, where shared list tails, a
blank-node cycle, OWL restrictions and SHACL shapes interact.

Add a naturalistic OWL/SHACL fixture and check that every public rendering
preserves it, stays idempotent, and ignores incoming blank-node names and
insertion order. Adding an unrelated class must rewrite nothing: the same
edit moves 40 existing lines under RDFC-1.0 labels alone, which the test
asserts as its own control so a weakened fixture cannot pass silently.

Map the new cases as end-to-end evidence for RDF-ISOMORPHISM,
TURTLE-STABILITY and WL-COMPONENTS, which until now claimed no
composed-document dimension.
@jdsika
jdsika merged commit 858e93e into main Sep 18, 2026
13 checks passed
@jdsika
jdsika deleted the test/naturalistic-schema-document branch September 18, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant