Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
235 commits
Select commit Hold shift + click to select a range
a72d368
Ontology: a data property can be marked as its class's display name
harshach Nov 22, 2026
ffd1dc1
Return latest table profile facts on native graph cluster assets
harshach Nov 22, 2026
335a091
Prove the profile facts reader path, tidy sampled and tie handling
harshach Nov 22, 2026
8c37cbc
Ontology: keep the display-name flag through CSV import and read sibl…
harshach Nov 22, 2026
e421828
Return latest table profile facts on native graph cluster assets
harshach Nov 22, 2026
dd3e09f
Ontology: a CSV row that changes a property's kind drops the display-…
harshach Nov 22, 2026
42c3dbe
ontology: shapes as a native entity, sealed in releases and exchanged…
harshach Nov 22, 2026
69aaeeb
migrations: shape table in 2.2.0 and a step that adds the shape resou…
harshach Nov 22, 2026
b661a95
Ontology: pin the sibling read to the target index on MySQL, and appl…
harshach Nov 22, 2026
0a6f931
ontology shapes: guard referenced definitions, bounded atomic import,…
harshach Nov 22, 2026
000f601
ontology tests: create the shape table in the storage test database
harshach Nov 22, 2026
0cd4270
Ontology: read the reference table first in the MySQL sibling read
harshach Nov 22, 2026
fb16a82
Let a data property mark its class's display name
harshach Nov 22, 2026
3eaa53a
Add role, subject key, row filter and join to the binding schemas
harshach Nov 22, 2026
7e4e6b4
Store and check the role, key, filter and joins of a table binding
harshach Nov 22, 2026
643a723
Let an ontology name one database as its mapping source
harshach Nov 22, 2026
64d9702
Report what the table bindings of an ontology still need
harshach Nov 22, 2026
bf77eda
Cover table bindings, the mapping source and mapping health end to end
harshach Nov 22, 2026
a1239dc
Hold SHACL shapes on an ontology, with import and export
harshach Nov 22, 2026
6b83407
Let a table binding say how its rows become records
harshach Nov 22, 2026
b4ca862
Answer 400 when an ontology's mapping source names no id
harshach Nov 22, 2026
6c55d35
Test mapping health for a reader who cannot view a class's identity t…
harshach Nov 22, 2026
8ab19ee
Carry profile facts on the tables of a bindings page and test later c…
harshach Nov 22, 2026
fe0d55c
Write generated SQL from typed values, one escaper per engine family
harshach Nov 22, 2026
9b65e2f
Refuse a row filter value that does not parse as its column's type
harshach Nov 22, 2026
ee237b6
Apply the stored row filter of each table a concept statement reads
harshach Nov 22, 2026
1a09538
Test generated SQL against a file of value cases for every engine family
harshach Nov 22, 2026
29b621f
Test row filter values against MySQL, Postgres and the bindings endpoint
harshach Nov 22, 2026
1fe344b
Hold a number to the length cap of a string in generated SQL
harshach Nov 22, 2026
a0c6909
Keep the text a typed value arrived as beside its parsed value
harshach Nov 22, 2026
714f7ab
Say that a typed value keeps a number in plain decimal form
harshach Nov 22, 2026
3b8e763
Carry profile facts on bindings pages and refuse a mapping source wit…
harshach Nov 22, 2026
bac7bd1
Write generated SQL from typed values, with one escaper per engine fa…
harshach Nov 22, 2026
3c40748
Regenerate the UI's TypeScript types from the ontology schemas
harshach Nov 22, 2026
d3d2e66
Refuse a replacement of a draft's operations that needs a class only …
harshach Nov 22, 2026
9af8924
Record declined definitions by operation type, IRI and content digest
harshach Nov 22, 2026
0b77902
Generate find and open statements from the identity table
harshach Nov 22, 2026
346ded0
Generate the expand statement over a confirmed join
harshach Nov 22, 2026
daad045
Generate the aggregate statements
harshach Nov 22, 2026
f8cb637
Start the search-around statement from the identity table
harshach Nov 22, 2026
17e5b08
Test the record statements on MySQL and Postgres
harshach Nov 22, 2026
b16562e
Test a request that names the related class
harshach Nov 22, 2026
eea51c8
Let a change set carry table bindings and shapes, applied as the caller
harshach Nov 22, 2026
2f57472
Check at save that a binding or shape names a class, properties, tabl…
harshach Nov 22, 2026
8701988
Show change set evidence only for tables the reader may view
harshach Nov 22, 2026
cec2180
Add integration tests for change set bindings, shapes and evidence
harshach Nov 22, 2026
28ce6a6
Record that a change set carries table bindings and shapes
harshach Nov 22, 2026
9ad3c7c
Keep the search-around statement of a concept with one table
harshach Nov 22, 2026
053f165
Test the display name flag of a version and an inverse request
harshach Nov 22, 2026
1f446cf
Test a join onto another table and a stale filter on a table that add…
harshach Nov 23, 2026
c04740d
Read a release statement from the release members, whatever the draft…
harshach Nov 23, 2026
1a118c0
Test a release statement after a draft delete and the rights of its r…
harshach Nov 23, 2026
55e0997
Read the operations of a change set only with the draft read right, a…
harshach Nov 23, 2026
4d0919e
Test the draft read right on the audit log, the entity tool and the R…
harshach Nov 23, 2026
778c507
Correct the audit log paragraph of the change set record
harshach Nov 23, 2026
e2c94af
Read the operations again before a save that follows a change of sight
harshach Nov 23, 2026
99b5fa7
Refuse a reader without the right before saying a release is missing
harshach Nov 23, 2026
257d401
Merge 2.4: generated statements start from the identity table, with f…
harshach Nov 23, 2026
3c29746
Regenerate the UI's TypeScript types from the statement schemas
harshach Nov 23, 2026
351d59e
Ask the draft read right on every path to a change set, and keep its …
harshach Nov 23, 2026
e6548f3
Count a class's records and a relation's links from stored column pro…
harshach Nov 23, 2026
3cafe7d
Test the draft read right on every change set endpoint and the events…
harshach Nov 23, 2026
5d31d6c
Bound the binding read of the counts to a few table rows for each cla…
harshach Nov 23, 2026
6d44f4b
Check that earlier versions of a draft still hold its operations
harshach Nov 23, 2026
547f10f
Expect no operations in the stored events of a draft
harshach Nov 23, 2026
637e999
Count the links of a relation in the aggregate statement
harshach Nov 23, 2026
16b989b
Test the link count of a relation over six mappings on MySQL and Post…
harshach Nov 23, 2026
dd3a9bc
Read a class cut by the first binding read again so its join state do…
harshach Nov 23, 2026
02af112
Test the bound and the order of the binding read, the second read, an…
harshach Nov 23, 2026
6cb34fe
Insert the test's binding rows with a jsonb cast on Postgres
harshach Nov 23, 2026
7f700cc
Count an inverse link from a record of the class that binds the relation
harshach Nov 23, 2026
ac816de
Give no exact count from a table profiled through a dataframe or from…
harshach Nov 23, 2026
271401a
Merge 2.4c: the aggregate statement counts the links of a relation
harshach Nov 23, 2026
c2158aa
Regenerate the UI's TypeScript types for the link count measure
harshach Nov 23, 2026
102e190
Test that a deleted contributing table holds no join, inside and beyo…
harshach Nov 23, 2026
76eedd1
Keep the name of a masked field's change in a stored event and drop o…
harshach Nov 23, 2026
2965a21
Record the dataframe and statistics rules, the second read of a filte…
harshach Nov 23, 2026
882ecca
Test that a stored event names the change of a masked field and holds…
harshach Nov 23, 2026
1e50f81
Give no exact count from a table whose connector writes catalog stati…
harshach Nov 23, 2026
3bf3aeb
Refuse a declared key on a table that gives no exact count
harshach Nov 23, 2026
c481746
Merge 5.1a: change set operations for bindings and shapes, with evide…
harshach Nov 23, 2026
d729a0c
Regenerate the UI's TypeScript types for change set operations
harshach Nov 23, 2026
e17cae8
Merge 2.6a: the data graph page gives exact record and link counts fr…
harshach Nov 23, 2026
bcaba17
Regenerate the UI's TypeScript types for record and link counts
harshach Nov 23, 2026
0fcb50b
Compile the shapes of a class into data quality checks
harshach Nov 24, 2026
b6015ec
Write the queries of the generated shape checks
harshach Nov 24, 2026
173beaa
Answer how the shapes of a class are checked on its tables
harshach Nov 24, 2026
75db6fb
Send the key value cases for a text column through an in list
harshach Nov 24, 2026
667b802
Run the shape checks on rows in MySQL and Postgres
harshach Nov 24, 2026
2cbd4c4
Record how an answer is read, refused and masked
harshach Nov 24, 2026
e0d3d14
Test the reads behind an answer about shape checks
harshach Nov 24, 2026
e7dae11
Check every part of a shape with a generated query
harshach Nov 24, 2026
ec2e484
Run the generated checks and a pattern on a database
harshach Nov 24, 2026
edb55fd
Hide the shapes and the properties a caller may not view
harshach Nov 24, 2026
5e17d5d
Refuse a range in a pattern that ends outside ASCII
harshach Nov 24, 2026
edd8f08
Record that every shape check is a generated query
harshach Nov 24, 2026
e12956c
Test that no term text reaches a statement and that no read locks
harshach Nov 25, 2026
8327114
Say what a part is answered before the rule is read
harshach Nov 25, 2026
4e905a5
Compare a check's table without its entity type in the answer test
harshach Nov 25, 2026
1baab29
Read the escapes and punctuation of XPath, and hide a class part's cl…
harshach Nov 25, 2026
8ebfd9f
ontology: integration tests for masked class parts, pattern spellings…
harshach Nov 25, 2026
15f1573
Read the binding rows of every filtered class table in one statement
harshach Nov 26, 2026
7cd349a
Test that a release authorizes its classes against the released rows
harshach Nov 26, 2026
b19e19c
Correct what the shape check record says the hydration loads, and sta…
harshach Nov 26, 2026
038fafd
Test that filtered classes cost one read of the rows and one question…
harshach Nov 26, 2026
f8c211a
Walk the ancestors of every class that shares a filtered table together
harshach Nov 26, 2026
c442f07
State the cost of the subclass question in the shape check record
harshach Nov 26, 2026
a4e7738
Bound the ancestor walk by the classes above its starts, not the starts
harshach Nov 26, 2026
0a1dca3
Test the walk over chains that meet, a second parent and a class of a…
harshach Nov 26, 2026
9c43d80
State how the subclass walk is bound in the shape check record
harshach Nov 26, 2026
7424969
Order the expand statement by the related key and start it after a gi…
harshach Nov 26, 2026
9cbcc0f
Test the pages of the expand statement on MySQL and Postgres
harshach Nov 26, 2026
774008b
Record how the expand statement pages by the related key
harshach Nov 26, 2026
f9f07a0
Order the expand statement only by a related key whose columns take v…
harshach Nov 27, 2026
a7c2f2c
Add goldens for the forward expand statement with after
harshach Nov 27, 2026
32ae5b6
Test a related key of three columns and a related key that takes no v…
harshach Nov 27, 2026
865f3c5
Say how a page boundary meets equal keys, and when the plan names an …
harshach Nov 27, 2026
99a19ef
Run the statement of a related key with no value before checking its …
harshach Nov 27, 2026
8bcdbcc
Let a suggestion task propose a table constraint, applied with the ap…
harshach Nov 27, 2026
954c8ee
Test that a suggested table constraint is applied as the approver on …
harshach Nov 27, 2026
ddb23e9
Merge the integration branch with change set read access
harshach Nov 27, 2026
faa4e43
Make the definition digest the same for null and absent fields, set o…
harshach Nov 27, 2026
29b11f8
Check every kept operation when narrowing a draft, whatever the undo …
harshach Nov 27, 2026
a0110ee
Remove declined definitions when an ontology is permanently deleted
harshach Nov 27, 2026
820fb4e
Ask the draft read right before declining a definition of a change set
harshach Nov 27, 2026
7082405
Test null digests, undo and narrow, and permanent delete on both engi…
harshach Nov 27, 2026
e654f33
Keep a task's suggestion type through a resolution, validate the whol…
harshach Nov 27, 2026
616b5bb
Test that a resolution keeps a suggestion's type and that approving c…
harshach Nov 27, 2026
79105ad
Merge 5.1b: declined ontology definitions are remembered by their con…
harshach Nov 27, 2026
2b85027
Regenerate the UI's TypeScript types for declined ontology definitions
harshach Nov 27, 2026
90847fc
Add a table constraint only for a suggestion task, pin the exact comp…
harshach Nov 27, 2026
fc8ba01
Take the task form out of what approving a constraint suggestion need…
harshach Nov 28, 2026
4f7dbd6
Test that a custom task carrying a constraint payload still runs its …
harshach Nov 28, 2026
c7e16d0
Hold a table constraint suggestion's payload to the keys of the sugge…
harshach Nov 28, 2026
5342031
Refuse a resolution of any type that would write a key outside the su…
harshach Nov 28, 2026
945c705
Record what a constraint suggestion refuses and what a configured wor…
harshach Nov 28, 2026
3015b23
Keep the tests that bind a form to review suggestions from running to…
harshach Nov 28, 2026
6ff535d
Merge 5.6: a suggestion task can propose a table constraint, applied …
harshach Nov 28, 2026
bb076e0
Regenerate the UI's TypeScript types for table constraint suggestions
harshach Nov 28, 2026
46e93b4
Merge 2.4d: the expand statement pages after a given related key, and…
harshach Nov 28, 2026
cee7432
Regenerate the UI's TypeScript types for the paged expand statement
harshach Nov 28, 2026
c39f8c4
Read the first level of the ancestor walk in chunks and test both hal…
harshach Nov 29, 2026
befbb1a
Test a sharing class whose first parent leads to the named class
harshach Nov 29, 2026
88b1a1d
State the chunked first level and the axiom bound of the walk in the …
harshach Nov 29, 2026
c156e5d
Test that the chunks of the first level are bound together when no ne…
harshach Nov 30, 2026
17bcf8a
Merge 4.2a: the shapes of a class compile into exact data quality che…
harshach Nov 30, 2026
9876ea2
Regenerate the UI's TypeScript types for the shape checks of a class
harshach Nov 30, 2026
42d9b1c
Restore a bot user's default role only when the user holds no role
harshach Nov 30, 2026
56ebc63
Add an integration test for restoring a bot user's default role
harshach Nov 30, 2026
ec0a4e1
Merge 3.1c: the recover step gives a bot user its default role only w…
harshach Nov 30, 2026
ffdd7b4
Leave suggestion types the lists cannot show out of the suggestion li…
harshach Nov 30, 2026
b291b5b
Add the shacl export format to the UI's media type and extension maps
harshach Nov 30, 2026
b7a67c7
Fix the release path in the shacl export test
harshach Nov 30, 2026
c9efda8
Send a table constraint suggestion's resolution with its comment once…
harshach Nov 30, 2026
24ed5ea
Name the constraint an approval adds in its comment, and correct the …
harshach Nov 30, 2026
38ba343
Post a task resolution's comment after its change is applied
harshach Nov 30, 2026
e128a5b
Test reject-all and the task tab's two call sites without transitions…
harshach Nov 30, 2026
35fb396
Say what a failed apply does for each task type, and test the comment…
harshach Dec 1, 2026
dc56c19
Say when a resolution's comment is posted, and test a rejection that …
harshach Dec 1, 2026
ed6cc01
Pass the comment of the rejection case as the comment
harshach Dec 1, 2026
8c4a795
apps: check an app's configuration before the server stores it
harshach Dec 1, 2026
da1b666
apps: integration tests and a record for the configuration check
harshach Dec 1, 2026
dd304f5
apps: serialize the tests that schedule apps in the job store
harshach Dec 1, 2026
3c81ac6
Test that a resolution comment's author is the resolver, and tidy the…
harshach Dec 1, 2026
1912107
Merge 5.6b: a table constraint suggestion resolves from the task tab …
harshach Dec 2, 2026
dd96f5e
apps: run the configuration check tests in a class of their own
harshach Dec 2, 2026
04677c7
apps: test a move out of the configuration and a caller without edit …
harshach Dec 2, 2026
8baf95d
apps: build an app for the save check only when it declares its own c…
harshach Dec 2, 2026
cf38c1a
A shape check reaches its table as a proposed test, kept in step with…
harshach Dec 2, 2026
7ff8a6c
A check's proposal state is readable per caller, and the proposal flo…
harshach Dec 2, 2026
305aaa9
Merge 3.1f: an app's configuration is checked before the server store…
harshach Dec 2, 2026
7ae456b
Read the proposals of a class by its id, and keep the compile's read …
harshach Dec 2, 2026
798baac
Compare answers for what the compile says, not for the proposals a re…
harshach Dec 2, 2026
19413cf
Measure what a reconcile costs for 1, 10 and 100 classes
harshach Dec 2, 2026
2dcc792
Tell a test the reconcile deleted from one a person deleted, and keep…
harshach Dec 2, 2026
6acf05b
ontology checks: read proposal states in batches, hold PUT to the rea…
harshach Dec 2, 2026
29574e6
docs: the record's guard names the governance bot
harshach Dec 2, 2026
efdf1df
Test that a list of tasks returns each task's reviewers and domains a…
harshach Dec 2, 2026
4181e04
Count a restore of a test the reconcile deleted as a restore, and sho…
harshach Dec 2, 2026
6a74f59
Say in the record who is asked to approve a proposed test, and test a…
harshach Dec 2, 2026
04e250b
Test that the owner of a table who is denied CreateTests cannot rejec…
harshach Dec 2, 2026
9178df6
Say in the record that a resolve of either kind asks for the right to…
harshach Dec 2, 2026
fc2ccdb
File a proposed test as the governance bot, so the person whose chang…
harshach Dec 3, 2026
a2af43b
Read the reviewers of a list of tasks as a GET of each does, soft-del…
harshach Dec 3, 2026
7b85980
Check a PUT against the stored test's generatedBy before the paramete…
harshach Dec 3, 2026
cccd701
Say in the record who files the task, what a PUT with another entity …
harshach Dec 3, 2026
75bf0c9
Test that a PUT that names its test definition is checked against the…
harshach Dec 3, 2026
da39148
Test that the repository refuses a PUT of a changed threshold that re…
harshach Dec 3, 2026
97742a6
Give each listed task its domains in the order a GET gives them
harshach Dec 3, 2026
808dafe
Run the generated-test check in a CSV dry run, stop a task replace se…
harshach Dec 3, 2026
0e0d9c4
Record the filer's effects, the order of a listed task's fields and t…
harshach Dec 3, 2026
2f34320
Test a CSV row that changes the definition of a generated test, and l…
harshach Dec 3, 2026
97e120e
Name the CSV rows the record's guard imports
harshach Dec 3, 2026
077a3b8
Test a list that asks for domains alone and for reviewers alone, and …
harshach Dec 4, 2026
eb153d6
Say in the record only what its tests assert, and list six reviewers …
harshach Dec 4, 2026
b8c0661
A shape check reaches its table as a proposed test
harshach Dec 4, 2026
71ab4d3
Regenerate the UI types for proposed tests
harshach Dec 4, 2026
3109563
Mapping health names a sensitive key column and a column whose type c…
harshach Dec 4, 2026
17d992f
Mapping health reads each table once and tests the new findings over …
harshach Dec 4, 2026
cba99b7
Read the table mapping of a whole ontology version as one value
harshach Dec 4, 2026
0cae8d3
Test the table mapping of a version as three callers read it, and cou…
harshach Dec 4, 2026
b255c2b
Mapping health names sensitive key columns and column types that cann…
harshach Dec 5, 2026
61a0372
Regenerate the UI types for mapping health findings
harshach Dec 5, 2026
4e67b25
Read a draft table mapping as one state, serialize an applied row fil…
harshach Dec 5, 2026
9db0f7c
Read the table mapping of an ontology version in one call
harshach Dec 5, 2026
f1f372f
Look up generated tests and the tasks that propose them by an indexed…
harshach Dec 5, 2026
391bbba
ontology: a declined table binding and shape are remembered by content
harshach Dec 5, 2026
8589497
Test that a generated column never fails a write or the migration
harshach Dec 5, 2026
de4bc6e
Make a generated lookup column NULL for a value it cannot read instea…
harshach Dec 5, 2026
ca17409
Write the shapes of the lookup columns through the task insert
harshach Dec 5, 2026
f590944
Index the lookups of generated test cases and their tasks
harshach Dec 5, 2026
48bbdaa
Check date-typed properties against column types, show the mapping so…
harshach Dec 5, 2026
d008420
Check date-typed properties, show the mapping source only to a reader…
harshach Dec 5, 2026
0efd861
ontology: a declined binding is keyed by its table, role, key and fil…
harshach Dec 6, 2026
260a8ec
Remember a declined table binding or shape by its content
harshach Dec 6, 2026
aa0ef41
Test that a release member listing keeps only the members the caller …
harshach Dec 6, 2026
4e8ac21
List only the release members the caller may view, and count only those
harshach Dec 6, 2026
f6b7596
List the release members a reader may view
harshach Dec 6, 2026
7a06cc4
Merge origin/main into the ontology integration branch
harshach Dec 6, 2026
efa2376
Move the declined-definition DAO test to the integration tests, as up…
harshach Dec 6, 2026
831fbb1
Update the constraint suggestion test to upstream's patch overload
harshach Dec 6, 2026
089dbb3
Describe the shape class and the new predicates in the RDF ontology
harshach Dec 6, 2026
97af258
Pass a StoredBinding where upstream's served-bindings IT upserts a bi…
harshach Dec 6, 2026
8bdc938
Adapt the statement-count and assignee ITs to upstream's task and tab…
harshach Dec 6, 2026
1b07653
Pin one more statement for reading accepted proposals after upstream'…
harshach Dec 6, 2026
c17e917
Merge the two mocks of the task payload fields in the task tab test
harshach Dec 6, 2026
c0e9516
Merge origin/main into the ontology integration branch
harshach Dec 6, 2026
27fbad8
suggestion lists: filter the task list by suggestion type so the serv…
harshach Dec 6, 2026
47ec1e4
Suggestion lists ask the server only for the suggestion types they show
harshach Dec 6, 2026
a8cee50
Merge branch 'main' into harshach/ontology-binding-roles
harshach Dec 6, 2026
a728155
Suggestion type filter returns once and reuses the enum CSV check
harshach Dec 6, 2026
6865a11
Validate the suggestion type filter with the shared enum check and re…
harshach Dec 6, 2026
47e19eb
Merge the remote branch, which took main
harshach Dec 6, 2026
90ec9b5
Keep the generated names of two existing enums when sibling enums are…
harshach Dec 6, 2026
b7756a2
Keep the generated names of two existing enums when sibling enums are…
harshach Dec 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
133 changes: 133 additions & 0 deletions bootstrap/sql/migrations/native/2.2.0/mysql/schemaChanges.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
-- Shapes: SHACL node shapes of an ontology, each targeting one class and listing constraints on
-- its properties. They are working content, sealed into releases as SHAPE members.
-- ADR:2026-11-21-ontology-shapes-hold-the-supported-shacl-constraints
CREATE TABLE IF NOT EXISTS ontology_shape_entity (
id varchar(36) GENERATED ALWAYS AS (json_unquote(json_extract(json, '$.id'))) STORED NOT NULL,
name varchar(256) GENERATED ALWAYS AS (json_unquote(json_extract(json, '$.name'))) STORED NOT NULL,
fqnHash varchar(768) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
json json NOT NULL,
ontologyId varchar(36) GENERATED ALWAYS AS (json_unquote(json_extract(json, '$.ontology.id'))) STORED NOT NULL,
updatedAt bigint unsigned GENERATED ALWAYS AS (json_unquote(json_extract(json, '$.updatedAt'))) STORED NOT NULL,
updatedBy varchar(256) GENERATED ALWAYS AS (json_unquote(json_extract(json, '$.updatedBy'))) STORED NOT NULL,
deleted tinyint(1) GENERATED ALWAYS AS (json_extract(json, '$.deleted')) STORED,
PRIMARY KEY (id),
UNIQUE KEY ontology_shape_fqn_hash_unique (fqnHash),
KEY ontology_shape_name_index (name),
KEY ontology_shape_listing_index (ontologyId, deleted, name, id),
KEY ontology_shape_deleted_index (deleted)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- A table binding of an ontology class can say how its table takes part in the class's records:
-- its role, the ordered columns that identify one record, and one row filter. A row written
-- before these columns existed keeps NULL in all three and reads back as an unassigned binding
-- (ADR:2026-11-21-a-table-binding-says-how-its-rows-become-records).
SET @ontology_concept_binding_role_ddl = (
SELECT IF(
EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_schema = DATABASE()
AND table_name = 'ontology_concept_binding'
AND column_name = 'bindingRole'
),
'SELECT 1',
'ALTER TABLE ontology_concept_binding ADD COLUMN bindingRole VARCHAR(16) NULL, ADD COLUMN subjectKey JSON NULL, ADD COLUMN rowFilter JSON NULL'
)
);
PREPARE ontology_concept_binding_role_stmt FROM @ontology_concept_binding_role_ddl;
EXECUTE ontology_concept_binding_role_stmt;
DEALLOCATE PREPARE ontology_concept_binding_role_stmt;

-- Definitions a person declined to add to an ontology. A later draft that proposes the same
-- definition, with the same content, is matched against these rows. The key is the ontology, the
-- operation type, the SHA-256 of the definition's IRI and the SHA-256 of its canonical content.
-- ADR:2026-11-22-a-declined-definition-is-remembered-by-content
CREATE TABLE IF NOT EXISTS ontology_declined_definition (
ontologyId VARCHAR(36) NOT NULL,
operationType VARCHAR(32) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
iri TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
iriHash CHAR(64) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
payloadDigest CHAR(64) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
declinedBy VARCHAR(256) NOT NULL,
declinedAt BIGINT NOT NULL,
reason TEXT NULL,
changeSetId VARCHAR(36) NOT NULL,
operationId VARCHAR(36) NOT NULL,
PRIMARY KEY (ontologyId, operationType, iriHash, payloadDigest),
KEY ontology_declined_definition_listing_index (ontologyId, declinedAt)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- Generated tests and the suggestion tasks that propose a test case are looked up by the class
-- that generated them. The class is a stored column of its own, filled from the JSON of every
-- existing row, so each lookup reads an index instead of every row.
-- ADR:2026-12-05-the-lookups-of-generated-tests-and-their-tasks-use-an-index
SET @test_case_generated_by_class_ddl = (
SELECT IF(
EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_schema = DATABASE()
AND table_name = 'test_case'
AND column_name = 'generatedByClassId'
),
'SELECT 1',
'ALTER TABLE test_case ADD COLUMN generatedByClassId VARCHAR(36) GENERATED ALWAYS AS (CASE WHEN char_length(json_unquote(json_extract(`json`, _utf8mb4''$.generatedBy.class.id''))) = 36 THEN json_unquote(json_extract(`json`, _utf8mb4''$.generatedBy.class.id'')) END) STORED NULL'
)
);
PREPARE test_case_generated_by_class_stmt FROM @test_case_generated_by_class_ddl;
EXECUTE test_case_generated_by_class_stmt;
DEALLOCATE PREPARE test_case_generated_by_class_stmt;

SET @test_case_generated_by_class_idx_ddl = (
SELECT IF(
EXISTS (
SELECT 1
FROM information_schema.statistics
WHERE table_schema = DATABASE()
AND table_name = 'test_case'
AND index_name = 'idx_test_case_generated_by_class'
),
'SELECT 1',
'ALTER TABLE test_case ADD KEY idx_test_case_generated_by_class (generatedByClassId)'
)
);
PREPARE test_case_generated_by_class_idx_stmt FROM @test_case_generated_by_class_idx_ddl;
EXECUTE test_case_generated_by_class_idx_stmt;
DEALLOCATE PREPARE test_case_generated_by_class_idx_stmt;

-- A task that proposes a test case carries a test case proposal, written as JSON text, in its
-- payload. The column holds the class that generated the proposal, and stays NULL for every other
-- task, for a payload that is not JSON and for a class id that is not 36 characters.
SET @task_entity_test_case_class_ddl = (
SELECT IF(
EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_schema = DATABASE()
AND table_name = 'task_entity'
AND column_name = 'testCaseClassId'
),
'SELECT 1',
'ALTER TABLE task_entity ADD COLUMN testCaseClassId VARCHAR(36) GENERATED ALWAYS AS (CASE WHEN json_unquote(json_extract(`json`, _utf8mb4''$.payload.suggestionType'')) = ''TestCase'' AND json_valid(json_unquote(json_extract(`json`, _utf8mb4''$.payload.suggestedValue''))) AND char_length(json_unquote(json_extract(CAST(json_unquote(json_extract(`json`, _utf8mb4''$.payload.suggestedValue'')) AS JSON), _utf8mb4''$.generatedBy.class.id''))) = 36 THEN json_unquote(json_extract(CAST(json_unquote(json_extract(`json`, _utf8mb4''$.payload.suggestedValue'')) AS JSON), _utf8mb4''$.generatedBy.class.id'')) END) STORED NULL'
)
);
PREPARE task_entity_test_case_class_stmt FROM @task_entity_test_case_class_ddl;
EXECUTE task_entity_test_case_class_stmt;
DEALLOCATE PREPARE task_entity_test_case_class_stmt;

SET @task_entity_test_case_class_idx_ddl = (
SELECT IF(
EXISTS (
SELECT 1
FROM information_schema.statistics
WHERE table_schema = DATABASE()
AND table_name = 'task_entity'
AND index_name = 'idx_task_test_case_class'
),
'SELECT 1',
'ALTER TABLE task_entity ADD KEY idx_task_test_case_class (testCaseClassId)'
)
);
PREPARE task_entity_test_case_class_idx_stmt FROM @task_entity_test_case_class_idx_ddl;
EXECUTE task_entity_test_case_class_idx_stmt;
DEALLOCATE PREPARE task_entity_test_case_class_idx_stmt;
92 changes: 92 additions & 0 deletions bootstrap/sql/migrations/native/2.2.0/postgres/schemaChanges.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
-- Shapes: SHACL node shapes of an ontology, each targeting one class and listing constraints on
-- its properties. They are working content, sealed into releases as SHAPE members.
-- ADR:2026-11-21-ontology-shapes-hold-the-supported-shacl-constraints
CREATE TABLE IF NOT EXISTS ontology_shape_entity (
id VARCHAR(36) GENERATED ALWAYS AS (json ->> 'id') STORED NOT NULL,
name VARCHAR(256) GENERATED ALWAYS AS (json ->> 'name') STORED NOT NULL,
fqnHash VARCHAR(768) NOT NULL,
json JSONB NOT NULL,
ontologyId VARCHAR(36) GENERATED ALWAYS AS (json -> 'ontology' ->> 'id') STORED NOT NULL,
updatedAt BIGINT GENERATED ALWAYS AS ((json ->> 'updatedAt')::bigint) STORED NOT NULL,
updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> 'updatedBy') STORED NOT NULL,
deleted BOOLEAN GENERATED ALWAYS AS ((json ->> 'deleted')::boolean) STORED,
PRIMARY KEY (id),
CONSTRAINT ontology_shape_fqn_hash_unique UNIQUE (fqnHash)
);
CREATE INDEX IF NOT EXISTS ontology_shape_name_index ON ontology_shape_entity (name);
CREATE INDEX IF NOT EXISTS ontology_shape_listing_index ON ontology_shape_entity (ontologyId, deleted, name, id);
CREATE INDEX IF NOT EXISTS ontology_shape_deleted_index ON ontology_shape_entity (deleted);

-- A table binding of an ontology class can say how its table takes part in the class's records:
-- its role, the ordered columns that identify one record, and one row filter. A row written
-- before these columns existed keeps NULL in all three and reads back as an unassigned binding
-- (ADR:2026-11-21-a-table-binding-says-how-its-rows-become-records).
ALTER TABLE ontology_concept_binding
ADD COLUMN IF NOT EXISTS bindingRole VARCHAR(16),
ADD COLUMN IF NOT EXISTS subjectKey JSONB,
ADD COLUMN IF NOT EXISTS rowFilter JSONB;

-- Definitions a person declined to add to an ontology. A later draft that proposes the same
-- definition, with the same content, is matched against these rows. The key is the ontology, the
-- operation type, the SHA-256 of the definition's IRI and the SHA-256 of its canonical content.
-- ADR:2026-11-22-a-declined-definition-is-remembered-by-content
CREATE TABLE IF NOT EXISTS ontology_declined_definition (
ontologyId VARCHAR(36) NOT NULL,
operationType VARCHAR(32) COLLATE "C" NOT NULL,
iri TEXT COLLATE "C" NOT NULL,
iriHash CHAR(64) COLLATE "C" NOT NULL,
payloadDigest CHAR(64) COLLATE "C" NOT NULL,
declinedBy VARCHAR(256) NOT NULL,
declinedAt BIGINT NOT NULL,
reason TEXT,
changeSetId VARCHAR(36) NOT NULL,
operationId VARCHAR(36) NOT NULL,
PRIMARY KEY (ontologyId, operationType, iriHash, payloadDigest)
);

CREATE INDEX IF NOT EXISTS ontology_declined_definition_listing_index
ON ontology_declined_definition (ontologyId, declinedAt);

-- Generated tests and the suggestion tasks that propose a test case are looked up by the class
-- that generated them. The class is a stored column of its own, filled from the JSON of every
-- existing row, so each lookup reads an index instead of every row. A value a column cannot read
-- (a class id that is not 36 characters, a proposal that is not JSON) leaves it NULL and never
-- fails the write.
-- ADR:2026-12-05-the-lookups-of-generated-tests-and-their-tasks-use-an-index
ALTER TABLE test_case
ADD COLUMN IF NOT EXISTS generatedbyclassid VARCHAR(36)
GENERATED ALWAYS AS (
CASE WHEN char_length(json -> 'generatedBy' -> 'class' ->> 'id') = 36
THEN json -> 'generatedBy' -> 'class' ->> 'id'
END
) STORED;

CREATE INDEX IF NOT EXISTS idx_test_case_generated_by_class
ON test_case (generatedbyclassid) WHERE generatedbyclassid IS NOT NULL;

-- A task that proposes a test case carries a test case proposal, written as JSON text, in its
-- payload. A generated column cannot catch a cast error, so the function does: it drops the
-- escape of a NUL character, which jsonb refuses, reads the class, and returns NULL for text
-- that is not JSON or a class id that is not 36 characters.
CREATE OR REPLACE FUNCTION test_case_proposal_class_id(proposal text) RETURNS varchar(36)
LANGUAGE plpgsql IMMUTABLE AS $$
DECLARE
class_id text;
BEGIN
class_id := replace(proposal, '\u0000', '')::jsonb -> 'generatedBy' -> 'class' ->> 'id';
RETURN CASE WHEN char_length(class_id) = 36 THEN class_id END;
EXCEPTION WHEN others THEN
RETURN NULL;
END
$$;

ALTER TABLE task_entity
ADD COLUMN IF NOT EXISTS testcaseclassid VARCHAR(36)
GENERATED ALWAYS AS (
CASE WHEN json -> 'payload' ->> 'suggestionType' = 'TestCase'
THEN test_case_proposal_class_id(json -> 'payload' ->> 'suggestedValue')
END
) STORED;

CREATE INDEX IF NOT EXISTS idx_task_test_case_class
ON task_entity (testcaseclassid) WHERE testcaseclassid IS NOT NULL;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ontology definitions use independent entity storage

- **Status:** Accepted
- **Revisions:** v1 2026-10-14 (initial) · v2 2026-10-14 (semantic identity) · v3 2026-10-14 (native IRI creation) · v4 2026-10-14 (client IRI fidelity) · v5 2026-10-15 (native axiom ownership) · v6 2026-10-15 (derived reference index) · v7 2026-10-15 (unreleased 2.1.0 migrations and scoped axiom reset) · v8 2026-10-15 (metadata usage search by concept UUID) · v9 2026-10-15 (shared search and CSV definitions) · v10 2026-10-15 (release-only review and affected-definition validation) · v11 2026-10-15 (metadata annotations moved to a follow-up)
- **Revisions:** v1 2026-10-14 (initial) · v2 2026-10-14 (semantic identity) · v3 2026-10-14 (native IRI creation) · v4 2026-10-14 (client IRI fidelity) · v5 2026-10-15 (native axiom ownership) · v6 2026-10-15 (derived reference index) · v7 2026-10-15 (unreleased 2.1.0 migrations and scoped axiom reset) · v8 2026-10-15 (metadata usage search by concept UUID) · v9 2026-10-15 (shared search and CSV definitions) · v10 2026-10-15 (release-only review and affected-definition validation) · v11 2026-10-15 (metadata annotations moved to a follow-up) · v12 2026-11-21 (2.1.0 has shipped)
- **Deciders:** Harsha
- **Guard:** `OntologyEntityDAOTest`, `OntologyDefinitionTest`, `CollectionDAOCompositionTest`, `IndependentOntologyAxiomIT`, `OntologyReferencesTest`, `OntologyReferenceDAOTest`, `OntologyReleaseCaptureTest`, `IndependentOntologyReferenceIT`
- **Related:** [Organizational ontology design](../plans/2026-10-14-organizational-ontology-design.md)
Expand Down Expand Up @@ -136,3 +136,12 @@ through the reference index. These reads share the ontology state lock; MySQL re
recently committed changes use locking reads, including both sides of the reference/axiom join.
Cycle detection identifies every member of a strongly connected component without recursion.
An invalid unrelated draft does not prevent repairs. Capture still validates the complete model.

## Amendment: 2.1.0 has shipped

The "unreleased 2.1.0 migrations" of v7 no longer hold. 2.1.0 shipped as the final release
`2.1.0-release` on 2026-11-20, so its migration folder is closed: a database that has run it never
reads an earlier folder again, and a statement added to it would run only on a database that
upgrades from before 2.1.0. Ontology tables and indexes added after that date go in the next
folder that has not shipped, starting with `2.2.0`, and a data change to a seeded row needs its
own `runOnce` step in that release. The shape table is the first to follow this.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Ontology releases seal canonical SQL members

- **Status:** Accepted
- **Revisions:** v1 2026-10-14 (initial); v10 2026-10-15 (single-ontology releases, captured comparison baseline, active-only projection); v11 2026-10-30 (SKOS, SKOS-XL and CSV export, export options and the SHACL gate); v12 2026-11-06 (50,000 members, batched capture, cached and unlocked reads); v13 2026-11-08 (account for parsed release cache heap)
- **Revisions:** v1 2026-10-14 (initial); v10 2026-10-15 (single-ontology releases, captured comparison baseline, active-only projection); v11 2026-10-30 (SKOS, SKOS-XL and CSV export, export options and the SHACL gate); v12 2026-11-06 (50,000 members, batched capture, cached and unlocked reads); v13 2026-11-08 (account for parsed release cache heap); v14 2026-12-05 (member listings keep viewable members)
- **Deciders:** Harsha
- **Guard:** `OntologyReleaseManifestTest`, `OntologyReleaseDAOTest`, `OntologyReleaseCaptureTest`, `NativeOntologyCapacityPerfIT`, `OntologyWorkingStateTest`, `OntologyReleaseProjectionTest`, `OntologyStructureValidatorTest`, `OntologyReleaseComparisonTest`, `OntologyReleaseComparisonStorageTest`, `IndependentOntologyReleaseDiffIT`, `IndependentOntologyReleaseIT`, `IndependentOntologyReleaseExportIT`, `IndependentOntologyRetentionIT`, `OntologySkosProjectionTest`, `OntologyReleaseExporterTest`, `OntologyBoundAssetLinksTest`, `OntologyExportGateTest`, `IndependentOntologyReleaseExportFormatsIT`, `IndependentOntologyReleaseExportAssetsIT`, `IndependentOntologyReleaseExportGateIT`
- **Guard:** `OntologyReleaseManifestTest`, `OntologyReleaseDAOTest`, `OntologyReleaseCaptureTest`, `NativeOntologyCapacityPerfIT`, `OntologyWorkingStateTest`, `OntologyReleaseProjectionTest`, `OntologyStructureValidatorTest`, `OntologyReleaseComparisonTest`, `OntologyReleaseComparisonStorageTest`, `IndependentOntologyReleaseDiffIT`, `IndependentOntologyReleaseIT`, `IndependentOntologyReleaseMemberReadIT`, `IndependentOntologyReleaseExportIT`, `IndependentOntologyRetentionIT`, `OntologySkosProjectionTest`, `OntologyReleaseExporterTest`, `OntologyBoundAssetLinksTest`, `OntologyExportGateTest`, `IndependentOntologyReleaseExportFormatsIT`, `IndependentOntologyReleaseExportAssetsIT`, `IndependentOntologyReleaseExportGateIT`
- **Related:** [Organizational ontology design](../plans/2026-10-14-organizational-ontology-design.md)

## Context
Expand Down Expand Up @@ -182,3 +182,21 @@ that size is read and verified from SQL on every call. The v12 warm-read timings
releases that fit this smaller payload budget; they do not describe larger uncached releases.
`OntologyReleaseCaptureTest` verifies that a 23 MB release remains readable without staying
cached on both MySQL and PostgreSQL, alongside cache reuse and authorization for smaller releases.

## Amendment: a member listing keeps the members the caller may view (2026-12-05)

`GET /v1/ontologyReleases/{id}/members/{kind}` answers with the members of that kind the caller may
view, decided per member as `GET .../members/{kind}/{memberId}` decides it (`ViewAll` on the member's
definition, loaded with the attributes a condition reads). A deny rule that covers one class or
property no longer refuses the whole kind. A caller who may not view the release itself still gets
403, and the by-id read of a member the caller may not view still gets 403.

The page, its `after` cursor and `paging.total` are computed over the viewable members only, so
neither a short page, a cursor nor a count reveals a hidden member. The live definition lists keep
the total of every row and refill from following pages; a release is sealed and bounded to 50,000
members, so each request scans the kind in key order once and counts the viewable ones. Whole-release
readers (`OntologyReleaseReader`: export, SPARQL, comparison, validation) are unchanged: they still
authorize every member and fail for a caller who may not view one, because a partial release would
produce a wrong result rather than a smaller one.

`IndependentOntologyReleaseMemberReadIT` guards the listing.
Loading
Loading