jsonld 0.24.0

JSON-LD implementation
Documentation
[package]
name = "jsonld"
edition.workspace = true
authors.workspace = true
categories.workspace = true
keywords.workspace = true
repository.workspace = true
license.workspace = true
rust-version.workspace = true
version.workspace = true
description = "JSON-LD implementation"
documentation = "https://docs.rs/jsonld"
readme.workspace = true
# The W3C conformance suite lives in a 34MB git submodule; shipping it would
# blow past the crates.io package size limit (and it is W3C-licensed). The four
# runners below generate their cases from that submodule's manifests through
# `jsonld-testing`, which is unpublished and depended on by path, so in a
# published crate they would fail to compile rather than run: neither their
# fixtures nor their macro is there. The `shared_context` benchmark stays out
# too, with its fixture: that is the ETSI NGSI-LD core context, a third-party
# document. The remaining test targets, the benchmarks and the example are
# self-contained and do ship.
exclude = [
    "tests/json-ld-api",
    "tests/compact.rs",
    "tests/expand.rs",
    "tests/flatten.rs",
    "tests/to_rdf.rs",
    "benches/shared_context.rs",
    "benches/ngsi-ld-core-context-v1.9.jsonld",
]
# `benches/common.rs` is a shared fixture module, not a benchmark. Auto-
# discovery would turn it into a libtest-harness bench target, which rejects
# the criterion flags before `expansion` or `compaction` ever run.
autobenches = false

[features]
default = ["bytewise-iri"]
bytewise-iri = [
    "iri-rs/bytewise",
    "jsonld-core/bytewise-iri",
    "jsonld-syntax/bytewise-iri",
    "jsonld-context-processing/bytewise-iri",
    "jsonld-expansion/bytewise-iri",
    "jsonld-compaction/bytewise-iri",
    "jsonld-serialization/bytewise-iri",
]
reqwest = ["jsonld-core/reqwest"]
serde = ["jsonld-syntax/serde", "jsonld-core/serde"]
serde-json = ["jsonld-syntax/serde-json", "jsonld-core/serde-json"]
sonic-rs = ["jsonld-syntax/sonic-rs", "jsonld-core/sonic-rs"]
ahash = ["jsonld-core/ahash"]
gxhash = ["jsonld-core/gxhash"]
expandable = ["dep:jsonld-expandable", "dep:jsonld-expandable-core"]
expandable-serde-json = ["expandable", "jsonld-expandable-core/serde-json"]
expandable-sonic-rs = ["expandable", "sonic-rs", "jsonld-expandable-core/sonic-rs"]
expandable-jstrict = ["expandable", "jsonld-expandable-core/jstrict"]
expandable-chrono = ["expandable", "jsonld-expandable-core/chrono"]
vocab = ["dep:jsonld-vocab", "iri-rs/static"]

[dependencies]
contextual = "0.1.6"
iri-rs = "3.4.1"
jsonld-compaction.workspace = true
jsonld-context-processing.workspace = true
jsonld-core.workspace = true
jsonld-expandable = { workspace = true, optional = true }
jsonld-expandable-core = { workspace = true, optional = true }
jsonld-expansion.workspace = true
jsonld-serialization.workspace = true
jsonld-syntax.workspace = true
jsonld-vocab = { workspace = true, optional = true }
jstrict = "0.16.0"
rdfx = "0.24.0"
thiserror = "2.0.21"

[dev-dependencies]
criterion = "0.8.2"
iri-rs = { version = "3.4.1", features = ["static"] }
# Path-only (no version) so `cargo package` strips this dev-dep: jsonld-testing
# is not published, and a versioned entry would make `cargo publish` demand it
# on crates.io (circular with this crate).
jsonld-testing = { path = "../jsonld-testing" }
log = "0.4.34"
mimalloc = { version = "0.1.52", default-features = false }
n-quads = "0.21.0"
serde_json = "1.0.151"
stacker = "0.1.25"
tokio = { version = "1.53.1", features = ["macros", "rt-multi-thread"] }

[lib]
# The lib target has no benchmarks of its own; leaving it bench-enabled makes
# `cargo bench -p jsonld` run the libtest harness first, which rejects the
# criterion flags (`--save-baseline`, `--baseline`) before any bench runs.
bench = false

[[bench]]
name = "expansion"
harness = false

[[bench]]
name = "compaction"
harness = false

[[bench]]
name = "shared_context"
harness = false

[[example]]
name = "profile"
path = "examples/profile.rs"

[package.metadata.docs.rs]
all-features = true
# The `gxhash` feature hard-fails without AES intrinsics; docs.rs applies
# rustc-args as extra RUSTFLAGS, so this reaches the gxhash dependency build.
rustc-args = ["-C", "target-cpu=native"]
# Enables the `doc_auto_cfg` attribute in lib.rs, which labels each
# feature-gated item with the feature that unlocks it.
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.cargo-machete]
# `criterion` is used by the `benches/*` targets, which cargo-machete does not
# parse.
ignored = ["criterion"]

[lints]
workspace = true