Releases v0.4.0-alpha.1

pull/715/head v0.4.0-alpha.1
Tpt 11 months ago committed by Thomas Tanon
parent a84b898fda
commit a5781d1187
  1. 12
      .github/workflows/artifacts.yml
  2. 55
      CHANGELOG.md
  3. 76
      Cargo.lock
  4. 2
      Cargo.toml
  5. 2
      cli/Cargo.toml
  6. 2
      js/Cargo.toml
  7. 14
      lib/Cargo.toml
  8. 8
      lib/README.md
  9. 4
      lib/oxrdf/Cargo.toml
  10. 2
      lib/oxrdf/README.md
  11. 10
      lib/oxrdfio/Cargo.toml
  12. 2
      lib/oxrdfio/README.md
  13. 7
      lib/oxrdfio/src/parser.rs
  14. 32
      lib/oxrdfio/src/serializer.rs
  15. 6
      lib/oxrdfxml/Cargo.toml
  16. 2
      lib/oxrdfxml/README.md
  17. 2
      lib/oxsdatatypes/Cargo.toml
  18. 6
      lib/oxttl/Cargo.toml
  19. 3
      lib/oxttl/src/nquads.rs
  20. 3
      lib/oxttl/src/trig.rs
  21. 3
      lib/oxttl/src/turtle.rs
  22. 4
      lib/sparesults/Cargo.toml
  23. 3
      lib/sparesults/README.md
  24. 32
      lib/sparesults/src/serializer.rs
  25. 4
      lib/spargebra/Cargo.toml
  26. 6
      lib/sparopt/Cargo.toml
  27. 2
      lib/sparql-smith/Cargo.toml
  28. 2
      lib/src/io/mod.rs
  29. 8
      lib/src/io/write.rs
  30. 42
      lib/src/store.rs
  31. 2
      python/Cargo.toml
  32. 13
      python/docs/migration.rst

@ -351,12 +351,24 @@ jobs:
- run: cargo publish - run: cargo publish
working-directory: ./lib/oxrdf working-directory: ./lib/oxrdf
continue-on-error: true continue-on-error: true
- run: cargo publish
working-directory: ./lib/oxrdfxml
continue-on-error: true
- run: cargo publish
working-directory: ./lib/oxttl
continue-on-error: true
- run: cargo publish
working-directory: ./lib/oxrdfio
continue-on-error: true
- run: cargo publish - run: cargo publish
working-directory: ./lib/sparesults working-directory: ./lib/sparesults
continue-on-error: true continue-on-error: true
- run: cargo publish - run: cargo publish
working-directory: ./lib/spargebra working-directory: ./lib/spargebra
continue-on-error: true continue-on-error: true
- run: cargo publish
working-directory: ./lib/sparopt
continue-on-error: true
- run: cargo publish - run: cargo publish
working-directory: ./lib/sparql-smith working-directory: ./lib/sparql-smith
continue-on-error: true continue-on-error: true

@ -1,3 +1,58 @@
## [0.4.0-alpha.1] - 2024-01-03
### Added
- `sparopt` crate: A new still quite naive query optimizer.
- `oxttl` crate: A N-Triples/N-Quads/Turtle/TriG/N3 parser and serializer compatible with Tokio.
- `oxrdfxml` crate: A RDF/XML parser and serializer compatible with Tokio.
- `oxrdfio` crate: A stand-alone crate with oxigraph I/O related APIs.
- Rust: SPARQL results I/O is now exposed in the `oxigraph` crate (`oxigraph::sparql::results` module).
- Rust: It is now possible to dynamically link rocksdb with the `rocksdb-pkg-config` feature.
- Python: error location is now included in some `SyntaxError` exceptions.
- Python: the file type can be guessed from the file path extension during parsing and serialization.
- Python: the serialization method returns a `bytes` value if no output-related argument is given.
- Python: SPARQL query results I/O is now exposed (`parse_query_results` function and `.serialize` method).
- Python: `RdfFormat` and `QueryResultsFormat` enum to encode supported formats.
- CLI: a `convert` command to convert RDF file between different formats.
### Removed
- Rust: automated flush at the end of serialization. This should be done explicitly now.
- oxsdatatypes: Deprecated methods.
- Python: 3.7 and Musl linux 1.1 support.
- Python: `GraphName.value`.
### Changed
- SPARQL: a digit after `.` is now required for `xsd:decimal`.
- SPARQL: calendar subtraction returns `xsd:dayTimeDuration` and not `xsd:duration`.
- SPARQL: Unicode escapes (`\u` and `\U`) are now only supported in IRIs and strings and not everywhere.
- Literal serialization now produces canonical N-Triples according to the RDF 1.2 and RDF Dataset Canonicalization drafts
- Rust: MSRV is now 1.70.
- Rust Makes `GraphName` implement `Default`.
- Rust: `wasm32-unknown-unknown` does not assumes JS platform by default. Enable the `js` feature for that.
- Rust: Parsers take `Read` and not `BufRead` for input.
- Rust: `GraphFormat` and `DatasetFormat` have been merged into `RdfFormat`.
- Rust: `GraphParser` and `DatasetParser` have been merged into `RdfParser`.
- Rust: `GraphSerializer` and `DatasetSerializer` have been merged into `RdfSerializer`.
- Rust: query results are now `Send` and `Sync`.
- Rust: `Store.load_graph` and `Store.load_dataset` have been merged into a `load_from_read` method.
- Rust: `Store.dump_graph` and `Store.dump_dataset` have been renamed to `dump_graph_to_write` and `dump_to_write`.
- Rust: `BulkLoader.set_*` methods have been renamed to `BulkLoader.with_*`.
- oxsdatatypes: pass by-values instead of by-reference parameters when relevant.
- oxsdatatypes: error types have been redesigned.
- oxsdatatypes: return an error when building not serializable duration (year-month and day-time of opposite signs).
- sparesults: renames some methods to move closer to the new oxrdfio crate.
- Python: raise `OSError` instead of `IOError` on OS errors.
- Python: the `mime_type` parameter have been renamed to `format`.
- Python: boolean SPARQL results are now encoded with a `QueryBoolean` class and not a simple `bool`.
- Python: a `path` parameter has been added to all I/O method to read from a file.
The existing `input` parameter now consider `str` values to be a serialization to parse.
- JS: the `mime_type` parameter have been renamed to `format`.
- CLI: the `oxigraph_server` binary has been renamed to `oxigraph`.
- CLI: the `--location` argument is now part of sub-commands where it is relevant.
`oxigraph_server --location foo serve` is not possible anymore.
One need to write `oxigraph serve --location foo`.
- CLI: is is now possible to upload gzip encoded files to the HTTP API with the `Content-Encoding: gzip` header.
## [0.3.22] - 2023-11-29 ## [0.3.22] - 2023-11-29
### Changed ### Changed

76
Cargo.lock generated

@ -82,9 +82,9 @@ dependencies = [
[[package]] [[package]]
name = "anyhow" name = "anyhow"
version = "1.0.78" version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca87830a3e3fb156dc96cfbd31cb620265dd053be734723f22b760d6cc3c3051" checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]] [[package]]
name = "arbitrary" name = "arbitrary"
@ -279,9 +279,9 @@ dependencies = [
[[package]] [[package]]
name = "clang-sys" name = "clang-sys"
version = "1.6.1" version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1"
dependencies = [ dependencies = [
"glob", "glob",
"libc", "libc",
@ -837,12 +837,12 @@ checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4"
[[package]] [[package]]
name = "libloading" name = "libloading"
version = "0.7.4" version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"winapi 0.3.9", "windows-sys 0.48.0",
] ]
[[package]] [[package]]
@ -1033,7 +1033,7 @@ dependencies = [
[[package]] [[package]]
name = "oxigraph" name = "oxigraph"
version = "0.4.0-alpha.1-dev" version = "0.4.0-alpha.1"
dependencies = [ dependencies = [
"codspeed-criterion-compat", "codspeed-criterion-compat",
"digest", "digest",
@ -1063,7 +1063,7 @@ dependencies = [
[[package]] [[package]]
name = "oxigraph-cli" name = "oxigraph-cli"
version = "0.4.0-alpha.1-dev" version = "0.4.0-alpha.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"assert_cmd", "assert_cmd",
@ -1082,7 +1082,7 @@ dependencies = [
[[package]] [[package]]
name = "oxigraph-js" name = "oxigraph-js"
version = "0.4.0-alpha.1-dev" version = "0.4.0-alpha.1"
dependencies = [ dependencies = [
"console_error_panic_hook", "console_error_panic_hook",
"js-sys", "js-sys",
@ -1092,7 +1092,7 @@ dependencies = [
[[package]] [[package]]
name = "oxigraph-testsuite" name = "oxigraph-testsuite"
version = "0.4.0-alpha.1-dev" version = "0.4.0-alpha.1"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@ -1119,7 +1119,7 @@ checksum = "b225dad32cfaa43a960b93f01fa7f87528ac07e794b80f6d9a0153e0222557e2"
[[package]] [[package]]
name = "oxrdf" name = "oxrdf"
version = "0.2.0-alpha.1-dev" version = "0.2.0-alpha.1"
dependencies = [ dependencies = [
"oxilangtag", "oxilangtag",
"oxiri", "oxiri",
@ -1129,7 +1129,7 @@ dependencies = [
[[package]] [[package]]
name = "oxrdfio" name = "oxrdfio"
version = "0.1.0-alpha.1-dev" version = "0.1.0-alpha.1"
dependencies = [ dependencies = [
"oxrdf", "oxrdf",
"oxrdfxml", "oxrdfxml",
@ -1139,7 +1139,7 @@ dependencies = [
[[package]] [[package]]
name = "oxrdfxml" name = "oxrdfxml"
version = "0.1.0-alpha.1-dev" version = "0.1.0-alpha.1"
dependencies = [ dependencies = [
"oxilangtag", "oxilangtag",
"oxiri", "oxiri",
@ -1150,7 +1150,7 @@ dependencies = [
[[package]] [[package]]
name = "oxrocksdb-sys" name = "oxrocksdb-sys"
version = "0.4.0-alpha.1-dev" version = "0.4.0-alpha.1"
dependencies = [ dependencies = [
"bindgen", "bindgen",
"cc", "cc",
@ -1160,14 +1160,14 @@ dependencies = [
[[package]] [[package]]
name = "oxsdatatypes" name = "oxsdatatypes"
version = "0.2.0-alpha.1-dev" version = "0.2.0-alpha.1"
dependencies = [ dependencies = [
"js-sys", "js-sys",
] ]
[[package]] [[package]]
name = "oxttl" name = "oxttl"
version = "0.1.0-alpha.1-dev" version = "0.1.0-alpha.1"
dependencies = [ dependencies = [
"memchr", "memchr",
"oxilangtag", "oxilangtag",
@ -1323,9 +1323,9 @@ dependencies = [
[[package]] [[package]]
name = "prettyplease" name = "prettyplease"
version = "0.2.15" version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"syn", "syn",
@ -1333,9 +1333,9 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.72" version = "1.0.74"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a293318316cf6478ec1ad2a21c49390a8d5b5eae9fab736467d93fbc0edc29c5" checksum = "2de98502f212cfcea8d0bb305bd0f49d7ebdd75b64ba0a68f937d888f4e0d6db"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@ -1403,7 +1403,7 @@ dependencies = [
[[package]] [[package]]
name = "pyoxigraph" name = "pyoxigraph"
version = "0.4.0-alpha.1-dev" version = "0.4.0-alpha.1"
dependencies = [ dependencies = [
"oxigraph", "oxigraph",
"pyo3", "pyo3",
@ -1421,9 +1421,9 @@ dependencies = [
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.33" version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
@ -1664,18 +1664,18 @@ dependencies = [
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.193" version = "1.0.194"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" checksum = "0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.193" version = "1.0.194"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1684,9 +1684,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.108" version = "1.0.110"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" checksum = "6fbd975230bada99c8bb618e0c365c2eefa219158d5c6c29610fd09ff1833257"
dependencies = [ dependencies = [
"itoa", "itoa",
"ryu", "ryu",
@ -1735,7 +1735,7 @@ checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970"
[[package]] [[package]]
name = "sparesults" name = "sparesults"
version = "0.2.0-alpha.1-dev" version = "0.2.0-alpha.1"
dependencies = [ dependencies = [
"json-event-parser", "json-event-parser",
"memchr", "memchr",
@ -1746,7 +1746,7 @@ dependencies = [
[[package]] [[package]]
name = "spargebra" name = "spargebra"
version = "0.3.0-alpha.1-dev" version = "0.3.0-alpha.1"
dependencies = [ dependencies = [
"oxilangtag", "oxilangtag",
"oxiri", "oxiri",
@ -1757,7 +1757,7 @@ dependencies = [
[[package]] [[package]]
name = "sparopt" name = "sparopt"
version = "0.1.0-alpha.1-dev" version = "0.1.0-alpha.1"
dependencies = [ dependencies = [
"oxrdf", "oxrdf",
"rand", "rand",
@ -1766,7 +1766,7 @@ dependencies = [
[[package]] [[package]]
name = "sparql-smith" name = "sparql-smith"
version = "0.1.0-alpha.5-dev" version = "0.1.0-alpha.5"
dependencies = [ dependencies = [
"arbitrary", "arbitrary",
] ]
@ -1791,9 +1791,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.43" version = "2.0.46"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" checksum = "89456b690ff72fddcecf231caedbe615c59480c93358a93dfae7fc29e3ebbf0e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1802,9 +1802,9 @@ dependencies = [
[[package]] [[package]]
name = "target-lexicon" name = "target-lexicon"
version = "0.12.12" version = "0.12.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae"
[[package]] [[package]]
name = "tempfile" name = "tempfile"

@ -19,7 +19,7 @@ members = [
resolver = "2" resolver = "2"
[workspace.package] [workspace.package]
version = "0.4.0-alpha.1-dev" version = "0.4.0-alpha.1"
authors = ["Tpt <thomas@pellissier-tanon.fr>"] authors = ["Tpt <thomas@pellissier-tanon.fr>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
homepage = "https://oxigraph.org/" homepage = "https://oxigraph.org/"

@ -29,7 +29,7 @@ rustls-webpki = ["oxigraph/http-client-rustls-webpki"]
anyhow = "1.0.72" anyhow = "1.0.72"
oxhttp = { version = "0.2.0-alpha.3", features = ["flate2"] } oxhttp = { version = "0.2.0-alpha.3", features = ["flate2"] }
clap = { version = "4.0", features = ["derive"] } clap = { version = "4.0", features = ["derive"] }
oxigraph = { version = "0.4.0-alpha.1-dev", path = "../lib" } oxigraph = { version = "0.4.0-alpha.1", path = "../lib" }
rand = "0.8" rand = "0.8"
url = "2.4" url = "2.4"
oxiri = "0.2.3-alpha.1" oxiri = "0.2.3-alpha.1"

@ -16,7 +16,7 @@ crate-type = ["cdylib"]
name = "oxigraph" name = "oxigraph"
[dependencies] [dependencies]
oxigraph = { version = "0.4.0-alpha.1-dev", path="../lib", features = ["js"] } oxigraph = { version = "0.4.0-alpha.1", path="../lib", features = ["js"] }
wasm-bindgen = "0.2.83" wasm-bindgen = "0.2.83"
js-sys = "0.3.60" js-sys = "0.3.60"
console_error_panic_hook = "0.1.7" console_error_panic_hook = "0.1.7"

@ -32,21 +32,21 @@ json-event-parser = "0.2.0-alpha.2"
md-5 = "0.10" md-5 = "0.10"
oxilangtag = "0.1" oxilangtag = "0.1"
oxiri = "0.2.3-alpha.1" oxiri = "0.2.3-alpha.1"
oxrdf = { version = "0.2.0-alpha.1-dev", path = "oxrdf", features = ["rdf-star", "oxsdatatypes"] } oxrdf = { version = "0.2.0-alpha.1", path = "oxrdf", features = ["rdf-star", "oxsdatatypes"] }
oxrdfio = { version = "0.1.0-alpha.1-dev", path = "oxrdfio", features = ["rdf-star"] } oxrdfio = { version = "0.1.0-alpha.1", path = "oxrdfio", features = ["rdf-star"] }
oxsdatatypes = { version = "0.2.0-alpha.1-dev", path="oxsdatatypes" } oxsdatatypes = { version = "0.2.0-alpha.1", path="oxsdatatypes" }
rand = "0.8" rand = "0.8"
regex = "1.7" regex = "1.7"
sha1 = "0.10" sha1 = "0.10"
sha2 = "0.10" sha2 = "0.10"
siphasher = ">=0.3, <2.0" siphasher = ">=0.3, <2.0"
sparesults = { version = "0.2.0-alpha.1-dev", path = "sparesults", features = ["rdf-star"] } sparesults = { version = "0.2.0-alpha.1", path = "sparesults", features = ["rdf-star"] }
spargebra = { version = "0.3.0-alpha.1-dev", path = "spargebra", features = ["rdf-star", "sep-0002", "sep-0006"] } spargebra = { version = "0.3.0-alpha.1", path = "spargebra", features = ["rdf-star", "sep-0002", "sep-0006"] }
sparopt = { version = "0.1.0-alpha.1-dev", path="sparopt", features = ["rdf-star", "sep-0002", "sep-0006"] } sparopt = { version = "0.1.0-alpha.1", path="sparopt", features = ["rdf-star", "sep-0002", "sep-0006"] }
[target.'cfg(not(target_family = "wasm"))'.dependencies] [target.'cfg(not(target_family = "wasm"))'.dependencies]
libc = "0.2.147" libc = "0.2.147"
oxrocksdb-sys = { version = "0.4.0-alpha.1-dev", path="../oxrocksdb-sys" } oxrocksdb-sys = { version = "0.4.0-alpha.1", path="../oxrocksdb-sys" }
oxhttp = { version = "0.2.0-alpha.3", optional = true } oxhttp = { version = "0.2.0-alpha.3", optional = true }
[target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies] [target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies]

@ -14,7 +14,7 @@ It also provides a set of utility functions for reading, writing, and processing
Oxigraph is in heavy development and SPARQL query evaluation has not been optimized yet. Oxigraph is in heavy development and SPARQL query evaluation has not been optimized yet.
Oxigraph also provides [a standalone HTTP server](https://crates.io/crates/oxigraph-cli) and [a Python library](https://pyoxigraph.readthedocs.io/) based on this library. Oxigraph also provides [a CLI tool](https://crates.io/crates/oxigraph-cli) and [a Python library](https://pyoxigraph.readthedocs.io/) based on this library.
Oxigraph implements the following specifications: Oxigraph implements the following specifications:
@ -48,8 +48,8 @@ if let QueryResults::Solutions(mut solutions) = store.query("SELECT ?s WHERE {
``` ```
Some parts of this library are available as standalone crates: Some parts of this library are available as standalone crates:
* [`oxrdf`](https://crates.io/crates/oxrdf), datastructures encoding RDF basic concepts (the `oxigraph::model` module). * [`oxrdf`](https://crates.io/crates/oxrdf), datastructures encoding RDF basic concepts (the [`oxigraph::model`](crate::model) module).
* [`oxrdfio`](https://crates.io/crates/oxrdfio), a unified parser and serializer API for RDF formats. It itself relies on: * [`oxrdfio`](https://crates.io/crates/oxrdfio), a unified parser and serializer API for RDF formats (the [`oxigraph::io`](crate::io) module). It itself relies on:
* [`oxttl`](https://crates.io/crates/oxttl), N-Triple, N-Quad, Turtle, TriG and N3 parsing and serialization. * [`oxttl`](https://crates.io/crates/oxttl), N-Triple, N-Quad, Turtle, TriG and N3 parsing and serialization.
* [`oxrdfxml`](https://crates.io/crates/oxrdfxml), RDF/XML parsing and serialization. * [`oxrdfxml`](https://crates.io/crates/oxrdfxml), RDF/XML parsing and serialization.
* [`spargebra`](https://crates.io/crates/spargebra), a SPARQL parser. * [`spargebra`](https://crates.io/crates/spargebra), a SPARQL parser.
@ -57,7 +57,7 @@ Some parts of this library are available as standalone crates:
* [`sparopt`](https://crates.io/crates/sparesults), a SPARQL optimizer. * [`sparopt`](https://crates.io/crates/sparesults), a SPARQL optimizer.
* [`oxsdatatypes`](https://crates.io/crates/oxsdatatypes), an implementation of some XML Schema datatypes. * [`oxsdatatypes`](https://crates.io/crates/oxsdatatypes), an implementation of some XML Schema datatypes.
To build the library, don't forget to clone the submodules using `git clone --recursive https://github.com/oxigraph/oxigraph.git` to clone the repository including submodules or `git submodule update --init` to add submodules to the already cloned repository. To build the library locally, don't forget to clone the submodules using `git clone --recursive https://github.com/oxigraph/oxigraph.git` to clone the repository including submodules or `git submodule update --init` to add submodules to the already cloned repository.
## License ## License

@ -1,6 +1,6 @@
[package] [package]
name = "oxrdf" name = "oxrdf"
version = "0.2.0-alpha.1-dev" version = "0.2.0-alpha.1"
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
readme = "README.md" readme = "README.md"
@ -22,7 +22,7 @@ rdf-star = []
rand = "0.8" rand = "0.8"
oxilangtag = "0.1" oxilangtag = "0.1"
oxiri = "0.2.3-alpha.1" oxiri = "0.2.3-alpha.1"
oxsdatatypes = { version = "0.2.0-alpha.1-dev", path="../oxsdatatypes", optional = true } oxsdatatypes = { version = "0.2.0-alpha.1", path="../oxsdatatypes", optional = true }
[lints] [lints]
workspace = true workspace = true

@ -15,6 +15,8 @@ Support for [RDF-star](https://w3c.github.io/rdf-star/cg-spec/2021-12-17.html) i
OxRDF is inspired by [RDF/JS](https://rdf.js.org/data-model-spec/) and [Apache Commons RDF](http://commons.apache.org/proper/commons-rdf/). OxRDF is inspired by [RDF/JS](https://rdf.js.org/data-model-spec/) and [Apache Commons RDF](http://commons.apache.org/proper/commons-rdf/).
Use [`oxrdfio`](https://crates.io/crates/oxrdfio) if you need to read or write RDF files.
Usage example: Usage example:
```rust ```rust

@ -1,6 +1,6 @@
[package] [package]
name = "oxrdfio" name = "oxrdfio"
version = "0.1.0-alpha.1-dev" version = "0.1.0-alpha.1"
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
readme = "README.md" readme = "README.md"
@ -9,7 +9,7 @@ repository = "https://github.com/oxigraph/oxigraph/tree/master/lib/oxrdfxml"
homepage.workspace = true homepage.workspace = true
documentation = "https://docs.rs/oxrdfio" documentation = "https://docs.rs/oxrdfio"
description = """ description = """
Parser for various RDF serializations Parser and serializer for various RDF formats
""" """
edition.workspace = true edition.workspace = true
rust-version.workspace = true rust-version.workspace = true
@ -20,9 +20,9 @@ async-tokio = ["dep:tokio", "oxrdfxml/async-tokio", "oxttl/async-tokio"]
rdf-star = ["oxrdf/rdf-star", "oxttl/rdf-star"] rdf-star = ["oxrdf/rdf-star", "oxttl/rdf-star"]
[dependencies] [dependencies]
oxrdf = { version = "0.2.0-alpha.1-dev", path = "../oxrdf" } oxrdf = { version = "0.2.0-alpha.1", path = "../oxrdf" }
oxrdfxml = { version = "0.1.0-alpha.1-dev", path = "../oxrdfxml" } oxrdfxml = { version = "0.1.0-alpha.1", path = "../oxrdfxml" }
oxttl = { version = "0.1.0-alpha.1-dev", path = "../oxttl" } oxttl = { version = "0.1.0-alpha.1", path = "../oxttl" }
tokio = { version = "1.29", optional = true, features = ["io-util"] } tokio = { version = "1.29", optional = true, features = ["io-util"] }
[dev-dependencies] [dev-dependencies]

@ -21,6 +21,8 @@ Support for [SPARQL-star](https://w3c.github.io/rdf-star/cg-spec/2021-12-17.html
It is designed as a low level parser compatible with both synchronous and asynchronous I/O (behind the `async-tokio` feature). It is designed as a low level parser compatible with both synchronous and asynchronous I/O (behind the `async-tokio` feature).
The entry points of this library are the two [`RdfParser`] and [`RdfSerializer`] structs.
Usage example converting a Turtle file to a N-Triples file: Usage example converting a Turtle file to a N-Triples file:
```rust ```rust
use oxrdfio::{RdfFormat, RdfParser, RdfSerializer}; use oxrdfio::{RdfFormat, RdfParser, RdfSerializer};

@ -37,9 +37,10 @@ use tokio::io::AsyncRead;
/// * [Turtle](https://www.w3.org/TR/turtle/) ([`RdfFormat::Turtle`]) /// * [Turtle](https://www.w3.org/TR/turtle/) ([`RdfFormat::Turtle`])
/// ///
/// Note the useful options: /// Note the useful options:
/// - [`with_base_iri`](RdfParser::with_base_iri) to resolve the relative IRIs. /// - [`with_base_iri`](Self::with_base_iri) to resolve the relative IRIs.
/// - [`rename_blank_nodes`](RdfParser::rename_blank_nodes) to rename the blank nodes to auto-generated numbers to avoid conflicts when merging RDF graphs together. /// - [`rename_blank_nodes`](Self::rename_blank_nodes) to rename the blank nodes to auto-generated numbers to avoid conflicts when merging RDF graphs together.
/// - [`without_named_graphs`](RdfParser::without_named_graphs) to parse a single graph. /// - [`without_named_graphs`](Self::without_named_graphs) to parse a single graph.
/// - [`unchecked`](Self::unchecked) to skip some validations if the file is already known to be valid.
/// ///
/// ``` /// ```
/// use oxrdfio::{RdfFormat, RdfParser}; /// use oxrdfio::{RdfFormat, RdfParser};

@ -73,9 +73,13 @@ impl RdfSerializer {
/// Writes to a [`Write`] implementation. /// Writes to a [`Write`] implementation.
/// ///
/// <div class="warning">Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div> /// <div class="warning">
/// ///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div> /// Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
///
/// This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// ///
/// ``` /// ```
/// use oxrdfio::{RdfFormat, RdfSerializer}; /// use oxrdfio::{RdfFormat, RdfSerializer};
@ -118,9 +122,13 @@ impl RdfSerializer {
/// Writes to a Tokio [`AsyncWrite`] implementation. /// Writes to a Tokio [`AsyncWrite`] implementation.
/// ///
/// <div class="warning">Do not forget to run the [`finish`](ToTokioAsyncWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div> /// <div class="warning">
///
/// Do not forget to run the [`finish`](ToTokioAsyncWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
/// ///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](tokio::io::BufWriter) to avoid that.</div> /// This writer does unbuffered writes. You might want to use [`BufWriter`](tokio::io::BufWriter) to avoid that.</div>
/// ///
/// ``` /// ```
/// use oxrdfio::{RdfFormat, RdfSerializer}; /// use oxrdfio::{RdfFormat, RdfSerializer};
@ -179,9 +187,13 @@ impl From<RdfFormat> for RdfSerializer {
/// ///
/// Can be built using [`RdfSerializer::serialize_to_write`]. /// Can be built using [`RdfSerializer::serialize_to_write`].
/// ///
/// <div class="warning">Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div> /// <div class="warning">
/// ///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div> /// Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
///
/// This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// ///
/// ``` /// ```
/// use oxrdfio::{RdfFormat, RdfSerializer}; /// use oxrdfio::{RdfFormat, RdfSerializer};
@ -248,9 +260,13 @@ impl<W: Write> ToWriteQuadWriter<W> {
/// ///
/// Can be built using [`RdfSerializer::serialize_to_write`]. /// Can be built using [`RdfSerializer::serialize_to_write`].
/// ///
/// <div class="warning">Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div> /// <div class="warning">
///
/// Do not forget to run the [`finish`](ToWriteQuadWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
/// ///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div> /// This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// ///
/// ``` /// ```
/// use oxrdfio::{RdfFormat, RdfSerializer}; /// use oxrdfio::{RdfFormat, RdfSerializer};

@ -1,6 +1,6 @@
[package] [package]
name = "oxrdfxml" name = "oxrdfxml"
version = "0.1.0-alpha.1-dev" version = "0.1.0-alpha.1"
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
readme = "README.md" readme = "README.md"
@ -8,7 +8,7 @@ keywords = ["RDFXML", "XML", "RDF"]
repository = "https://github.com/oxigraph/oxigraph/tree/master/lib/oxrdfxml" repository = "https://github.com/oxigraph/oxigraph/tree/master/lib/oxrdfxml"
homepage.workspace = true homepage.workspace = true
description = """ description = """
Parser for the RDF/XML language Parser and serializer for the RDF/XML format
""" """
documentation = "https://docs.rs/oxrdfxml" documentation = "https://docs.rs/oxrdfxml"
edition.workspace = true edition.workspace = true
@ -19,7 +19,7 @@ default = []
async-tokio = ["dep:tokio", "quick-xml/async-tokio"] async-tokio = ["dep:tokio", "quick-xml/async-tokio"]
[dependencies] [dependencies]
oxrdf = { version = "0.2.0-alpha.1-dev", path = "../oxrdf" } oxrdf = { version = "0.2.0-alpha.1", path = "../oxrdf" }
oxilangtag = "0.1" oxilangtag = "0.1"
oxiri = "0.2.3-alpha.1" oxiri = "0.2.3-alpha.1"
quick-xml = ">=0.29, <0.32" quick-xml = ">=0.29, <0.32"

@ -9,6 +9,8 @@ OxRDF/XML
OxRdfXml is a parser and serializer for [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/). OxRdfXml is a parser and serializer for [RDF/XML](https://www.w3.org/TR/rdf-syntax-grammar/).
The entry points of this library are the two [`RdfXmlParser`] and [`RdfXmlSerializer`] structs.
Usage example counting the number of people in a RDF/XML file: Usage example counting the number of people in a RDF/XML file:
```rust ```rust
use oxrdf::{NamedNodeRef, vocab::rdf}; use oxrdf::{NamedNodeRef, vocab::rdf};

@ -1,6 +1,6 @@
[package] [package]
name = "oxsdatatypes" name = "oxsdatatypes"
version = "0.2.0-alpha.1-dev" version = "0.2.0-alpha.1"
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
readme = "README.md" readme = "README.md"

@ -1,6 +1,6 @@
[package] [package]
name = "oxttl" name = "oxttl"
version = "0.1.0-alpha.1-dev" version = "0.1.0-alpha.1"
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
readme = "README.md" readme = "README.md"
@ -8,7 +8,7 @@ keywords = ["N-Triples", "N-Quads", "Turtle", "TriG", "N3"]
repository = "https://github.com/oxigraph/oxigraph/tree/master/lib/oxttl" repository = "https://github.com/oxigraph/oxigraph/tree/master/lib/oxttl"
homepage.workspace = true homepage.workspace = true
description = """ description = """
Parser for languages related to RDF Turtle (N-Triples, N-Quads, Turtle, TriG and N3) Parser and serializer for languages related to RDF Turtle (N-Triples, N-Quads, Turtle, TriG and N3)
""" """
documentation = "https://docs.rs/oxttl" documentation = "https://docs.rs/oxttl"
edition.workspace = true edition.workspace = true
@ -21,7 +21,7 @@ async-tokio = ["dep:tokio"]
[dependencies] [dependencies]
memchr = "2.5" memchr = "2.5"
oxrdf = { version = "0.2.0-alpha.1-dev", path = "../oxrdf" } oxrdf = { version = "0.2.0-alpha.1", path = "../oxrdf" }
oxiri = "0.2.3-alpha.1" oxiri = "0.2.3-alpha.1"
oxilangtag = "0.1" oxilangtag = "0.1"
tokio = { version = "1.29", optional = true, features = ["io-util"] } tokio = { version = "1.29", optional = true, features = ["io-util"] }

@ -1,4 +1,5 @@
//! A [N-Quads](https://www.w3.org/TR/n-quads/) streaming parser implemented by [`NQuadsParser`]. //! A [N-Quads](https://www.w3.org/TR/n-quads/) streaming parser implemented by [`NQuadsParser`]
//! and a serializer implemented by [`NQuadsSerializer`].
use crate::line_formats::NQuadsRecognizer; use crate::line_formats::NQuadsRecognizer;
#[cfg(feature = "async-tokio")] #[cfg(feature = "async-tokio")]

@ -1,4 +1,5 @@
//! A [TriG](https://www.w3.org/TR/trig/) streaming parser implemented by [`TriGParser`]. //! A [TriG](https://www.w3.org/TR/trig/) streaming parser implemented by [`TriGParser`]
//! and a serializer implemented by [`TriGSerializer`].
use crate::terse::TriGRecognizer; use crate::terse::TriGRecognizer;
#[cfg(feature = "async-tokio")] #[cfg(feature = "async-tokio")]

@ -1,4 +1,5 @@
//! A [Turtle](https://www.w3.org/TR/turtle/) streaming parser implemented by [`TurtleParser`]. //! A [Turtle](https://www.w3.org/TR/turtle/) streaming parser implemented by [`TurtleParser`]
//! and a serializer implemented by [`TurtleSerializer`].
use crate::terse::TriGRecognizer; use crate::terse::TriGRecognizer;
#[cfg(feature = "async-tokio")] #[cfg(feature = "async-tokio")]

@ -1,6 +1,6 @@
[package] [package]
name = "sparesults" name = "sparesults"
version = "0.2.0-alpha.1-dev" version = "0.2.0-alpha.1"
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
readme = "README.md" readme = "README.md"
@ -22,7 +22,7 @@ async-tokio = ["dep:tokio", "quick-xml/async-tokio", "json-event-parser/async-to
[dependencies] [dependencies]
json-event-parser = "0.2.0-alpha.2" json-event-parser = "0.2.0-alpha.2"
memchr = "2.5" memchr = "2.5"
oxrdf = { version = "0.2.0-alpha.1-dev", path="../oxrdf" } oxrdf = { version = "0.2.0-alpha.1", path="../oxrdf" }
quick-xml = ">=0.29, <0.32" quick-xml = ">=0.29, <0.32"
tokio = { version = "1.29", optional = true, features = ["io-util"] } tokio = { version = "1.29", optional = true, features = ["io-util"] }

@ -15,8 +15,9 @@ Support for [SPARQL-star](https://w3c.github.io/rdf-star/cg-spec/2021-12-17.html
This crate is intended to be a building piece for SPARQL client and server implementations in Rust like [Oxigraph](https://oxigraph.org). This crate is intended to be a building piece for SPARQL client and server implementations in Rust like [Oxigraph](https://oxigraph.org).
Usage example converting a JSON result file into a TSV result file: The entry points of this library are the two [`QueryResultsParser`] and [`QueryResultsSerializer`] structs.
Usage example converting a JSON result file into a TSV result file:
```rust ```rust
use sparesults::{QueryResultsFormat, QueryResultsParser, FromReadQueryResultsReader, QueryResultsSerializer}; use sparesults::{QueryResultsFormat, QueryResultsParser, FromReadQueryResultsReader, QueryResultsSerializer};
use std::io::Result; use std::io::Result;

@ -115,9 +115,13 @@ impl QueryResultsSerializer {
/// Returns a `SolutionsWriter` allowing writing query solutions into the given [`Write`] implementation. /// Returns a `SolutionsWriter` allowing writing query solutions into the given [`Write`] implementation.
/// ///
/// <div class="warning">Do not forget to run the [`finish`](ToWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div> /// <div class="warning">
/// ///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div> /// Do not forget to run the [`finish`](ToWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
///
/// This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// ///
/// Example in XML (the API is the same for JSON, CSV and TSV): /// Example in XML (the API is the same for JSON, CSV and TSV):
/// ``` /// ```
@ -158,9 +162,13 @@ impl QueryResultsSerializer {
/// Returns a `SolutionsWriter` allowing writing query solutions into the given [`Write`] implementation. /// Returns a `SolutionsWriter` allowing writing query solutions into the given [`Write`] implementation.
/// ///
/// <div class="warning">Do not forget to run the [`finish`](ToWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div> /// <div class="warning">
///
/// Do not forget to run the [`finish`](ToWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
/// ///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div> /// This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// ///
/// Example in XML (the API is the same for JSON, CSV and TSV): /// Example in XML (the API is the same for JSON, CSV and TSV):
/// ``` /// ```
@ -223,9 +231,13 @@ impl From<QueryResultsFormat> for QueryResultsSerializer {
/// ///
/// Could be built using a [`QueryResultsSerializer`]. /// Could be built using a [`QueryResultsSerializer`].
/// ///
/// <div class="warning">Do not forget to run the [`finish`](ToWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div> /// <div class="warning">
/// ///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div> /// Do not forget to run the [`finish`](ToWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
///
/// This writer does unbuffered writes. You might want to use [`BufWriter`](io::BufWriter) to avoid that.</div>
/// ///
/// Example in TSV (the API is the same for JSON, XML and CSV): /// Example in TSV (the API is the same for JSON, XML and CSV):
/// ``` /// ```
@ -299,9 +311,13 @@ impl<W: Write> ToWriteSolutionsWriter<W> {
/// Could be built using a [`QueryResultsSerializer`]. /// Could be built using a [`QueryResultsSerializer`].
/// ///
/// <div class="warning">Do not forget to run the [`finish`](ToTokioAsyncWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div> /// <div class="warning">
///
/// Do not forget to run the [`finish`](ToTokioAsyncWriteSolutionsWriter::finish()) method to properly write the last bytes of the file.</div>
///
/// <div class="warning">
/// ///
/// <div class="warning">This writer does unbuffered writes. You might want to use [`BufWriter`](tokio::io::BufWriter) to avoid that.</div> /// This writer does unbuffered writes. You might want to use [`BufWriter`](tokio::io::BufWriter) to avoid that.</div>
/// ///
/// Example in TSV (the API is the same for JSON, CSV and XML): /// Example in TSV (the API is the same for JSON, CSV and XML):
/// ``` /// ```

@ -1,6 +1,6 @@
[package] [package]
name = "spargebra" name = "spargebra"
version = "0.3.0-alpha.1-dev" version = "0.3.0-alpha.1"
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
readme = "README.md" readme = "README.md"
@ -25,7 +25,7 @@ peg = "0.8"
rand = "0.8" rand = "0.8"
oxiri = "0.2.3-alpha.1" oxiri = "0.2.3-alpha.1"
oxilangtag = "0.1" oxilangtag = "0.1"
oxrdf = { version = "0.2.0-alpha.1-dev", path="../oxrdf" } oxrdf = { version = "0.2.0-alpha.1", path="../oxrdf" }
[lints] [lints]
workspace = true workspace = true

@ -1,6 +1,6 @@
[package] [package]
name = "sparopt" name = "sparopt"
version = "0.1.0-alpha.1-dev" version = "0.1.0-alpha.1"
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
readme = "README.md" readme = "README.md"
@ -21,9 +21,9 @@ sep-0002 = ["spargebra/sep-0002"]
sep-0006 = ["spargebra/sep-0006"] sep-0006 = ["spargebra/sep-0006"]
[dependencies] [dependencies]
oxrdf = { version = "0.2.0-alpha.1-dev", path="../oxrdf" } oxrdf = { version = "0.2.0-alpha.1", path="../oxrdf" }
rand = "0.8" rand = "0.8"
spargebra = { version = "0.3.0-alpha.1-dev", path="../spargebra" } spargebra = { version = "0.3.0-alpha.1", path="../spargebra" }
[lints] [lints]
workspace = true workspace = true

@ -1,6 +1,6 @@
[package] [package]
name = "sparql-smith" name = "sparql-smith"
version = "0.1.0-alpha.5-dev" version = "0.1.0-alpha.5"
authors.workspace = true authors.workspace = true
license.workspace = true license.workspace = true
readme = "README.md" readme = "README.md"

@ -1,5 +1,7 @@
//! Utilities to read and write RDF graphs and datasets using [OxRDF I/O](https://crates.io/crates/oxrdfio). //! Utilities to read and write RDF graphs and datasets using [OxRDF I/O](https://crates.io/crates/oxrdfio).
//! //!
//! The entry points of this module are the two [`RdfParser`] and [`RdfSerializer`] structs.
//!
//! Usage example converting a Turtle file to a N-Triples file: //! Usage example converting a Turtle file to a N-Triples file:
//! ``` //! ```
//! use oxigraph::io::{RdfFormat, RdfParser, RdfSerializer}; //! use oxigraph::io::{RdfFormat, RdfParser, RdfSerializer};

@ -55,7 +55,9 @@ impl GraphSerializer {
/// Allows writing triples. /// Allows writing triples.
/// Could be built using a [`GraphSerializer`]. /// Could be built using a [`GraphSerializer`].
/// ///
/// <div class="warning">Do not forget to run the [`finish`](TripleWriter::finish()) method to properly write the last bytes of the file.</div> /// <div class="warning">
///
/// Do not forget to run the [`finish`](TripleWriter::finish()) method to properly write the last bytes of the file.</div>
/// ///
/// ``` /// ```
/// use oxigraph::io::{GraphFormat, GraphSerializer}; /// use oxigraph::io::{GraphFormat, GraphSerializer};
@ -138,7 +140,9 @@ impl DatasetSerializer {
/// Allows writing triples. /// Allows writing triples.
/// Could be built using a [`DatasetSerializer`]. /// Could be built using a [`DatasetSerializer`].
/// ///
/// <div class="warning">Do not forget to run the [`finish`](QuadWriter::finish()) method to properly write the last bytes of the file.</div> /// <div class="warning">
///
/// Do not forget to run the [`finish`](QuadWriter::finish()) method to properly write the last bytes of the file.</div>
/// ///
/// ``` /// ```
/// use oxigraph::io::{DatasetFormat, DatasetSerializer}; /// use oxigraph::io::{DatasetFormat, DatasetSerializer};

@ -1,5 +1,7 @@
//! API to access an on-disk [RDF dataset](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset). //! API to access an on-disk [RDF dataset](https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset).
//! //!
//! The entry point of the module is the [`Store`] struct.
//!
//! Usage example: //! Usage example:
//! ``` //! ```
//! use oxigraph::store::Store; //! use oxigraph::store::Store;
@ -605,7 +607,9 @@ impl Store {
/// Adds atomically a set of quads to this store. /// Adds atomically a set of quads to this store.
/// ///
/// <div class="warning">This operation uses a memory heavy transaction internally, use the [`bulk_loader`](Store::bulk_loader) if you plan to add ten of millions of triples.</div> /// <div class="warning">
///
/// This operation uses a memory heavy transaction internally, use the [`bulk_loader`](Store::bulk_loader) if you plan to add ten of millions of triples.</div>
pub fn extend( pub fn extend(
&self, &self,
quads: impl IntoIterator<Item = impl Into<Quad>>, quads: impl IntoIterator<Item = impl Into<Quad>>,
@ -918,7 +922,9 @@ impl Store {
/// After its creation, the backup is usable using [`Store::open`] /// After its creation, the backup is usable using [`Store::open`]
/// like a regular Oxigraph database and operates independently from the original database. /// like a regular Oxigraph database and operates independently from the original database.
/// ///
/// <div class="warning">Backups are only possible for on-disk databases created using [`Store::open`].</div> /// <div class="warning">
///
/// Backups are only possible for on-disk databases created using [`Store::open`].</div>
/// Temporary in-memory databases created using [`Store::new`] are not compatible with RocksDB backup system. /// Temporary in-memory databases created using [`Store::new`] are not compatible with RocksDB backup system.
/// ///
/// <div class="warning">An error is raised if the `target_directory` already exists.</div> /// <div class="warning">An error is raised if the `target_directory` already exists.</div>
@ -1497,13 +1503,15 @@ impl Iterator for GraphNameIter {
/// A bulk loader allowing to load at lot of data quickly into the store. /// A bulk loader allowing to load at lot of data quickly into the store.
/// ///
/// <div class="warning">The operations provided here are not atomic.</div> /// <div class="warning">The operations provided here are not atomic.
/// If the operation fails in the middle, only a part of the data may be written to the store. /// If the operation fails in the middle, only a part of the data may be written to the store.
/// Results might get weird if you delete data during the loading process. /// Results might get weird if you delete data during the loading process.</div>
/// ///
/// <div class="warning">It is optimized for speed.</div> /// <div class="warning">
/// Memory usage is configurable using [`BulkLoader::with_max_memory_size_in_megabytes`] ///
/// and the number of used threads with [`BulkLoader::with_num_threads`]. /// It is optimized for speed.</div>
/// Memory usage is configurable using [`with_max_memory_size_in_megabytes`](Self::with_max_memory_size_in_megabytes)
/// and the number of used threads with [`with_num_threads`](Self::with_num_threads).
/// By default the memory consumption target (excluding the system and RocksDB internal consumption) /// By default the memory consumption target (excluding the system and RocksDB internal consumption)
/// is around 2GB per thread and 2 threads. /// is around 2GB per thread and 2 threads.
/// These targets are considered per loaded file. /// These targets are considered per loaded file.
@ -1598,7 +1606,9 @@ impl BulkLoader {
/// If the parsing fails in the middle of the file, only a part of it may be written to the store. /// If the parsing fails in the middle of the file, only a part of it may be written to the store.
/// Results might get weird if you delete data during the loading process.</div> /// Results might get weird if you delete data during the loading process.</div>
/// ///
/// <div class="warning">This method is optimized for speed. See [the struct](BulkLoader) documentation for more details.</div> /// <div class="warning">
///
/// This method is optimized for speed. See [the struct](Self) documentation for more details.</div>
/// ///
/// To get better speed on valid datasets, consider enabling [`RdfParser::unchecked`] option to skip some validations. /// To get better speed on valid datasets, consider enabling [`RdfParser::unchecked`] option to skip some validations.
/// ///
@ -1668,7 +1678,9 @@ impl BulkLoader {
/// If the parsing fails in the middle of the file, only a part of it may be written to the store. /// If the parsing fails in the middle of the file, only a part of it may be written to the store.
/// Results might get weird if you delete data during the loading process.</div> /// Results might get weird if you delete data during the loading process.</div>
/// ///
/// <div class="warning">This method is optimized for speed. See [the struct](BulkLoader) documentation for more details.</div> /// <div class="warning">
///
/// This method is optimized for speed. See [the struct](Self) documentation for more details.</div>
/// ///
/// Usage example: /// Usage example:
/// ``` /// ```
@ -1727,7 +1739,9 @@ impl BulkLoader {
/// If the parsing fails in the middle of the file, only a part of it may be written to the store. /// If the parsing fails in the middle of the file, only a part of it may be written to the store.
/// Results might get weird if you delete data during the loading process.</div> /// Results might get weird if you delete data during the loading process.</div>
/// ///
/// <div class="warning">This method is optimized for speed. See [the struct](BulkLoader) documentation for more details.</div> /// <div class="warning">
///
/// This method is optimized for speed. See [the struct](Self) documentation for more details.</div>
/// ///
/// Usage example: /// Usage example:
/// ``` /// ```
@ -1788,7 +1802,9 @@ impl BulkLoader {
/// If the process fails in the middle of the file, only a part of the data may be written to the store. /// If the process fails in the middle of the file, only a part of the data may be written to the store.
/// Results might get weird if you delete data during the loading process.</div> /// Results might get weird if you delete data during the loading process.</div>
/// ///
/// <div class="warning">This method is optimized for speed. See [the struct](BulkLoader) documentation for more details.</div> /// <div class="warning">
///
/// This method is optimized for speed. See [the struct](Self) documentation for more details.</div>
pub fn load_quads( pub fn load_quads(
&self, &self,
quads: impl IntoIterator<Item = impl Into<Quad>>, quads: impl IntoIterator<Item = impl Into<Quad>>,
@ -1802,7 +1818,9 @@ impl BulkLoader {
/// If the process fails in the middle of the file, only a part of the data may be written to the store. /// If the process fails in the middle of the file, only a part of the data may be written to the store.
/// Results might get weird if you delete data during the loading process.</div> /// Results might get weird if you delete data during the loading process.</div>
/// ///
/// <div class="warning">This method is optimized for speed. See [the struct](BulkLoader) documentation for more details.</div> /// <div class="warning">
///
/// This method is optimized for speed. See [the struct](Self) documentation for more details.</div>
pub fn load_ok_quads<EI, EO: From<StorageError> + From<EI>>( pub fn load_ok_quads<EI, EO: From<StorageError> + From<EI>>(
&self, &self,
quads: impl IntoIterator<Item = Result<impl Into<Quad>, EI>>, quads: impl IntoIterator<Item = Result<impl Into<Quad>, EI>>,

@ -25,7 +25,7 @@ rocksdb-pkg-config = ["oxigraph/rocksdb-pkg-config"]
rustls = ["oxigraph/http-client-rustls-native"] rustls = ["oxigraph/http-client-rustls-native"]
[dependencies] [dependencies]
oxigraph = { version = "0.4.0-alpha.1-dev", path="../lib" } oxigraph = { version = "0.4.0-alpha.1", path="../lib" }
pyo3 = { version = "0.20.1", features = ["extension-module"] } pyo3 = { version = "0.20.1", features = ["extension-module"] }
[lints] [lints]

@ -1,6 +1,19 @@
Migration Guide Migration Guide
=============== ===============
From 0.3 to 0.4
"""""""""""""""
* Python 3.7 and ``musllinux_1_1`` support have been removed.
* :py:class:`OSError` is now raised instead of :py:class:`IOError` on OS errors.
* The ``mime_type`` parameter have been renamed to ``format`` in I/O functions.
Using :py:class:`RdfFormat` is recommended to describe formats.
* Boolean SPARQL results are now encoded with the :py:class:`QueryBoolean` class and not a simple :py:class:`bool`.
* A `path` parameter has been added to all I/O method to read from a file.
The existing ``input`` parameter now consider :py:class:`str` values to be a serialization to parse.
For example, ``parse(path="foo.ttl")`` will parse the file ``foo.ttl`` whereas ``parse("foo", format=RdfFormat.N_TRIPLES)`` will parse a N-Triples file which content is ``foo``.
From 0.2 to 0.3 From 0.2 to 0.3
""""""""""""""" """""""""""""""

Loading…
Cancel
Save