#001: Upgrade Oxigraph from 0.4.x to 0.5.x #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Upgrade the Oxigraph dependency from 0.4.x to 0.5.x to gain RDF 1.2 support, performance improvements, and continued maintenance.
Blocked by
None.
Blocks
Motivation
rdf:reifies, quoted triples) is needed for the entity editor's stated/non-stated pattern.Scope of changes
Dependency bump
API migration
Every
Store.query()andStore.update()call must be rewritten.Old API (0.4.x):
New API (0.5.x):
Affected files
All files that call
store.query()orstore.update():src/auth.rs— all SPARQL queries for users, teams, permissionssrc/store.rs— dataset metadata queries and updatessrc/migration.rs— schema version queries and updatessrc/routes/web.rs— SPARQL updates for team/user/dataset creationsrc/routes/files.rs— file catalog queries and updatessrc/routes/sparql.rs— SPARQL endpoint handlerssrc/grobid.rs— metadata update after extractionsrc/bin/*.rs— CLI toolsModel type changes
Subjectenum merged intoNamedOrBlankNodeEvaluationErrorsplit intoQueryEvaluationErrorandUpdateEvaluationErrorQueryResultsnow carries a lifetime parameterDatabase migration
Oxigraph 0.5.x automatically migrates 0.4.x databases on first open. This is a one-way migration — databases cannot be reopened with 0.4.x.
Procedure:
Build requirements
Both are available on the deployment server (degu03).
Tests
Unit tests
Integration tests
Manual tests (on dev.kg.degu.cl)
Risk
References
Summary
Oxigraph has been upgraded from 0.4.x to 0.5.6 with the
rdf-12feature enabled. All deprecated API calls have been migrated to the newSparqlEvaluatorinterface, and all existing tests continue to pass alongside three new tests.What changed
Dependency (Cargo.toml)
API migration
The deprecated
Store::query()andStore::update()methods were replaced throughout the codebase. Two helper functions were added tosrc/store.rsto keep call sites concise:sparql_query(store, query)— wrapsSparqlEvaluator::new().parse_query().on_store().execute()sparql_update(store, update)— wrapsSparqlEvaluator::new().parse_update().on_store().execute()The removed
QueryResults::write()method inroutes/sparql.rswas replaced with the newQueryResultsSerializerAPI, handling Boolean, Solutions, and Graph result types explicitly.Files modified (13 total)
Cargo.toml,Cargo.lock— dependency bumpsrc/store.rs— helper functions + 3 new unit testssrc/auth.rs— migrated ~25 query/update call sitessrc/migration.rs— migrated ~6 call sitessrc/routes/sparql.rs— migrated queries/updates + new serializersrc/routes/files.rs— migrated ~8 call sitessrc/routes/web.rs— migrated ~7 update call sitessrc/bin/reset_password.rs— migratedsrc/bin/add_members.rs— migratedsrc/bin/fix_dataset_name.rs— migratedsrc/bin/fix_users.rs— migratedsrc/bin/migrate_team_ownership.rs— migratedClippy fixes
Three pre-existing clippy errors ("this loop never actually loops") were fixed in
auth.rsandroutes/files.rsby replacingfor solution in solutions.flatten() { return ...; }withif let Some(solution) = solutions.flatten().next() { return ...; }.All remaining clippy warnings were also resolved:
map_orsimplified tois_some_and, collapsedifstatements,div_ceilusage,Defaultimpl forSessionStore, unused imports and variables.field_reassign_with_defaultingrobid.rs(deliberate pattern for structs with many fields).dead_codefor functions used only by binary targets or tests (migration functions, test constructors, etc.).New tests
Three unit tests were added to
src/store.rs:test_store_query_new_api— verifies the SparqlEvaluator query path returns correct results.test_store_update_transaction— verifies that committed transactions persist and dropped transactions roll back.test_rdf12_quoted_triples— loads RDF 1.2 reified triples via Turtle I/O and verifies therdf-12feature stores them correctly.Test results
All 33 tests pass (30 existing + 3 new).
cargo fmtandcargo clippyproduce zero warnings.Notes
rdf-12feature currently enables triple term support in the Turtle I/O layer (oxttl) and storage layer, but SPARQL parsing (spargebra) does not yet support the<<( s p o )>>triple term syntax. The reified triple syntax<< s p o >>works for loading via Turtle.Branch
issue/001-oxigraph-upgrade(3 commits)