pgrdf 0.3.0

Rust-native PostgreSQL extension for RDF, SPARQL, SHACL and OWL reasoning
[package]
name = "pgrdf"
version = "0.3.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 = "Apache-2.0"
authors = ["Peter Styk <peter@styk.tv>"]
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"
readme = "README.md"

[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.
reasonable = "0.4"
# Phase 5: W3C-conformant SHACL processor from the rudof project.
# NOT YET ENABLED — see specs/ERRATA.v0.2.md E-009. The 0.2.x line
# (latest 0.2.12, 2026-04-22) ships an unfinished `iri_s` → `rudof_iri`
# migration: `shacl_ast 0.2.9` fails with `expected
# rudof_iri::IriS, found iri_s::IriS`. The 0.1.x line builds in
# isolation but its transitives enable oxrdf's `rdf-12` feature
# which adds `TermRef::Triple`; that variant is unhandled by
# `reasonable 0.4.1` so feature unification breaks the workspace.
# The `pgrdf.validate(...)` SQL surface ships as a stub returning
# `{"status": "stub"}`. Re-evaluate when either:
#   - shacl_validation publishes a 0.2.x release that compiles
#     against a single `iri_s` major, OR
#   - reasonable publishes a version that handles rdf-star /
#     RDF 1.2 triple terms.
# shacl_validation = "0.2"

[dev-dependencies]
pgrx-tests = "0.16"

[profile.dev]
panic = "unwind"

[profile.release]
panic = "unwind"
opt-level = 3
lto = "fat"
codegen-units = 1