[package] name = "pgrdf" version = "0.5.0" edition = "2021" # MSRV. Matches the CI build container (compose/builder.Containerfile # `FROM rust:1.91-bookworm`) — the only Rust version pgRDF artifacts # are actually produced against. The check-cfg lint block below also # assumes Rust 1.91+'s strict check-cfg behavior, so going lower would # misadvertise support. pgrx 0.16.1's `resolver = "3"` independently # imposes a 1.84 floor; this declaration tightens that to the value CI # verifies. Bump together with the Containerfile when upgrading. rust-version = "1.91" license = "MIT" authors = ["Peter Styk "] description = "Rust-native PostgreSQL extension for RDF, SPARQL, SHACL and OWL reasoning" repository = "https://github.com/styk-tv/pgRDF" homepage = "https://github.com/styk-tv/pgRDF" documentation = "https://docs.rs/pgrdf" readme = "README.md" keywords = ["postgres", "pgrx", "rdf", "sparql", "shacl"] categories = ["database", "database-implementations"] [lib] crate-type = ["cdylib", "lib"] # pgrx 0.12+ requires a small bin target used by `cargo pgrx package` # during schema generation. See src/bin/pgrx_embed.rs. [[bin]] name = "pgrx_embed_pgrdf" path = "./src/bin/pgrx_embed.rs" [features] # No default feature — every invocation MUST pick a PG major explicitly # (cargo pgrx run pgN, --features pgN, etc). pgrx's per-PG features are # mutually exclusive, so leaving any one as default makes the wrong # things implicit. default = [] # pgrx 0.16 supports PG 13-17. PG 18 support arrives in pgrx 0.17+, which # uses unstable Rust APIs without enabling the feature flag and so fails # to build on stable AND nightly today (rustc 1.95 / 1.97). See # specs/ERRATA E-006. Bump when pgrx publishes a fixed 0.17.x/0.18.x. pg14 = ["pgrx/pg14", "pgrx-tests/pg14"] pg15 = ["pgrx/pg15", "pgrx-tests/pg15"] pg16 = ["pgrx/pg16", "pgrx-tests/pg16"] pg17 = ["pgrx/pg17", "pgrx-tests/pg17"] pg_test = [] # `pgrx::pg_shmem_init!` and the per-PG `#[pg_guard]` shims expand to # `#[cfg(feature = "pg13")]` and `#[cfg(feature = "pg18")]` branches # even when those features are not declared in our Cargo.toml. Rust # 1.91+'s strict check-cfg promotes those to `unexpected_cfgs` warnings, # which CI's `-D warnings` turns into hard errors. Explicitly declare # the values as known so the lint stays quiet without weakening the # overall warning level. [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = [ 'cfg(feature, values("pg13", "pg18"))', ] } [dependencies] pgrx = "0.16" # Pin to `0.3` to match what oxttl 0.2.3 transitively resolves to. # `cargo tree` shows: oxttl v0.2.3 → oxrdf v0.3.3. Using `oxrdf = "0.2"` # split the graph (my pin to 0.2.4, oxttl's to 0.3.3) and types didn't # unify. The published cargo-info output for oxttl@0.2.3 misleadingly # shows "Adding oxrdf v0.2.4" because oxttl's manifest allows both # majors — cargo prefers 0.3.x when no other constraint pulls it down. oxrdf = "0.3" oxttl = "0.2" # Turtle / N-Triples / TriG / N-Quads. Latest stable as of 2026-05-13. spargebra = "0.4" # SPARQL 1.1 parser → algebra AST. Pins =0.3.3 on oxrdf (matches our own). serde_json = "1" # Used by load_turtle_verbose and sparql_parse to emit JSONB. # Phase 4: OWL 2 RL forward-chain reasoner. Pulls in `oxrdf ^0.3.3` # transitively (matches our own pin) plus datafrog / disjoint-sets / # roaring / rio_api. 0.4.1 (2026-05-10) supersedes the v0.2-LLD # reference to 0.2; see specs/ERRATA.v0.2.md for the rationale. # # The `features = ["rdf-12"]` opts into the passthrough feature on # the styk-tv/reasonable fork (branch `rdf12-passthrough`, redirected # via `[patch.crates-io]` at the end of this file). The passthrough # feature forwards to `oxrdf/rdf-12`, which then unifies workspace-wide # with the `rdf-12` enablement that `shacl 0.3.x` (via `rudof_rdf`) # pulls in non-optionally. Drop the feature + the patch once # gtfierro/reasonable merges the upstream PR; see ERRATA.v0.4 E-011. reasonable = { version = "0.4", features = ["rdf-12"] } # Phase 5: W3C-conformant SHACL Core validator from the rudof project. # `shacl 0.3.1` (2026-05-12) consolidated the previous `shacl_ast` + # `shacl_validation` 0.2.x pair into a single crate, resolving the # `iri_s` → `rudof_iri` migration half of ERRATA.v0.2 E-009. The # remaining `rdf-12` half is resolved by the fork patch on `reasonable` # above; see ERRATA.v0.4 E-011. shacl = "0.3" # rudof's RDF abstraction layer. `shacl 0.3` exposes its API in terms # of `rudof_rdf::rdf_core::{RDFFormat, term::Object, ...}` and # `rudof_rdf::rdf_impl::InMemoryGraph` — none of which `shacl` # re-exports. The dep is pinned to the same 0.3.x major as `shacl` # so the type identity unifies workspace-wide. rudof_rdf = "0.3" [dev-dependencies] pgrx-tests = "0.16" [profile.dev] panic = "unwind" [profile.release] panic = "unwind" opt-level = 3 lto = "fat" codegen-units = 1 # Temporary: patches `reasonable` to handle `TermRef::Triple(_)` under # oxrdf's `rdf-12` feature. Required because `shacl 0.3.x` via # `rudof_rdf` hard-enables that feature workspace-wide, which surfaces # the otherwise non-exhaustive match in `reasonable`'s # `lib/src/common.rs:140`. The fork adds a `panic!(...)` arm gated # behind a new passthrough feature `rdf-12 = ["oxrdf/rdf-12"]` — # strictly additive when off, panics with a clear message when on. # # Tracked as ERRATA.v0.4 E-011. Drop this block + pin `reasonable = # "0.4.2"` (or whatever ships) once gtfierro/reasonable merges the # upstream PR (currently held on the fork as PR-DRAFT.md). [patch.crates-io] reasonable = { git = "https://github.com/styk-tv/reasonable", branch = "rdf12-passthrough" }